Skip to content

fix(cli): show effective workspace root in sandbox explain when rw#100435

Closed
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix-sandbox-explain-workspace-root
Closed

fix(cli): show effective workspace root in sandbox explain when rw#100435
aniruddhaadak80 wants to merge 1 commit into
openclaw:mainfrom
aniruddhaadak80:fix-sandbox-explain-workspace-root

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

Fixes #100423. Shows the effective workspace root when sandbox workspaceAccess is rw in openclaw sandbox explain output.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations docker Docker and sandbox tooling size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 3:18 PM ET / 19:18 UTC.

Summary
The PR adds an effectiveWorkspaceRoot value to openclaw sandbox explain JSON and text output, using the agent workspace when workspaceAccess is rw.

PR surface: Source +8. Total +8 across 1 file.

Reproducibility: yes. Current main and the latest release print only the configured workspaceRoot, while runtime layout uses the agent workspace for workspaceAccess: rw; I did not run a live Docker container in this read-only review.

Review metrics: 1 noteworthy metric.

  • Diagnostic output fields: 1 JSON/text field added. The added field describes sandbox filesystem placement, so reviewers need it accurate for every mode where it appears.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #100423
Summary: This PR is a candidate fix for the open canonical sandbox explain effective-workspace mismatch; older mount-output work is related but not a viable canonical landing path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix the effective-root calculation or make the field conditional/clearly rw-specific.
  • [P1] Add focused coverage for rw and at least one non-rw scoped sandbox output case.
  • Post redacted before/after openclaw sandbox explain output from a real setup.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body has no real before/after CLI output, screenshot, recording, terminal transcript, or logs showing the changed sandbox explain behavior; contributor proof is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The new effectiveWorkspaceRoot field would still be inaccurate for non-rw scoped sandboxes because it falls back to the configured parent root rather than the scoped sandbox workspace.
  • [P1] The contributor has not shown the changed CLI behavior in a real setup, so reviewers cannot compare before/after output against the linked Docker sandbox report yet.

Maintainer options:

  1. Repair diagnostic semantics (recommended)
    Compute the field from the same scoped workspace layout used by runtime, or render a clearly rw-specific field only when that is the only supported claim.
  2. Accept a narrower rw-only change
    Maintainers could accept a smaller rw-only diagnostic, but the output should be renamed or conditional so non-rw modes are not labeled effective.

Next step before merge

  • [P1] This PR needs contributor follow-up for a concrete diagnostic accuracy bug and real behavior proof; it is not a safe ClawSweeper repair lane while proof is missing.

Security
Needs attention: The diff does not add code execution or supply-chain risk, but the new sandbox filesystem diagnostic is security-sensitive and currently inaccurate for non-rw scoped sandboxes.

Review findings

  • [P2] Compute effective roots for every displayed mode — src/commands/sandbox-explain.ts:199-202
Review details

Best possible solution:

Compute or display an effective workspace path only where it is accurate for the selected mode/scope/backend, cover the output with focused command tests, and add redacted before/after CLI proof.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main and the latest release print only the configured workspaceRoot, while runtime layout uses the agent workspace for workspaceAccess: rw; I did not run a live Docker container in this read-only review.

Is this the best way to solve the issue?

No. The PR is a plausible narrow fix for rw, but it is not the best merge shape until the new effective field is accurate or conditional for every mode where it is displayed.

Full review comments:

  • [P2] Compute effective roots for every displayed mode — src/commands/sandbox-explain.ts:199-202
    The new field is printed for all modes, but when workspaceAccess is not rw it falls back to sandboxCfg.workspaceRoot. Runtime does not use that parent as the effective workspace for normal scoped sandboxes; it resolves a scope key and then a per-session or per-agent sandbox directory. As written, the new effectiveWorkspaceRoot can still point users at the wrong filesystem location outside the rw case this PR fixes.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 685c22dfb7e1.

Label changes

