Skip to content

revert(agent-manager): restore provider-compatible tool schema - #13203

Merged
marius-kilocode merged 2 commits into
mainfrom
revert-strict-agent-manager-tool-schema
Aug 18, 2026
Merged

revert(agent-manager): restore provider-compatible tool schema#13203
marius-kilocode merged 2 commits into
mainfrom
revert-strict-agent-manager-tool-schema

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Reverts #13197.

That PR changed the agent_manager tool's advertised input_schema from a flat object to a root-level anyOf union of five operation branches. Anthropic rejects that shape outright on every route (direct, Bedrock, and Vertex):

tools.0.custom.input_schema.type: Field required

Supplying the missing type: "object" surfaces the underlying constraint:

input_schema does not support oneOf, allOf, or anyOf at the top level

The blast radius is much wider than Agent Manager. agent_manager is advertised whenever KILO_CLIENT=vscode, and the tool map is sorted alphabetically before the provider call, so it lands on tools.0. A single rejected tool schema aborts the entire request, which means every message to every Claude model in the VS Code extension fails, including ones that never touch Agent Manager. A bare "Say OK and nothing else." prompt reproduces it with KILO_CLIENT=vscode and succeeds with KILO_CLIENT=cli.

This is a re-regression. #12244 fixed this same incompatibility on 2026-07-15 by advertising a flat object schema while keeping the Effect union as the runtime validator, and added a regression test asserting an object root with no top-level combinators.

That test was not deleted by #13197, it was inverted in place:

- expect(schema.type).toBe("object")
- expect(schema.anyOf).toBeUndefined()
+ expect(schema.type).toBeUndefined()
+ expect(schema.anyOf).toHaveLength(5)

The test was also renamed from "uses an object-root input schema without combinators" to "advertises each operation as a strict union branch", so it no longer reads as a provider-compatibility guard. The two assertions encoding the Anthropic constraint now assert its opposite, which is why CI stayed green while main could not talk to any Claude model. An inverted assertion is harder to catch in review than a deleted one, because the test count does not move and the change looks like routine test maintenance for a new design.

Reverting rather than forward-fixing because #13197 closed no reported issue. Its motivation was speculative hardening against a model sending a mixed start/manage payload, and no user-facing behavior depends on it. A correct forward fix also has to satisfy a second, opposing constraint: with a flat schema, providers that force strict structured outputs populate every advertised property, so the strict branch check has to tolerate null and empty values or it rejects legitimate calls. Claude does this too, emitting {"action":"stop","sessionID":"...","mode":null,"tasks":null,...} unprompted. That design introduces semantics that have never run in production and should land on its own merits with review, not as a same-day patch on top of a broken main.

Restoring the previous schema returns agent_manager to a shape that has been in production since 2026-07-15. A follow-up will add a registry-wide guard that walks every advertised tool and asserts an object root with no top-level combinator. That guard deliberately lives outside any single tool's test file and is phrased as a cross-tool invariant, because the failure mode here was not missing coverage but a per-tool assertion being rewritten by the same change that broke the shape. Flipping a shared invariant requires consciously exempting your own tool, which is visible in review.

…l-schema"

This reverts commit eb73124, reversing
changes made to 9f04990.
Comment thread packages/opencode/test/kilocode/agent-manager-tool.test.ts Outdated
Co-authored-by: Christiaan Arnoldus <christiaan.arnoldus@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants