fix(cli): let Agent Manager tool fields be null so strict providers can omit them - #13206
Merged
Merged
Conversation
chrarnoldus
approved these changes
Aug 19, 2026
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13029.
The
agent_managertool advertises one flat object covering both starting sessions and managing existing ones. That flat shape is required: Anthropic rejects a tool whoseinput_schemahas a top-levelanyOf,oneOf, orallOf, and since the tool sorts totools[0]wheneverKILO_CLIENT=vscode, a rejected schema fails the entire request rather than just that tool call. #13197 tried a discriminated union and had to be reverted in #13203 for exactly this reason.The cost of flattening is that providers enforcing strict structured outputs, notably the OpenAI Responses API, must supply a value for every advertised property. None of the fields accepted
null, so a model starting a worktree session had no way to declineactionand was forced to invent a value. The inventedactionthen took precedence overmodeandtasks, so the tool returned an overview of existing sessions and no session was created. Reproduced ongpt-5.6-sol, which sends:{"mode":"worktree","versions":false,"tasks":[{"prompt":"write a haiku","name":"probe","branchName":"probe-branch","model":"","variant":""}], "action":"list","filter":null,"sessionID":"","prompt":"write a haiku","sectionID":null}Every advertised field is now nullable, so
nullis how a model states that a field is not part of the operation it chose, and the per-field descriptions say when to use it. The runtime already resolvedaction: nullto a start request, so only the advertised schema changes here. The five-branchParamsunion remains the authoritative validator and its behavior is unchanged.Two incidental cleanups in the same schema:
versionsandfilterwere double-wrapped inSchema.optional, which emitted a redundant nestedanyOf. Both are now flat. Thetasksbounds of 1 to 20 are preserved through the nullable wrapper.This does not reintroduce strict rejection of mixed payloads. A model that still sends a populated
actionalongsidemodeandtaskscontinues to be routed byaction. Turning that case into an explicit error is worthwhile but is a separate behavior change, tracked in #13205 along with the systemic Anthropic normalization inProviderTransform.schemafrom #12905.Also adds
test/kilocode/tool-schema-provider-compat.test.ts, which walks every advertised tool and asserts an object root with no top-level combinator. It lives outside any single tool's test file and is phrased as a cross-tool invariant on purpose: this break shipped twice, and the second time the per-tool assertion protecting it was rewritten in the same diff that broke the shape, so CI stayed green. Confirmed the guard fails against the reverted-away schema before relying on it.