Label changes:

  • add P2: This is a focused CLI diagnostics bugfix for a sandbox boundary explanation with limited blast radius but real user confusion.
  • add merge-risk: 🚨 other: Merging the PR as-is could add a new inaccurate sandbox filesystem diagnostic even though the runtime boundary itself is unchanged.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body has no real before/after CLI output, screenshot, recording, terminal transcript, or logs showing the changed sandbox explain behavior; contributor proof is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a focused CLI diagnostics bugfix for a sandbox boundary explanation with limited blast radius but real user confusion.
  • merge-risk: 🚨 other: Merging the PR as-is could add a new inaccurate sandbox filesystem diagnostic even though the runtime boundary itself is unchanged.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body has no real before/after CLI output, screenshot, recording, terminal transcript, or logs showing the changed sandbox explain behavior; contributor proof is needed before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +8. Total +8 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 10 2 +8
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 10 2 +8

Security concerns:

  • [low] Inaccurate sandbox boundary diagnostic — src/commands/sandbox-explain.ts:199
    The new effectiveWorkspaceRoot field can report the configured parent sandbox root instead of the actual scoped sandbox workspace, which can mislead users reasoning about sandbox filesystem exposure.
    Confidence: 0.82

What I checked:

  • Repository policy read: Root AGENTS.md was read fully, and the scoped agents guide was read because the touched command imports agent/sandbox helpers; the review applied the policy requiring whole-path PR review and sandbox/security-boundary caution. (AGENTS.md:1, 685c22dfb7e1)
  • Current main still has the reported mismatch: Current main builds payload.sandbox.workspaceRoot directly from sandboxCfg.workspaceRoot and prints that same field; there is no effective workspace field on main. (src/commands/sandbox-explain.ts:263, 685c22dfb7e1)
  • Runtime effective workspace differs by mode and scope: Runtime layout resolves workspaceDir to the agent workspace only for workspaceAccess === "rw"; otherwise it uses a scoped sandbox workspace under the resolved sandbox root. (src/agents/sandbox/context.ts:90, 685c22dfb7e1)
  • Scoped sandbox directory helper: Non-shared sandbox roots are resolved through resolveSandboxScopeKey and resolveSandboxWorkspaceDir, so the configured parent workspaceRoot is not the effective scoped workspace directory for normal session or agent scope. (src/agents/sandbox/shared.ts:25, 685c22dfb7e1)
  • PR diff adds an always-visible effective field: The branch adds effectiveWorkspaceRoot and falls back to sandboxCfg.workspaceRoot whenever workspaceAccess is not rw, then prints that field in the human output. (src/commands/sandbox-explain.ts:199, cb9d59a4819b)
  • Real behavior proof is absent: The PR body contains no before/after CLI output, screenshot, recording, or logs, and the live PR has failing Real behavior proof checks on the current head. (cb9d59a4819b)

Likely related people:

  • steipete: Introduced sandbox explain in 9f9098406ccc95d3f67af0a758d6b5bec2448948, refactored sandbox workspace layout in 182afe9f594d22207aa452599ee41175747c1997, and current blame for the touched command resolves to a recent Peter-authored rewrite. (role: feature introducer and recent area contributor; confidence: high; commits: 9f9098406ccc, 182afe9f594d, 7613f6ebb3cb; files: src/commands/sandbox-explain.ts, src/agents/sandbox/context.ts)
  • vignesh07: Added the shared bind-aware filesystem mount resolver that models effective workspace/agent/bind mounts and is the likely reusable seam for richer sandbox explain output. (role: adjacent owner; confidence: medium; commits: eafda6f52671; files: src/agents/sandbox/fs-paths.ts, src/agents/sandbox/workspace-mounts.ts)
  • flashosophy: A recent merged PR rewrote the current tree shape for the touched command and sandbox helpers, but the sandbox explain behavior predates that unrelated TUI change. (role: recent file mover; confidence: low; commits: 3f1dea78753b; files: src/commands/sandbox-explain.ts, src/agents/sandbox/context.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 5, 2026
@steipete steipete self-assigned this Jul 5, 2026
steipete added a commit that referenced this pull request Jul 5, 2026
Sources: #100435, #100439

Co-authored-by: Aniruddha Adak <[email protected]>

Co-authored-by: ZengWen-DT <[email protected]>
steipete added a commit that referenced this pull request Jul 5, 2026
* fix(agents): harden LSP process failures

Source: #100450

Co-authored-by: morluto <[email protected]>

* fix(sandbox): report effective workspace layout

Sources: #100435, #100439

Co-authored-by: Aniruddha Adak <[email protected]>

Co-authored-by: ZengWen-DT <[email protected]>

* fix(security): fail install checks on stream errors

Source: #100413

Co-authored-by: 陈宪彪0668000387 <[email protected]>

* fix(android): normalize all-day calendar events

Source: #100032

Co-authored-by: NianJiuZst <[email protected]>

* fix(ios): serialize push-to-talk lifecycle

Source: #99942

Co-authored-by: NianJiuZst <[email protected]>

* fix(talk): reject inherited provider names

Source: #99849

Co-authored-by: zenglingbiao <[email protected]>

* fix(android): stop voice capture in background

Source: #99840

Co-authored-by: xialonglee <[email protected]>

* fix(cron): preserve fallback result classification

Source: #99913

Co-authored-by: jincheng-xydt <[email protected]>

* fix(google): bound Vertex response decompression

Source: #99812

Co-authored-by: 黄剑雄0668001315 <[email protected]>

* fix(plugins): report malformed discovery JSON

Source: #99892

Co-authored-by: 陈宪彪0668000387 <[email protected]>

* test(sandbox): configure non-default workspace fixture

* test: fix small-fix batch validation

---------

Co-authored-by: morluto <[email protected]>
Co-authored-by: ZengWen-DT <[email protected]>
Co-authored-by: 陈宪彪0668000387 <[email protected]>
Co-authored-by: NianJiuZst <[email protected]>
Co-authored-by: zenglingbiao <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: jincheng-xydt <[email protected]>
Co-authored-by: 黄剑雄0668001315 <[email protected]>
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Superseded by #100483, landed as aaf5ab9.

The landed implementation keeps workspaceRoot backward-compatible, adds the effective host workspace, runtime workdir, and active Docker mount table, uses canonical direct/global/session-agent resolution, and covers derived and persisted spawned-session workspaces. Exact-head proof passed 195 focused tests, changed-surface type/lint/guards, and hosted CI. Contributor credit from this PR is preserved in the landed commit.

Thank you @aniruddhaadak80 for the focused starting point.

@steipete steipete closed this Jul 5, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Thanks @aniruddhaadak80 — your sandbox workspace diagnosis was incorporated into the canonical fix in #100483, landed as aaf5ab9. The landed version reuses the runtime workspace resolver and covers configured, derived, global, direct, sandboxed, and persisted spawned-session paths. Contributor credit is preserved. Closing this superseded PR.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(agents): harden LSP process failures

Source: openclaw#100450

Co-authored-by: morluto <[email protected]>

* fix(sandbox): report effective workspace layout

Sources: openclaw#100435, openclaw#100439

Co-authored-by: Aniruddha Adak <[email protected]>

Co-authored-by: ZengWen-DT <[email protected]>

* fix(security): fail install checks on stream errors

Source: openclaw#100413

Co-authored-by: 陈宪彪0668000387 <[email protected]>

* fix(android): normalize all-day calendar events

Source: openclaw#100032

Co-authored-by: NianJiuZst <[email protected]>

* fix(ios): serialize push-to-talk lifecycle

Source: openclaw#99942

Co-authored-by: NianJiuZst <[email protected]>

* fix(talk): reject inherited provider names

Source: openclaw#99849

Co-authored-by: zenglingbiao <[email protected]>

* fix(android): stop voice capture in background

Source: openclaw#99840

Co-authored-by: xialonglee <[email protected]>

* fix(cron): preserve fallback result classification

Source: openclaw#99913

Co-authored-by: jincheng-xydt <[email protected]>

* fix(google): bound Vertex response decompression

Source: openclaw#99812

Co-authored-by: 黄剑雄0668001315 <[email protected]>

* fix(plugins): report malformed discovery JSON

Source: openclaw#99892

Co-authored-by: 陈宪彪0668000387 <[email protected]>

* test(sandbox): configure non-default workspace fixture

* test: fix small-fix batch validation

---------

Co-authored-by: morluto <[email protected]>
Co-authored-by: ZengWen-DT <[email protected]>
Co-authored-by: 陈宪彪0668000387 <[email protected]>
Co-authored-by: NianJiuZst <[email protected]>
Co-authored-by: zenglingbiao <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: jincheng-xydt <[email protected]>
Co-authored-by: 黄剑雄0668001315 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docker Docker and sandbox tooling merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sandbox explain reports same workspaceRoot regardless of effective workspaceAccess mode (misleading in rw mode)

2 participants