Skip to content

fix(server): merged tool schemas say which fields each tag requires - #32595

Open
MiaAI-Lab wants to merge 4 commits into
pingdotgg:mainfrom
MiaAI-Lab:fix/merged-tool-schema-required-fields
Open

MiaAI-Lab wants to merge 4 commits into
pingdotgg:mainfrom
MiaAI-Lab:fix/merged-tool-schema-required-fields

Conversation

@MiaAI-Lab

@MiaAI-Lab MiaAI-Lab commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

advertisedJsonSchema merges a tagged union into one object schema for providers that cannot take oneOf. The merged schema's required keeps only fields that every branch requires, and nothing tells the model which fields a particular tag needs. For t3_thread_launch that means baseRef, which the worktree branch requires, is invisible as a requirement: models launch worktree threads without it and T3 rejects the call.

This is a small, focused fix for that defect (contributing guide's "obvious bug" exception): it changes only the generated description of the merged schema, not tool behavior.

Fix

When merging, the tag property gets a description naming each branch's own required fields, for example "worktree requires baseRef." Fields every branch requires stay in required as before, and the schema is otherwise unchanged.

The advertised tool list grows by 465 bytes, so agentContextBudget.json is updated and this PR needs the agent-context-increase label.

Evidence

  • apps/server/src/mcp/advertisedJsonSchema.test.ts: the extended assertion fails on current main (25bf84a) and passes with the fix.
  • AgentContextBudget.test.ts passes with the updated budget; vp run check:changed passes.
  • Measured with evals/mcp-tool-use on GLM-5.3-Flash (local server), the five worktree-launch cases, 3 samples each: through Pi 3/15 -> 9/15 passing (launches missing baseRef 2 -> 0); through Codex 8/15 -> 10/15 (5 -> 3).
  • Not checked: Claude or GPT models on these cases.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 7, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2a443bd

Macroscope's review found this PR approvable — Merged MCP tool schemas now describe which fields each tag requires, with the tool-list size fixture updated accordingly. Existing validation and tool behavior remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Tagged-object schemas now describe fields required by each tag value when those fields differ across branches. The expected schema and configured MCP tool-list byte count are updated.

Changes: Tagged-union schema descriptions

Layer / File(s) Summary
Generate and validate branch-specific descriptions
apps/server/src/mcp/advertisedJsonSchema.ts, apps/server/src/mcp/advertisedJsonSchema.test.ts, apps/server/src/provider/agentContextBudget.json
The generator adds a description when a branch has required fields not shared by every branch. The test expectation includes the description, and mcpToolListJsonBytes changes from 48,217 to 48,682.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#25423: Adds tagged-object merging to advertisedJsonSchema, which this change extends with branch-specific required-field descriptions.

Suggested reviewers: t3dotgg, yash-singh1, shivamhwp

Merge Risk: Minimal · up to bf921

The larger tool list requires the reported budget-increase approval; no merge-blocking code risk was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly summarizes the main change: merged tool schemas now state which fields each tag requires.
Description check Passed The description explains the problem and fix, justifies the focused change under the obvious-bug exception, and gives specific test and evaluation results, including checks that were not run. It uses …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem and fix, justifies the focused change under the obvious-bug exception, and gives specific test and evaluation results, including checks that were not run. It uses “Fix” and “Evidence” instead of the template’s “Change” and “Verification” headings, but the required information is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2fa521d and bf92134.

Files selected for processing: 1

  • apps/server/src/provider/agentContextBudget.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Merging a tagged union into one object kept only the fields every branch
requires, so models launched worktree threads without baseRef and T3
rejected the call. The tag now names each branch's own required fields.
@MiaAI-Lab
MiaAI-Lab force-pushed the fix/merged-tool-schema-required-fields branch from 2a443bd to 351024d Compare November 7, 2026 20:11
@maria-rcks

maria-rcks commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Merged current main again (merge commit, no rebase) to clear a new conflict in agentContextBudget.json: kept main's values and set mcpToolListJsonBytes to the measured 48682. No other changes. vp run check:changed passes (format, lint, knip, typecheck, tests).

Agent context budget stays red by design: the per-tag description adds 465 bytes to the MCP tool list. Cutting it would drop the fix, so it needs the agent-context-increase label from a maintainer.

…a-required-fields

# Conflicts:
#	apps/server/src/provider/agentContextBudget.json

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants