fix(mcp): disable codedb_bundle by default (v0.2.5811, #443)#444
Merged
fix(mcp): disable codedb_bundle by default (v0.2.5811, #443)#444
Conversation
The codedb_bundle tool has been a footgun across multiple stages: #434 — schema permitted empty arguments (Stage 1 fix: required arguments) #437 — Stage 2 oneOf augmentation broke OpenAI strict-mode (#440 hotfix) #441 — codedb_projects sub-op replay loop in planners Even with all of the above, OpenAI clients still emit {"tool":"codedb_*","arguments":{}} because the default schema's arguments field is a bare {type:"object"} with no inner shape, and the discriminated oneOf is opt-in only. Disable codedb_bundle entirely until the schema can be reworked. The dispatcher-side handler stays (so clients with cached schemas don't crash), but the runtime tools/list response no longer advertises it. CODEDB_BUNDLE_ENABLED=1 re-enables advertisement. Asserts: - buildToolsListResponse(.{ .bundle_enabled = false, ... }) omits codedb_bundle from the tools array - codedb_search and codedb_outline are still advertised (sanity) - buildToolsListResponse(.{ .bundle_enabled = true, ... }) re-includes codedb_bundle Compile-fails on main (the function does not yet exist). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Across multiple stages — #434 (empty-args), #437 (oneOf augmentation), #440 (OpenAI strict-mode regression), #441 (codedb_projects replay) — codedb_bundle has remained a footgun for OpenAI/codex/forgecode clients because the default schema can't bind sub-tool arg shape without oneOf, and oneOf is OpenAI-strict-incompatible. Disable bundle advertisement in tools/list by default. Dispatcher-side handler stays so cached-schema clients don't crash on call. Set CODEDB_BUNDLE_ENABLED=1 to re-advertise. Refactor: extract buildToolsListResponse(alloc, opts) — opts are { bundle_enabled, discriminated_opt_in }. run() reads the two env vars (CODEDB_BUNDLE_ENABLED, CODEDB_DISCRIMINATED_SCHEMA) and passes them into the builder. Closes #443. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
730ce74 to
4d86c14
Compare
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.
Summary
codedb_bundleadvertisement intools/listby default. The dispatcher-side handler stays so any client with a cached schema doesn't crash on call. SetCODEDB_BUNDLE_ENABLED=1to re-advertise.run()intobuildToolsListResponse(alloc, opts)with{ bundle_enabled, discriminated_opt_in }flags.Why
Across multiple stages — #434 (empty-args), #437 (oneOf augmentation), #440 (OpenAI strict-mode regression), #441 (codedb_projects replay) —
codedb_bundlehas remained a footgun for OpenAI/codex/forgecode clients. The default schema can't bind sub-tool argument shape withoutoneOf, andoneOfis OpenAI-strict-incompatible, so we keep seeingarguments: {}payloads followed byreceived keys: [tool, arguments]errors. Disable until the schema can be reworked to bind args inline (noargumentswrapper).Closes #443.
Test plan
zig build test— all 517 tests passtest "issue-443: codedb_bundle is omitted from default tools/list response"— runtime response withbundle_enabled = falsedoes not advertise codedb_bundletest "issue-443: codedb_bundle is advertised when CODEDB_BUNDLE_ENABLED=1"— re-enable path workstools_listconst continue to pass (the canonical full-schema const is unchanged; only the runtime response is filtered)🤖 Generated with Claude Code