Repository navigation
fix(provider): reduce tool schemas to Gemini's subset; show degraded MCP reasons in the TUI - #162
Merged
lg2m merged 1 commit intoSep 25, 2026
Conversation
…MCP reasons in the TUI Every built-in tool schema sets `additionalProperties: false`, and MCP servers may declare `$schema`, `$ref`, `oneOf`, and other JSON Schema keywords Gemini's Schema type rejects with HTTP 400, so every tool-using run on `google/*` failed. `ToolSpec` now carries a lazily computed, cached Gemini form (unsupported keywords stripped at every depth) that only the Google codec reads; OpenAI, Anthropic, and Bedrock bodies are byte-for-byte unchanged and the steady-state encode cost is unchanged (one parse per spec, on first use). Four bare `enum` properties gain `"type": "string"`. The TUI now surfaces a degraded tool host's reason (`unavailable MCP servers: linear (credential ... run qq auth set ...)`) as a warning on the composer rule once per distinct message, and under the search row of `/skills`. Also: AGENTS.md names the Linear team `ENG`; the plan lists the eight guide topics the site dropped as unscheduled candidates; local-dev recommends a shared CARGO_TARGET_DIR across worktrees; the website tsconfig comment tracks the nub release that lets it revert. Closes ENG-897, ENG-898.
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.
Follow-ups collected across the onboarding plan. Linear: ENG-897 (Gemini), ENG-898 (the rest).
1. Gemini rejected every tool-using run — fixed (ENG-897)
Every built-in tool schema sets
additionalProperties: false, and Gemini'sSchematype is a restricted OpenAPI subset that rejects it (and$schema,$ref,oneOf, … which MCP servers commonly send) withprovider returned HTTP 400: Invalid JSON payload received. Unknown name "additionalProperties". So anygoogle/*model failed the moment it tried a tool. Found during OB3's manual test.Fix:
ToolSpeccarries a lazily computed, cached Gemini form (OnceLock) with unsupported keywords stripped at every depth; only the Google codec reads it. OpenAI, Anthropic, and Bedrock bodies are byte-for-byte unchanged; catalog digests unchanged (equality/hash stay on the original text). Four bareenumproperties gain"type": "string".Hot path: one
serde_jsonparse per spec on first use, then an atomic load.provider_encodebench, Google, 32 tools × 1 MiB transcript: 389–404 µs before, 404–405 µs after (noise); body 928 bytes smaller.Tests: reduced schema captured on the wire while OpenAI/Anthropic keep the original; computed once and shared by clones; nothing-to-strip returns identical text. The built-in schema fingerprint golden updated (prompt-identity metadata, not a compatibility gate).
2. Degraded MCP reason visible in the TUI (ENG-898)
OB9 made a server with a missing credential degrade instead of failing the run, but the reason only reached
qq doctor. It now shows as a warning on the composer rule once per distinct message (unavailable MCP servers: linear (credential … run qq auth set linear/default)) and under the search row of/skills. A healthy capabilities document clears the memory so a later regression warns again.3–6. Housekeeping
AGENTS.md: Linear team isENG, notDEV; branch examples updated.docs/plans/onboarding-ux.md: the eight guide topics the site dropped, as unscheduled candidates with the source material for each.docs/runbooks/local-dev.md: recommend a sharedCARGO_TARGET_DIRacross.worktrees/(per-worktree targets filled a 915 GB disk this week). No repo.cargo/config.toml— it would affect CI caches.website/tsconfig.jsoncomment: the nub fix (tsconfigextends: exports wildcard subpaths (astro/tsconfigs/strict) never resolve nubjs/nub#804) is merged upstream but not released; revert toextendsafter the next release.Verification
fmt, clippy
-D warnings,cargo test --workspace(1864 on the stacked tip),cargo test -p qq-provider --no-default-features --features test-support,cargo bench -p qq-provider --bench provider_encode.