Skip to content

codedb-bridge: arguments in no tool's schema are silently dropped on every tool — a typo'd max_result returns the full result set instead of an error #4216

Closed

Description

@dezren39

Problem

routeForTool in bin/codedb-bridge.mjs rejects only a hand-named set of arguments (project on every tool; regex/scope/compact on search/outline). Any other argument key — including a typo of a supported one — is silently dropped on every tool, which breaks the module's own stated contract (header comment, citing #3352): "arguments the daemon cannot honour are rejected by name, never silently ignored."

The advertised inputSchema for each tool lists an exact property set, but nothing enforces it: a caller that sends max_result (typo), case_sensitive: true, a path filter on search, depth on tree/deps, or since on hot gets a successful result computed without that argument — the worst silent-third-path shape, because the caller believes the argument took effect.

Evidence (main a0e6d1d3, file md5 df5e54371d04828465c680e9e96727d3, identical on sandbox clone and laptop clone)

  • routeForTool (codedb-bridge.mjs:155-194): the only rejection helpers are rejectProject and rejectTrue(key) for named keys; there is no allowlist check against the tool's schema properties. Unknown keys are never inspected.
  • sliceData (codedb-bridge.mjs:196-203) only ever reads max_results/limit from the mapped slice — a typo'd key never reaches it, so no error is possible downstream.

Verified this run on the laptop (probe ~/git/fleet/probe-2026-11-01-laneB-bridgeargs/, verbatim bridge module @a0e6d1d3) — every one of these was ACCEPTED with the extra argument silently dropped:

  • codedb_search {query, max_result: 5} (typo) → route /explore/search?q=x, no slice
  • codedb_search {query, case_sensitive: true} → accepted, plain substring route
  • codedb_search {query, path: "src/"} → accepted, no path filter applied
  • codedb_tree {depth: 2} and codedb_tree {max_results: 3} → accepted (tree's schema has no properties)
  • codedb_hot {since: "2026-01-01"} → accepted
  • codedb_outline {path, max_results: 2}, codedb_deps {path, depth: 1}, codedb_symbol {name, limit: 5} → accepted

End-to-end through createHandler with a stub daemon returning 5 results: codedb_search {query: "x", max_result: 2} returned all 5 results, isError unset — the caller's limit silently never happened.

Controls: the named rejections do fire — codedb_search {regex: true} and codedb_tree {project} both throw by name, confirming the gap is specifically the never-named keys.

Distinct from

Why it matters

The bridge is the shared per-session front door to codedb for every MCP client in the fleet (#4120). MCP clients — including LLM callers — routinely invent or mistype arguments; today each such call silently returns an unfiltered/unlimited result set instead of an error naming the argument, so the caller reasons from data it believes was filtered or bounded. That is exactly the failure the bridge's #3352 contract was written to prevent, and the named-argument rejections already in the file show the intended behaviour — the allowlist is simply missing.

Acceptance criteria

  • routeForTool rejects, by name, any argument key outside the called tool's accepted set (its advertised inputSchema properties plus the explicitly handled rejection keys project/regex/scope/compact where they apply, and body on codedb_symbol), with an error in the existing style naming the argument and the tool.
  • A typo'd argument (max_result on codedb_search, limit on codedb_symbol, any key on codedb_tree) produces an isError tool result naming the key — verified end-to-end through createHandler, not only at routeForTool.
  • All currently accepted valid calls behave identically: the existing bin/codedb-bridge.test.mjs cases pass unchanged, and the named Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 rejections keep their current messages.
  • New tests in bin/codedb-bridge.test.mjs pin the allowlist for every advertised tool (at least one never-named key per tool, plus the search typo case end-to-end).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/codedb-bridgebin/codedb-bridge.mjs — stdio MCP bridge to the shared codedb daemon
    effort/sSmall: expected under 2 hours of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 2, 2026
  4. 34 remaining items

  5. added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked
    task: 6381 (repo-health-code-pilot, repo-worker-code; OpenChamber scheduled lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    state: parked for 20 minutes; queue resume no earlier than 2026-11-02T22:02:16Z.
    fresh_evidence: #4216 OPEN; bound PR #4563 OPEN, authored by dezren39 (Drew); basic OpenCode metered-provider guard check QUEUED. No diff or files inspected.
    resume: after the park window, re-read PR state and checks fresh; do not inspect or merge while the Drew-owned restriction remains.
    labels: queue/parked, status/parked, work/assigned.

  7. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: picked_up
    task: 6381 (repo-health-code-pilot, repo-worker-code; OpenChamber scheduled lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    state: claimed via atomic queue claim; first checkpoint records origin=openchamber-scheduled-lane.
    fresh_evidence: #4216 OPEN; bound PR #4563 OPEN, branch queue/6381-4216-bridge-arg-allowlist @ 2c02d33, authored by dezren39 (Drew); basic OpenCode metered-provider guard now PASS (was QUEUED), CodeRabbit skipping. No PR diff/files inspected.
    next: escalate — merge decision is Drew-only on a Drew-owned PR.

    agent-note:v1
    event: blocked (escalated-to-user)
    task: 6381 (repo-health-code-pilot, repo-worker-code; OpenChamber scheduled lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
    state: blocked; claim released. PR #4563 is Drew-authored so the worker must never touch or merge it (runbook non-negotiable). Work itself is ready: targeted bridge tests 11/11 pass at 2c02d33, CI green.
    fresh_evidence: gh pr checks 4563 — basic guard PASS 7s; mergeStateStatus UNKNOWN; PR still OPEN.
    resume: Drew merges #4563 (closes #4216); a later lane then completes 6381 as fixed_merged with fresh verification.
    labels: queue/blocked, status/blocked, user/escalated; removed queue/parked, status/parked, work/assigned.

  9. added a commit that references this issue on Nov 10, 2026
  10. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    state: done
    task: 14745
    lane: code-v
    kind: pr_shepherd

    Done - PR #4563 MERGED as 7faa795 (batch issue #7297, part 4), and issue #4216 is CLOSED via the PR. The bridge now rejects any argument in no tool's schema by name (general allowlist: schema properties + handled rejection keys), instead of silently dropping typos like max_result.

    Shepherd work: merged current origin/main into the PR branch (clean), verified on the merged tree - node --test bin/codedb-bridge.test.mjs: 19 pass, 0 fail. Confirmed beforehand that main had NOT superseded the PR (main rejects only specific known keys from #3352/#4197; arbitrary unknown keys were still dropped). The stale user/escalated on #4216 (2026-11-02, authorship-based premise revoked by Drew 2026-11-07; PR #4563 itself unlabeled, no hard-stop labels) was dispositioned in the pickup note on PR #4563. Codex had no substantive findings (its review of the new head was still running at merge time with none reported). Task 14745 completes as fixed_merged; issue #7297 stays open for its remaining parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/codedb-bridgebin/codedb-bridge.mjs — stdio MCP bridge to the shared codedb daemoneffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/blockedQueue or user escalation statequeue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation statetask/triageQueue packet kind: verify, reproduce, and route this itemuser/escalatedRequires a Drew decision or access

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions