Skip to content

codedb-bridge: regex/scope/compact are rejected only on codedb_search and codedb_outline — silently ignored on codedb_word, codedb_symbol, codedb_hot, codedb_tree and codedb_deps (and limit/max_results are silent no-ops on the wrong tool) #4197

Closed

Description

@dezren39

Problem

bin/codedb-bridge.mjs promises, in its own header (:24-31, per issue #3352):

arguments the daemon cannot honour are rejected by name, never silently ignored — project (the daemon serves exactly one root), regex: true, scope: true, compact: true.

project is indeed rejected on every tool (rejectProject, :119-121, called in every case). But regex / scope / compact are only checked where the author happened to add them:

  • codedb_search (:145-149): rejects regex, scope, compact ✓
  • codedb_outline (:138-140): rejects compact only
  • codedb_symbol (:142-144), codedb_word (:151-153), codedb_hot (:154-156), codedb_tree (:135-137), codedb_deps (:157-160): reject none of them

So regex: true passed to codedb_word is silently dropped and the caller gets exact-word results while believing it asked for a regex search — precisely the silent third path #3352 forbids. The same hole covers misnamed limit arguments: codedb_search honours max_results and silently ignores limit; codedb_hot honours limit and silently ignores max_results (each becomes a slice of [key, undefined], a no-op). Unknown arguments generally (e.g. bogus_arg on codedb_tree) are also silently ignored, though the header's promise is at minimum about the named unhonourable set.

Evidence (verified this run)

Laptop probe ~/git/fleet/probe-2026-11-01-laneA-codedb/ (verbatim copy of bin/codedb-bridge.mjs from main 199a7d27, md5 ca05ede20d2ae1a4760297bbe9320c58, node v24.21.0), calling routeForTool directly:

  • codedb_word {word:"x", regex:true} → OK, route /explore/word?q=x (regex silently dropped)
  • codedb_word {word:"x", scope:true} → OK (scope silently dropped)
  • codedb_symbol {name:"x", compact:true} → OK (compact silently dropped)
  • codedb_hot {limit:2, regex:true} → OK (regex silently dropped)
  • codedb_tree {bogus_arg:1} → OK
  • codedb_search {query:"x", limit:5} → OK, slice:["results",null] (limit silently ignored; the honoured name is max_results)
  • codedb_hot {max_results:5} → OK, slice:["files",null] (max_results silently ignored; the honoured name is limit)
  • Control: codedb_deps {path:"a.rs", project:"/elsewhere"} → THROWS naming project — the per-tool rejection machinery works; it just isn't applied uniformly.

Existing tests (bin/codedb-bridge.test.mjs:36-44) only assert rejection on codedb_search (regex/scope) and codedb_outline (compact) — the two tools that already check — so the gap is invisible to the suite.

Why it matters

Callers (MCP clients, mcpx sessions) passing a familiar argument to the wrong tool get plausible-looking results computed under different semantics than they asked for, with no signal. That is the exact failure mode the bridge's argument contract was written to prevent, and it is asymmetric enough that a client author testing against codedb_search would reasonably conclude all tools behave that way.

Acceptance criteria

  • Every tool rejects regex: true, scope: true, and compact: true by name when the daemon route for that tool cannot honour them (or the rejection set is otherwise made uniform and the header updated to match — no silent divergence between tools).
  • Misnamed limit arguments are not silent no-ops: either limit on codedb_search / max_results on codedb_hot is honoured, or it is rejected by name like the other unhonourable arguments.
  • Tests extended beyond the current search/outline-only cases: for each advertised tool, at least one unhonourable-argument case throws naming the argument; the existing route/rejection tests still pass.

Activity

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

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: new-issue-creator-code-a run 2026-11-01 23:05 CST (2026-11-02T05:13Z)
    • Found via: filed this run
    • Task: Triage the non-uniform unhonourable-argument rejection in bin/codedb-bridge.mjs routeForTool and route the uniform-rejection fix
    • Expectation: effort/s — done when every tool rejects regex/scope/compact by name (or the contract is made uniform another way) and misnamed limit args are no longer silent no-ops, with per-tool tests
    • Links: evidence in the issue body; laptop probe ~/git/fleet/probe-2026-11-01-laneA-codedb/
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 2, 2026
  4. 99 remaining items

  5. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Released by repo-worker-code-f (outcome: free). Triaged CONFIRMED (verdict note on #4197: verbatim current-main bin/codedb-bridge.mjs blob 1336dcc6 probed on the laptop — regex/scope/compact silently dropped on codedb_word/codedb_symbol/codedb_hot, limit/max_results silent no-ops on the wrong tool, tests still cover only search/outline). Fix routed on this same issue: task/small-fix + status/triaged + queue/queued — uniform named-argument rejection + per-tool tests; the general unknown-argument question stays with escalated #4216.

  6. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Picked up by repo-worker-code-b (Lane B queue worker, FALLBACK MODE — queue backend down, code#6619; fleet queue fallback subcommand absent in fleet 0.1.0, protocol run manually; comments via the developing.today GitHub App route while the user token is secondary-rate-limited). Lane code-f triaged CONFIRMED and released free at 2026-11-07T03:58:47Z; this claim takes the routed small-fix.

    🤖 Agent note · picked up

  7. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  8. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Heartbeat — stage: pr_revalidated. PR #4559 resumed in laptop worktree ~/git/fleet/fb-4197: origin/main merged into its branch cleanly (merge commit d2464f1, no conflicts); the resulting tree differs from current main by exactly the PR's intended change (bridge blob 1336dcc6 → 4c18636c). Laptop: node --test bin/codedb-bridge.test.mjs 13/13 pass; direct probe — every filed silent-drop case now throws by name (word+regex, word+scope, symbol+compact, hot+regex, search+limit, hot+max_results), honoured-arg controls (search+max_results, hot+limit) still route. Codex on the original head had no findings. Next: push the merge to the PR branch, check the new head's Codex/checks, then merge.

  9. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/triagedTriaged and routed (see agent note)
    on Nov 7, 2026
  10. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor

    Released — outcome: done. Summary: fixed_merged via PR #4559 (merge commit deab49d, verified by fresh gh api + gh pr view readbacks) — the dormant canonical PR from broker task 6348, resumed this shift: origin/main merged into its branch cleanly (d2464f1; resulting tree differs from main by exactly the PR's change), uniform regex/scope/compact rejection on every codedb-bridge tool plus rejection of misnamed limit/max_results. Laptop verification: node --test bin/codedb-bridge.test.mjs 13/13 pass; direct probe — all filed silent-drop cases now throw by name, honoured-arg controls still route. Codex on the final head: completed, no findings. PR CI checks remained QUEUED (runner backlog) at merge, per standing merge authority. Out-of-scope remainder, unchanged from the routed task definition: arbitrary unknown arguments (e.g. bogus_arg) are still ignored — the bridge header's promise covers the named unhonourable set. Issue #4197 closed by the PR (Closes #4197); queue/work/status labels cleaned by this release.

    🤖 Agent note · done

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)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions