Skip to content

feat: isolate coding agent processes by room - #629

Open
AlexanderZ-Band wants to merge 10 commits into
mainfrom
feat/room-owned-coding-agent-workspaces-INT-1428
Open

AlexanderZ-Band wants to merge 10 commits into
mainfrom
feat/room-owned-coding-agent-workspaces-INT-1428

Conversation

@AlexanderZ-Band

@AlexanderZ-Band AlexanderZ-Band commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • assign each room an absolute workspace via workspace_for_room(room_id), defaulting to an isolated ./.band-workspaces/<room-id> directory when unset
  • lazily create and own one local stdio coding-agent process and protocol state per room
  • pass the resolved room workspace to Codex thread/start, not a shared cwd
  • reject remote, shared, and injected transports that cannot preserve room isolation
  • enforce one live room per resolved workspace, including symlink-equivalent paths
  • make workspace/runtime creation atomic; clean up failed Codex client startup and evict the failed client
  • remove Codex's shared fallback state and update ACP/Codex documentation and examples

Validation

  • uv run pytest tests/adapters/test_room_workspace_isolation.py -q — 4 passed
  • uv run ruff check src/band/adapters/codex.py src/band/integrations/acp/client_adapter.py src/band/workspaces.py tests/adapters/test_room_workspace_isolation.py examples/codex/01_basic_agent.py examples/codex/02_tom_agent.py examples/codex/03_jerry_agent.py examples/run_agent.py examples/docker_demo/agents/dev/main.py
  • uv run pyrefly check src/band/adapters/codex.py src/band/integrations/acp/client_adapter.py src/band/workspaces.py tests/adapters/test_room_workspace_isolation.py
  • python -m compileall for changed examples
  • git diff --check

Draft gate

Legacy ACP/Codex fixture suites (tests/adapters/test_codex_adapter.py, tests/integrations/acp/test_client_adapter.py, tests/integrations/acp/test_client_adapter_behavior.py) construct these adapters against the removed shared-process/injected-client APIs (cwd=, client_factory=, spawn_process=) and fail without a workspace-lifecycle migration: 143 failed / 58 passed in the Codex suite, 207 failed / 88 passed / 14 errors in the ACP suite. This PR stays draft until those fixtures move to room-owned stdio lifecycle equivalents.

@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

INT-1428

Comment thread docs/adapters/codex.md Outdated
Comment thread examples/acp/clients/bridge_architecture.py Outdated
Comment thread src/band/adapters/codex.py Outdated
Comment thread src/band/adapters/codex.py
Comment thread src/band/integrations/acp/client_adapter.py Outdated
Comment thread src/band/integrations/acp/client_adapter.py
Comment thread src/band/integrations/acp/client_adapter.py
Comment thread src/band/integrations/acp/client_adapter.py Outdated
Comment thread src/band/integrations/acp/client_adapter.py Outdated

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review pass: fixed room-workspace ownership, removal of shared Codex fallback state, failed Codex startup cleanup, stale transport documentation, and focused regression coverage. The legacy ACP/Codex fixture suite still targets the intentionally removed shared-process and injected-client APIs; it remains the reason this PR stays draft.

@AlexanderZ-Band
AlexanderZ-Band requested a review from a team September 13, 2026 05:01
@AlexanderZ-Band
AlexanderZ-Band marked this pull request as ready for review September 13, 2026 05:16
AlexanderZ-Band and others added 3 commits September 13, 2026 09:11
Extract shared workspace collision guard, DRY ACP profile resolution, and
test helpers that patch per-room stdio spawns so legacy fixtures work
without the removed shared-process APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Compare Codex thread cwd against resolved workspace paths and drop
hardcoded Band URLs from the codex adapter quick-start snippet.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant