Unambiguous tool argument compatibility
无歧义的工具参数兼容
Models can populate optional fields that do not affect the requested operation. Rejecting these calls adds retries without protecting any state.
English
Problem
Models can populate optional fields that do not affect the requested operation. Rejecting these calls adds retries without protecting any state.
Decision
grep treats an exact empty include as omitted. Whitespace-only, negated, and comma-separated filters remain invalid. update_goal uses replacement fields only for edit and a blocker reason only for blocked; other actions ignore those known fields. Declared types, consumed values, authority, and exact revisions remain validated. Ignored fields never reach another goal operation or change unrelated state, and call summaries select only values used by the action. write and edit allow absent or blank justification when no sandbox mode is requested or the effective mode is repeated; actual widening retains its reason and approval requirements, and filesystem observation and denial checks remain active. subagent and list_subagent_models treat an exact empty provider, model, or reasoning_effort as omitted; an empty subagent name remains invalid because its error states the accepted format.
This partially supersedes the unused-field rejection in the goal-tool decision. Its authority, lifecycle, scheduling, and persistence decisions remain active. The rules apply to every provider and stay inside the owning tool rather than weakening its underlying service.
Alternatives considered
- Complete strict-schema adaptation first — deferred because it is a separate provider-wide change; these cases have deterministic meanings and direct regression evidence.
- Normalize all empty, null, or zero values — rejected because such values can be meaningful input, including empty file contents and numeric limits.
- Reject every populated inactive field — rejected because the explicit action determines the goal operation, and unused fields cannot alter it.
Consequences
The tools accept these calls without extra mutations. Unit tests cover ignored fields for every goal action, consumed-field and authority failures, stale revisions, filter validation, and real search results. A headless recorded-session scenario verifies both file extensions are searched and completion preserves the original objective and round cap. An SDK recorded-session scenario verifies that empty route fields start a subagent on its default route. These rules give up detecting conflicting intent expressed only in inactive goal fields; they do not weaken authorization or establish a generic coercion policy.
中文
问题
模型可能填写不影响所请求操作的可选字段。拒绝这些调用只会增加重试,并不保护任何状态。
决策
grep 将值恰好为空字符串的 include 视为省略。仅含空白、否定形式和逗号分隔的过滤器仍然无效。update_goal 仅在 edit 时使用替换字段,仅在 blocked 时使用阻塞原因;其他 action 忽略这些已知字段。声明的类型、实际使用的值、权限和精确修订号仍会校验。被忽略的字段不会传入另一种目标操作,也不会改变无关状态;调用摘要仅选择当前 action 使用的值。未请求沙箱模式或重复当前生效模式时,write 和 edit 允许省略理由或提供空白理由;真正升权仍需理由和审批,文件系统观察与拒绝检查继续生效。subagent 和 list_subagent_models 将值恰好为空字符串的 provider、model 或 reasoning_effort 视为省略;空的 subagent name 仍然无效,因为其报错会说明可接受的格式。
本决策部分取代目标工具决策中对无关字段的拒绝规则。其权限、生命周期、调度和持久化决策继续生效。这些规则适用于所有提供方,并保留在所属工具内,不削弱底层服务的校验。
考虑过的替代方案
- 先完成严格 schema 适配——暂缓,因为这是单独的提供方级改造;这些情况具有确定含义和直接的回归证据。
- 统一规范化所有空值、null 或零值——不予采纳,因为这些值可能是有意义的输入,包括空文件内容和数值限制。
- 拒绝所有已填写的非当前 action 字段——不予采纳,因为显式 action 决定目标操作,而未使用的字段无法改变该操作。
后果
工具接受这些调用,且不会产生额外变更。单元测试覆盖每种目标 action 对无关字段的忽略、有效字段与权限失败、陈旧修订号、过滤器校验以及真实搜索结果。headless 会话回放验证两种扩展名的文件都参与搜索,并且完成操作保留原始目标和轮数上限。SDK 会话回放验证空路由字段会让 subagent 按默认路由启动。这些规则放弃检测仅由非当前 action 的目标字段表达的冲突意图;它们不削弱授权,也不建立通用类型转换策略。