Repository navigation
Description
Problem
codedb (the MCP code-index/search server in the fleet's mcpx config, .mcpx.json → command: /home/user/bin/codedb) runs as one process per client session. Observed 2026-10-29: ~7 simultaneous codedb mcp children on the laptop, parented by the OpenClaw gateway supervisor and MCP-client node processes. There is no codedb systemd unit in either manager — process count scales with session count, and each instance presumably maintains its own index state.
Tonight its mcpx entry was parked (PR #2220: moved out of mcpServers into a top-level disabledMcpServers key, definition retained verbatim) pending this determination. Existing per-session children retire with their sessions; the park only stops new spawns once the PR lands and the primary checkout is pulled.
Determination to make
Evaluate, with evidence:
- (a) One shared codedb service — a single long-lived codedb instance (daemon/service shape) that all MCP clients connect to, instead of per-session children. What does codedb support today (transport, shared state, concurrency), and what config changes does each client need?
- (b) Replace codedb with the fleet's built-in embedding machinery — OpenCode core already ships a local embedding stack (llama.cpp + Qwen3-Embedding tiers,
packages/core/src/messaging/embedding.tsin developing-today/opencode), but today it indexes messages and session transcripts for messaging search, not source code. Atlas (hatch-personalworkspace/turso-atlas/) indexes conversations + repo docs, not source code either. Is extending one of these to code search realistic, and what would it cost vs (a)? - (c) Another existing fleet component — e.g. mcpx's own catalog embeddings are tool-catalog-scoped (semantic tool search), not code-scoped; state plainly if nothing existing fits.
Acceptance
- A written determination in this issue (or a linked doc) naming the recommended path and the evidence for/against each candidate.
- The per-client / per-config changes the recommended path implies (mcpx config, OpenClaw, OpenCode, any service units).
- The PR config: park qwen models (cline-pass/commandcode) + park codedb in mcpx — stacked on #2198 #2220 park is then either lifted (codedb returns in its new shape) or made permanent with the replacement in place.
Related
- Make Qwen configurable on mcpx/OpenCode #2218 — Make Qwen configurable on mcpx/OpenCode (tonight's local-model disable pass; the local-model feature audit behind this issue is summarized there).
- PR config: park qwen models (cline-pass/commandcode) + park codedb in mcpx — stacked on #2198 #2220 — the codedb park itself.
- Atlas code indexing (hatch-personal) — the corpus-side question if path (b) wins.
Acceptance criteria
- A determination is recorded on this issue with evidence for each option: (a) one shared codedb service, (b) a replacement for codedb, or (c) per-session instances by design — including measured per-instance cost (memory/index state) from the observed ~7-instance state.
- The chosen option is either implemented (PR linked, mcpx config updated from the parked state in PR config: park qwen models (cline-pass/commandcode) + park codedb in mcpx — stacked on #2198 #2220) or filed as a linked follow-up issue with the determination as its spec.
- The interim park state is explicitly resolved: codedb either returns to
mcpServersunder the chosen model or stays parked with the reason recorded here.
Activity
developing-today commentedon Oct 29, 2026
CODE-1099
dezren39 commentedon Oct 29, 2026
Intake review
meta/enrichedadded. A triage task (queue task 3384) was enqueued by this same monitor run under Duty 1 — the issue carriedqueue/queuedwith no live task behind it.dezren39 commentedon Nov 1, 2026
Triage verdict — task 3384 (lane C, 2026-11-01): still LIVE; routing the determination investigation.
Fresh state checks:
.mcpx.jsonhascodedbunderdisabledMcpServersand absent frommcpServers. The interim state this issue exists to resolve is therefore active, not hypothetical.codebase-memorynow appears in.mcpx.jsonmcpServerson main. Whether it already provides shared code search is a factual question for the investigation, not assumed here.Routing: the determination itself is the next unit of work — it needs evidence this triage does not gather (codedb's transport/concurrency support, measured per-instance memory/index cost from the observed ~7-instance state, the OpenCode embedding stack's realistic extension cost, and the
codebase-memorycandidate). A follow-up queue task has been enqueued to produce the written determination on this issue — options (a)/(b)/(c) with evidence, the per-client config changes the recommended path implies, and the explicit park resolution (lift or make permanent) — and to route the resulting implementation as its own packet/issue. This triage does not pre-judge the outcome.22 remaining items
dezren39 commentedon Nov 1, 2026
agent-note:v1 — triaged (task 5908, OpenChamber scheduled lane)
disabledMcpServers.queue/queuedto match task id(chat-presence): PresenceHeartbeat::verify uses plain verify — the #1386 small-order identity forgery passes the presence authentication gate #5226. No runtime/config changes made.dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done — determination for #2225 (task 5226, queue worker lane C)
Determination: one shared codedb daemon per project root + a thin MCP bridge — park lifts in the new shape
Measured per-instance cost (laptop, 2026-11-02, this run)
codedbis a 6.9 MB static binary (~/bin/codedb, Apr 2026 build). Zero codedb processes are running right now — the PR config: park qwen models (cline-pass/commandcode) + park codedb in mcpx — stacked on #2198 #2220 park is effective — and there is no codedb systemd unit in either the system or user manager.~/.codedb/projects/<hash>/totals 253 MB across 9 projects (largest 148 MB). Disk does not multiply with sessions.codedb search IdentityStoreagainst~/git/code(the largest indexed project), peak RSS viaru_maxrss:Option (a) — shared codedb service: SUPPORTED BY THE BINARY, with one gap
codedb --helplists, alongsidemcp(JSON-RPC/MCP over stdio), aservecommand: "HTTP daemon on :7719". Binary string evidence shows the daemon's routes mirror the query surface:/tree,/outline,/search,/searchq,/word,/hot,/health. One daemon holds the index in memory and any number of HTTP clients share it — concurrency is the daemon's normal shape./mcpendpoint;mcpis stdio-only). MCP clients (mcpx, OpenCode, OpenClaw) cannot point at:7719directly. Sharing therefore needs a thin stdio MCP→HTTP bridge: a small stateless shim per session that exposes codedb's MCP tools and forwards to the local daemon. The shim is per-session but negligible (no index, no state) — the expensive part stops multiplying.codedb [root] serve). The fleet's working set is bounded: one daemon per primary clone (code, opencode, openchamber, nix — ≤4 daemons, ~1.1 GB for code, less for the smaller repos), versus an unbounded per-session count today.Option (b) — replace with the fleet's embedding machinery: NOT RECOMMENDED
packages/core/src/messaging/embedding.tsin developing-today/opencode, ~43 KB, llama.cpp + Qwen3-Embedding) but it indexes messages and session transcripts; Atlas indexes conversations + repo docs. Neither indexes source code.find,outline, trigramsearch, inverted-indexword— which an embeddings-only replacement does not reproduce; semantic search would be a capability downgrade dressed as a swap.Option (c) — another existing component: NONE SOLVES THE ACTUAL PROBLEM
.mcpx.jsonmcpServers(npx -y codebase-memory-mcp) — but it spawns per session via npx, exactly the multiplication shape this issue exists to kill, and its parity with codedb's symbol/trigram surface is unevaluated. It may be a fine complement; it is not an answer to instance multiplication.fffservers in the config are file-finding, not symbol/code indexing.Recommended path and the changes it implies
codedb serveper primary project root (start with~/git/code; add roots as needed). Unit lives with the fleet's other user services; config change lands via the normal repo/PR route for units.http://127.0.0.1:7719for the session's project root. First verification step of the follow-up: confirmserve's exact request/response shapes against the MCP tool surface (names/args), and confirm daemon behaviour when the index is stale (auto-reindex observed in CLI runs).disabledMcpServersback tomcpServerswithcommand= the bridge (envCODEDB_NO_TELEMETRY=1retained). OpenClaw / OpenCode clients need no codedb-specific change beyond consuming mcpx config as they already do — the bridge is the mcpx entry.Interim park resolution
The PR #2220 park is temporary, not permanent: it stays in force until the follow-up lands (codedb is safer parked than multiplying), and it is lifted in the new shape — daemon + bridge — by that follow-up's config PR. It does not become permanent, because the determination found a supported shared shape; codedb is not being replaced.
Routed follow-up
Implementation is filed as a linked issue on this repo with this determination as its spec, and enqueued as a queue packet; both are named in the completion note below / the follow-up comment on this issue. #2225 itself stays open until the follow-up lands and the park is actually lifted.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · handed off
Merge pull request #4171 from developing-today/queue/6027-4120-codedb…
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done — determination implemented and merged
bin/codedb-bridge.mjsin main,.mcpx.jsoncarries codedb inmcpServersvia the bridge withCODEDB_NO_TELEMETRY=1retained, and the user systemd unitcodedb-code.servicerunscodedb servefor ~/git/code on the laptop (active, /health ok).