Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/supervisor/crossagentMcp/toolRegistry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,10 @@ describe("subagent tool registration", () => {
it("declares required fields on the subagent tool schemas", () => {
const byName = new Map(TOOLS.map((tool) => [tool.name, tool]));
expect(byName.get("spawn_agent")!.inputSchema).toMatchObject({
oneOf: [{ required: ["prompt"] }, { required: ["tasks"] }],
oneOf: [
{ type: "object", required: ["prompt"] },
{ type: "object", required: ["tasks"] },
],
});
expect(byName.get("get_agent")!.inputSchema).toMatchObject({ required: ["id"] });
expect(byName.get("set_routing_preference")!.inputSchema).toMatchObject({
Expand All @@ -482,7 +485,10 @@ describe("subagent tool registration", () => {
required: ["tags"],
});
expect(byName.get("wait_for_agent")!.inputSchema).toMatchObject({
oneOf: [{ required: ["run_id"] }, { required: ["run_ids"] }],
oneOf: [
{ type: "object", required: ["run_id"] },
{ type: "object", required: ["run_ids"] },
],
});
expect(byName.get("get_status")!.inputSchema).toMatchObject({ required: ["run_id"] });
expect(byName.get("cancel")!.inputSchema).toMatchObject({ required: ["run_id"] });
Expand Down
13 changes: 11 additions & 2 deletions src/supervisor/crossagentMcp/toolRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ const BASE_TOOLS: ToolSpec[] = [
description: TIMEOUT_S_DESCRIPTION,
},
},
oneOf: [{ required: ["prompt"] }, { required: ["tasks"] }],
// Keep every root union branch explicitly object-typed. Some OpenAI-compatible
// providers reject `required`-only branches because they also match non-objects.
oneOf: [
{ type: "object", required: ["prompt"] },
{ type: "object", required: ["tasks"] },
],
},
},
{
Expand Down Expand Up @@ -243,7 +248,11 @@ const BASE_TOOLS: ToolSpec[] = [
description: TIMEOUT_S_DESCRIPTION,
},
},
oneOf: [{ required: ["run_id"] }, { required: ["run_ids"] }],
// See the spawn_agent schema above for why these branches repeat the root type.
oneOf: [
{ type: "object", required: ["run_id"] },
{ type: "object", required: ["run_ids"] },
],
},
},
{
Expand Down