#3967: fix(sandbox): correct workspace prompt path
agents
Cluster:
Sandbox File System Fixes
When running in a sandbox, agents receive prompt information about their workspace location. Previously, `buildEmbeddedSandboxInfo` returned the host machine's path (for example, `/tmp/moltbot-sandbox`), but tools execute inside a Docker container where the workspace is mounted at `/workspace`.
This PR fixes the mismatch by using the container's internal path.
Before:
```js
workspaceDir: sandbox.workspaceDir
// → "/tmp/moltbot-sandbox"
```
After:
```js
workspaceDir: sandbox.containerWorkdir
// → "/workspace"
```
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `buildEmbeddedSandboxInfo` to report the sandbox workspace path as seen from inside the container (`sandbox.containerWorkdir`, e.g. `/workspace`) instead of the host filesystem path (`sandbox.workspaceDir`, e.g. `/tmp/...`). The associated unit tests were updated accordingly, ensuring agents receive workspace prompt information that matches where tools actually execute (inside Docker).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is narrowly scoped (one field mapping) and aligns the prompt workspace path with the container execution environment; tests were updated to match. No behavioral changes beyond the reported path were introduced.
- No files require special attention
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#4226: Fix/sandbox containerworkdir rw access
by ozgur-polat · 2026-01-29
88.3%
#16922: fix: remove incorrect sandbox file tool guidance
by carrotRakko · 2026-02-15
84.7%
#4467: fix: DEFAULT_SANDBOX_WORKSPACE_ROOT respects STATE_DIR
by Aphroq · 2026-01-30
80.7%
#11820: fix(sandbox): remap container paths in sandboxed file tools
by steflsd · 2026-02-08
80.3%
#17402: fix:sandbox path issue
by luckylhb90 · 2026-02-15
80.3%
#20991: fix(sandbox): fall back to gateway UID:GID when no user is configur...
by cluster2600 · 2026-02-19
78.6%
#14810: fix:sandbox file path Inconsistency
by luckylhb90 · 2026-02-12
78.2%
#10185: fix: pass effective workspace as cwd to Pi SDK createAgentSession
by Yida-Dev · 2026-02-06
77.0%
#4022: fix: apply sandbox tools denials in /tools/invoke
by davidbors-snyk · 2026-01-29
76.7%
#16509: Fix sandbox path validation rejecting Docker bind mount paths
by Clawborn · 2026-02-14
76.7%