Skip to content

fix(mcp): disable codedb_bundle by default (v0.2.5811, #443)#444

Merged
justrach merged 2 commits intomainfrom
fix/issue-443-disable-bundle
May 7, 2026
Merged

fix(mcp): disable codedb_bundle by default (v0.2.5811, #443)#444
justrach merged 2 commits intomainfrom
fix/issue-443-disable-bundle

Conversation

@justrach
Copy link
Copy Markdown
Owner

@justrach justrach commented May 7, 2026

Summary

  • Disables codedb_bundle advertisement in tools/list by default. The dispatcher-side handler stays so any client with a cached schema doesn't crash on call. Set CODEDB_BUNDLE_ENABLED=1 to re-advertise.
  • Refactors the inline tools_list builder in run() into buildToolsListResponse(alloc, opts) with { bundle_enabled, discriminated_opt_in } flags.
  • Bumps to v0.2.5811.

Why

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. The default schema can't bind sub-tool argument shape without oneOf, and oneOf is OpenAI-strict-incompatible, so we keep seeing arguments: {} payloads followed by received keys: [tool, arguments] errors. Disable until the schema can be reworked to bind args inline (no arguments wrapper).

Closes #443.

Test plan

🤖 Generated with Claude Code

justrach and others added 2 commits May 7, 2026 10:34
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>
@justrach justrach force-pushed the fix/issue-443-disable-bundle branch from 730ce74 to 4d86c14 Compare May 7, 2026 02:34
@justrach justrach merged commit 7787a22 into main May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: disable codedb_bundle by default — schema footgun keeps surfacing in OpenAI clients

1 participant