Skip to content

fix(proxies): isolate commandcode, claude-code, and muse workroots - #3486

Merged
dezren39 merged 1 commit into
mainfrom
queue/5432-2785-proxy-workroots
Nov 1, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/5432-2785-proxy-workroots

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

All three systemd units in home/common/default.nix pointed their *_PROXY_WORKDIR at the one shared root ~/.local/state/cli-proxies: commandcode and claude-code derive identical sessions/<sha256(key)[:16]> workdirs for overlapping keys, and muse used the shared root itself as session cwd/workspaceRoot — cross-proxy session-state mutation by construction.

  • Each unit now gets its own subtree: cli-proxies/commandcode, cli-proxies/claude-code, cli-proxies/muse. An overlapping key therefore derives disjoint per-proxy session dirs, and muse's cwd/workspaceRoots are confined to its own subtree.
  • *_PROXY_SESSION_FILE values are untouched: the commandcode/claude session map stays intentionally shared at cli-proxies/sessions.json (provider proxies keep session state in the repo tree (bin/sessions.json) — move to ~/.local/state #3067), anchored to the state root, not to either workroot (the scripts' env-free defaults resolve to the same shared path).
  • Runtime state: pre-existing state under the shared root is left in place — it cannot be attributed between the proxies, which is the bug — and each proxy re-warms fresh state in its own subtree on next start. The nix comment block records this.
  • New regression bin/cli-proxy-workroots.test.mjs parses default.nix and pins: pairwise-distinct workroots under the state root (none equal to the shared root itself), disjoint derived session dirs for an overlapping key, and the shared session-map path unchanged and outside every workroot.

Verification (laptop): nix-instantiate --parse home/common/default.nix OK; node --test bin/cli-proxy-workroots.test.mjs 3/3; existing suites — commandcode-proxy 2/2, claude-code-proxy 5/5, muse-proxy 24/24.

Closes #2785
Queue task 5432.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

All three systemd units pointed their *_PROXY_WORKDIR at the one
shared root ~/.local/state/cli-proxies: commandcode and claude-code
derive identical sessions/<sha256(key)[:16]> workdirs for
overlapping keys, and muse used the shared root itself as session
cwd/workspaceRoot, so the proxies could mutate each others session
state.

Each unit now gets its own subtree (cli-proxies/commandcode,
cli-proxies/claude-code, cli-proxies/muse). The *_PROXY_SESSION_FILE
values are untouched: the commandcode/claude session map stays
intentionally shared at cli-proxies/sessions.json (#3067), anchored
to the state root rather than either workroot. Pre-existing state
under the shared root is left in place (it cannot be attributed
between the proxies); each proxy re-warms fresh state in its own
subtree on next start.

Regression: bin/cli-proxy-workroots.test.mjs parses default.nix and
pins pairwise-distinct workroots, disjoint derived session dirs
for an overlapping key, and the unchanged shared session-map path.

Closes #2785
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 10:16
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86f04ab6-945a-4b8e-b771-a654475e0cf0
Commits

Reviewing files that changed from the base of the PR and between df3b63d and a61c471.

Files selected for processing: 2
  • bin/cli-proxy-workroots.test.mjs
  • home/common/default.nix
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T10:18:58.851856Z a61c471 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

None yet

1 participant