Repository navigation
Description
Summary
PR #2782 (merged today, commit edab2d29) points all three CLI proxy home-manager units at one shared workroot, %h/.local/state/cli-proxies (home/common/default.nix:757,786,823). The three proxies' on-disk layouts were designed for private workroots, and two of them collide exactly: commandcode-proxy and claude-code-proxy derive per-conversation workdirs with the same function over the same key space — WORKROOT/sessions/<sha256(key)[:16]> — so the same conversation key now maps to the same directory in both proxies. muse-proxy compounds it: it runs its sessions with the workroot itself as cwd/workspace root, which is now the parent directory of the other two proxies' session trees.
Evidence (verified this run on main 35c4c9c6)
- One env value for three units:
home/common/default.nixsetsCOMMANDCODE_PROXY_WORKDIR(:757),CLAUDE_CODE_PROXY_WORKDIR(:786), andMUSE_PROXY_WORKDIR(:823) all to%h/.local/state/cli-proxies. Before feat(proxies): CLI proxy workroots -> ~/.local/state/cli-proxies #2782 each proxy defaulted to its ownbin/workunder its own proxy dir. - Identical workdir derivation:
bin/commandcode-proxy.mjs:516-520:sessionWorkdirFor(key)=path.join(WORKROOT, 'sessions', sha256(key).slice(0,16)).bin/claude-code-proxy.mjs:230-234: the same body, verbatim.
- Identical key space, by design:
bin/claude-code-proxy.mjs:194-198says itsgetSessionKey"mirrors commandcode-proxy's getSessionKey" — same sources in the same order: explicitx-session-id/session_id/… headers and body fields, thenuser:<user>, thenturn0:<sha256(first user message)[:16]>(commandcode's at :472, claude-code's at :198-224). Keys are client/conversation attributes, not proxy attributes: an OpenCode session that switches provider, or two requests whose first user message is identical, produce the same key in both proxies. - Laptop probe (
~/git/fleet/probe-2026-10-30-laneB-sharedworkroot/, functions extracted verbatim from the real files —commandcode-proxy.mjsmd5b3bce253…,claude-code-proxy.mjsmd57280c4bb…, both byte-identical to this main — withWORKROOTset to one shared dir): for an explicit session id, foruser:drew, and for aturn0:key, both functions returned the identical path (<shared>/sessions/<same hash>) in all three cases, and both created the same directories. - The muse side:
bin/muse-proxy.mjs:50-51takesWORKDIRas its root, runs sessions withcwd: WORKDIR(:455, :1673) andworkspaceRoots: [WORKDIR](:572), persistswarm-sessions.jsonat its root (:319-320) and writesprompt-<uuid>.txtfiles there (:1651). With the shared root, a muse session's workspace is the directory containing commandcode's and claude-code'ssessions/trees and commandcode's resident-ACP project dir (bin/commandcode-proxy.mjs:553:WORKROOT/acp-project).
Why it matters
The per-conversation workdir exists so an agency agent's file work is confined to its own conversation (both proxies steer the CLI: do ALL file work inside this dir). Sharing the derivation and the root breaks that confinement across providers:
- A conversation continued on the other provider (same session id — the normal provider-switch path) lands in the previous provider's workdir: it inherits the other agent's half-finished files as its own starting state, and its writes mutate the first conversation's dir.
- Two unrelated conversations with the same first user message (the
turn0:fallback — e.g. the same task prompt sent to two providers to compare) silently share one workdir even within the intended one-conversation-per-dir model. - A muse session runs at the shared root, so its file tools can read, modify, or delete the other proxies' live per-conversation directories and
acp-projectstate — state the other proxies treat as private.
Each proxy's own state files are safe (commandcode/claude-code keep sessions.json in their proxy dirs, not the workroot); this is specifically the workdir tree that #2782 merged.
Acceptance criteria
- The three units no longer share one flat workroot: each proxy gets its own subtree (e.g.
%h/.local/state/cli-proxies/{commandcode,claude-code,muse}inhome/common/default.nix, or a per-proxy subdirectory derived inside each proxy), sosessionWorkdirForoutputs can never coincide across proxies. - muse-proxy's session cwd/workspace root is its own subtree, not the parent of the other proxies'
sessions//acp-projecttrees. - A regression test (following the
bin/*.test.mjspattern) pins that the three proxies' workdir derivations, given the same key and the deployed env values, produce disjoint directories — or, if the fix is env-only, a check/test on the rendered unit env values asserting three distinct workroots. - Existing per-proxy behaviour is unchanged apart from the root path: same key derivation, same
sessions/<hash>layout inside each proxy's own root, warm-session files still found after the move (migration of existing state at the shared root is considered, per feat(proxies): CLI proxy workroots -> ~/.local/state/cli-proxies #2782's "runtime state preserved/moved at deploy time" note).
Dedup
Searched open + closed issues for cli-proxies / shared workdir / WORKDIR collision terms this run: no filing. PR #2782 is the change that introduced the sharing (its stated goal — moving runtime state out of the primary checkout — is not in dispute; the collision is in the choice of one identical value for all three). Adjacent: #2780/#2770 are muse-proxy translator bugs in the same file family, different mechanism; #2753 is the muse-direct feature.
Activity
dezren39 commentedon Oct 30, 2026
🤖 Agent note · filed
7 remaining items
dezren39 commentedon Nov 1, 2026
🤖 Agent note · done
dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 1, 2026
🤖 Agent note · done