Conversation
v0.2.5808 broke OpenAI-backed MCP clients (codex, forgecode, etc.): their strict-mode tool-schema validator rejects `oneOf` outright with `Invalid schema for function 'mcp_codedb_tool_codedb_bundle': 'oneOf' is not permitted`, making `codedb_bundle` unusable on those clients. Default to the raw schema (Stage 1's required: ["tool", "arguments"] still applies). Set CODEDB_DISCRIMINATED_SCHEMA=1 on the codedb process to opt back into the augmented oneOf for Anthropic-backed clients that benefit from it. The builder (`buildAugmentedToolsList`) is unchanged; only the call site in `pub fn run` is gated on the env var. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
justrach
added a commit
that referenced
this pull request
May 7, 2026
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>
This was referenced May 7, 2026
Closed
justrach
added a commit
that referenced
this pull request
May 7, 2026
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>
justrach
added a commit
that referenced
this pull request
May 7, 2026
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>
justrach
added a commit
that referenced
this pull request
May 7, 2026
* test(mcp): issue-443 failing test for disabling codedb_bundle by default 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> * fix(mcp): disable codedb_bundle by default — v0.2.5811 (#443) 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> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
v0.2.5808 broke OpenAI-Responses-API-backed MCP clients (codex, forgecode, etc.). OpenAI's strict-mode tool-schema validator rejects
oneOfoutright:This makes the entire
codedb_bundletool unusable on those clients. Anthropic acceptsoneOfand benefits from the constraint, so the builder isn't going away — just gated behind an env var.Change
tools/listserves the raw schema with Stage 1'srequired: ["tool", "arguments"]only. Works on every MCP client.CODEDB_DISCRIMINATED_SCHEMA=1re-enables the augmentedoneOffor Anthropic-backed clients (Claude Code, etc.) that want the stronger constraint.buildAugmentedToolsListitself is unchanged; only the call site inpub fn runis gated.Test plan
zig build test— 513/513 pass.oneOfin the served bundle items by default; settingCODEDB_DISCRIMINATED_SCHEMA=1brings it back.mcp_codedb_tool_codedb_bundle.🤖 Generated with Claude Code