You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 feat: add in-place workspace support for CLI/benchmark sessions (#472)
Enables cmux to work directly in provided directories without requiring
git worktrees. This is essential for terminal-bench integration and
agentSessionCli usage.
## Problem
Terminal-bench harness (and agentSessionCli) need to work in arbitrary
directories like `/app` in benchmark containers. Previously, cmux
assumed all workspaces were git worktrees under
`~/.cmux/src/<project>/<branch>`, causing systematic failures:
```
RuntimeError: Working directory does not exist: /root/.cmux/src/app
```
## Solution
Detect "in-place" workspaces (directories not under srcBaseDir) and
store them directly without worktree reconstruction. Uses a simple
sentinel: `projectPath === name` indicates in-place mode.
**agentSession.ts**: When `workspacePath` is outside `~/.cmux/src/`,
store it directly by setting both `projectPath` and `name` to the
absolute path.
**aiService.ts**: Check for in-place mode (`projectPath === name`) and
use the path directly instead of calling `runtime.getWorkspacePath()`.
**streamManager.ts**: Fixed cleanup safety—run `rm -rf` from parent
directory instead of `/` to limit blast radius if path is malformed.
## Testing
Ran terminal-bench harness with multiple tasks:
- ✅ Agent executes successfully in `/app` directory
- ✅ No "Working directory does not exist" errors
- ✅ Passed 2/3 tests in sanitize-git-repo task
- ✅ Cleanup works correctly with safer approach
---
_Generated with `cmux`_
0 commit comments