Problem
The codedb_bundle tool has been a footgun across multiple stages and the empty-args failure mode keeps re-surfacing on OpenAI clients:
Even with all of the above, OpenAI/forgecode/codex 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 (since OpenAI strict-mode rejects oneOf).
The right structural fix is reworking the schema to bind sub-tool arguments inline (no arguments wrapper). Until that lands, disable codedb_bundle entirely so OpenAI clients stop hitting the empty-args error path.
The dispatcher-side handler stays (so any client with a cached schema doesn't crash on call), but the runtime tools/list response no longer advertises it. CODEDB_BUNDLE_ENABLED=1 re-enables advertisement for callers that want to opt back in.
Failing Test
test "issue-443: codedb_bundle is omitted from default tools/list response" {
const response = try mcp_mod.buildToolsListResponse(testing.allocator, .{
.bundle_enabled = false,
.discriminated_opt_in = false,
});
defer testing.allocator.free(response);
const parsed = try std.json.parseFromSlice(std.json.Value, testing.allocator, response, .{});
defer parsed.deinit();
const tools = parsed.value.object.get("tools").?.array;
for (tools.items) |t| {
try testing.expect(!std.mem.eql(u8, t.object.get("name").?.string, "codedb_bundle"));
}
}
Plus a paired test asserting bundle_enabled = true re-includes codedb_bundle. Both committed on `issue-443-failing-test`.
Expected
tools/list (the runtime response served from run()) does not advertise codedb_bundle by default. Setting CODEDB_BUNDLE_ENABLED=1 re-includes it.
Fix
Extract the inline tools_list builder in `run()` into `buildToolsListResponse(alloc, opts)` with a `bundle_enabled` flag (default false). When false, parse `tools_list`, drop the `codedb_bundle` entry, restringify. When true, behave as today.
Problem
The
codedb_bundletool has been a footgun across multiple stages and the empty-args failure mode keeps re-surfacing on OpenAI clients:argumentskey)oneOfaugmentation broke OpenAI strict-mode (hotfix: v0.2.5809 — codedb_bundle oneOf is opt-in (fixes OpenAI strict-mode rejection) #440 hotfix made it opt-in)codedb_projectssub-op replay loop in planners (dispatcher rejection landed in v0.2.5810)Even with all of the above, OpenAI/forgecode/codex clients still emit
{"tool":"codedb_*","arguments":{}}because the default schema'sargumentsfield is a bare{type:"object"}with no inner shape, and the discriminatedoneOfis opt-in only (since OpenAI strict-mode rejectsoneOf).The right structural fix is reworking the schema to bind sub-tool arguments inline (no
argumentswrapper). Until that lands, disablecodedb_bundleentirely so OpenAI clients stop hitting the empty-args error path.The dispatcher-side handler stays (so any client with a cached schema doesn't crash on call), but the runtime
tools/listresponse no longer advertises it.CODEDB_BUNDLE_ENABLED=1re-enables advertisement for callers that want to opt back in.Failing Test
Plus a paired test asserting
bundle_enabled = truere-includescodedb_bundle. Both committed on `issue-443-failing-test`.Expected
tools/list(the runtime response served fromrun()) does not advertisecodedb_bundleby default. SettingCODEDB_BUNDLE_ENABLED=1re-includes it.Fix
Extract the inline tools_list builder in `run()` into `buildToolsListResponse(alloc, opts)` with a `bundle_enabled` flag (default false). When false, parse `tools_list`, drop the `codedb_bundle` entry, restringify. When true, behave as today.