Skip to content

codedb shared daemon + MCP bridge: one codedb serve per project root, lift the #2220 park in the new shape (#2225) #4120

Closed

Description

@dezren39

Implements the determination recorded on #2225 (task 5226, 2026-11-02): codedb stops running one stdio process per MCP session (~1.1 GB RSS warm / ~2.1 GB cold-peak per instance on the largest project, measured) and becomes one shared daemon per project root plus a thin MCP bridge.

Spec (from the #2225 determination)

  1. Verify the daemon surface first: codedb serve is an HTTP daemon on :7719 with routes mirroring the query surface (/tree, /outline, /search, /searchq, /word, /hot, /health) and no MCP route. Confirm exact request/response shapes against codedb's MCP tool surface, and daemon behaviour on a stale index.
  2. Daemon unit: user systemd unit running codedb serve for the ~/git/code root first (add further primary roots only as needed; the daemon is per-root).
  3. Bridge: a small stateless stdio MCP shim, fleet-owned in this repo, exposing codedb's MCP tools and forwarding to http://127.0.0.1:7719 for the session's project root. No index state in the shim.
  4. Config PR: in .mcpx.json, move codedb from disabledMcpServers back to mcpServers with command = the bridge, retaining CODEDB_NO_TELEMETRY=1. This lifts the PR config: park qwen models (cline-pass/commandcode) + park codedb in mcpx — stacked on #2198 #2220 park in the new shape and closes Determine how to not need multiple codedb instances — or replace codedb effectively #2225.

Acceptance

  • One codedb serve daemon serves multiple concurrent MCP sessions through the bridge; no per-session codedb process holds an index (verify with ps + RSS during ≥3 concurrent sessions).
  • codedb MCP tools (search/find/outline/tree/word/hot) return the same results via the bridge as via direct stdio for a fixed query set on ~/git/code.
  • .mcpx.json on main has codedb in mcpServers (bridge) and out of disabledMcpServers; Determine how to not need multiple codedb instances — or replace codedb effectively #2225 closed by the config PR.

Refs: #2225 determination comment, PR #2220 (the park).

Acceptance criteria

  • The daemon surface is verified first: codedb serve routes and request/response shapes are confirmed against codedb's MCP tool surface, including behaviour on a stale index.
  • One shared codedb serve daemon runs per project root (user systemd unit), replacing one stdio process per MCP session.
  • A thin MCP bridge connects sessions to the shared daemon; existing MCP tool behaviour is unchanged for callers.
  • The config: park qwen models (cline-pass/commandcode) + park codedb in mcpx — stacked on #2198 #2220 park condition that this work lifts is recorded as resolved on the issue, with the measured per-instance RSS cost gone (one daemon per root instead of ~1.1 GB warm per session instance).

Activity

  1. added
    kind/featureNew feature or capability request
    effort/mMedium: expected under 1 day of work
    queue/queuedHas a queued task in the Supabase agent queue
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

    Fresh check (2026-11-02T02:24:57Z): issue #4120 is OPEN with no hard-stop labels, but the laptop — where every step of this task executes (codedb serve verification, user systemd unit, bridge testing against ~/git/code, RSS/concurrency measurements) — is at loadavg 78.76 / 103.39 / 94.70 with 14 rustc and 6 cargo processes running. Adding a daemon + index workload now would pile onto the saturation that drops Drew's connection, and the acceptance measurements (single index-holding process, RSS) would be meaningless under this contention. No daemon, unit, branch, or code changes were made.

  3. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    priority/normalOrdinary priority (the default)
    source/queue-workerFiled or worked by the queue/worker pilot
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  4. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Intake review

    — Fleet monitor intake, 2026-11-01 20:12 CST run.

  5. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked
    task: 6027
    worker: repo-worker-code (lane A)
    state: Revalidated fresh 2026-11-02T03:40Z: #4120 OPEN, no hard-stop labels, no existing PR or branch for this work. Scope is a fresh multi-part build (codedb serve systemd unit on the laptop + stdio MCP->HTTP bridge + .mcpx.json PR) at effort/m — exceeds the remainder of this shift, so parked for a fresh shift to claim with a full timebox rather than started and left half-built. Resume: start from the #2225 determination spec on this issue; code root first.

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  8. added a commit that references this issue on Nov 2, 2026
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — merged

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions