Establish a clear configuration precedence and control policy: explicit user-supplied settings take priority over automatic detection, unless a centralized policy (e.g., cloud/service-side limits or security constraints) explicitly disallows client overrides. Motivation: prevents surprising behavior while allowing deliberate overrides and enforcing safety/consistency where needed.
How to apply:
Examples:
Respect explicit kwarg, otherwise detect: if _, ok := pk.Kwargs[KwArgSudo]; ok { runPacket.IsSudo = sudoArg // explicit override } else { runPacket.IsSudo = IsSudoCommand(cmdStr) // fallback detection }
Enforce cloud defaults server-side (ignore client-specified tokens/choices): // do not trust opts.MaxTokens for cloud; set fixed values before sending cloudReq.MaxTokens = cloudDefaultMaxTokens cloudReq.MaxChoices = cloudDefaultMaxChoices
Documentation: record the precedence rules in the project config guide and call out contexts where server-side policies override client inputs. When changing behavior, log or document when a client-supplied value was ignored so callers can diagnose differences.
Enter the URL of a public GitHub repository