Repository navigation
fix(agents): keep sandbox documentation references reachable - #174856
Conversation
Resolve docs and source paths through the admitted sandbox filesystem bridge so prompts only advertise mounted container paths. Fall back to public URLs for host-only references and acknowledge when neither local docs nor web retrieval is available. Use the same owner for normal turns and prepared compaction without expanding sandbox mounts. Fixes #173657. Thanks to @seriouslysean for reporting the failed reads and @LiuwqGit for the earlier repair and read-only workspace coverage. Co-authored-by: LiuwqGit <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58dabaef25
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesThis PR projects documentation references through existing sandbox mounts and acknowledges when documentation retrieval is unavailable. Example: A workspace configured as /srv/project points to /mnt/repos/openclaw and is mapped to /remote/workspace.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Both previous remote-reference findings are resolved, and no new actionable defect was found; current main still needs this repair. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherReference discovery takes host package/workspace candidates and the admitted sandbox bridge, then supplies usable paths to normal-turn and compaction prompt assembly. flowchart LR
A[Workspace and package roots] --> B[Reference resolver]
C[Admitted sandbox bridge] --> B
B --> D[Normal turn preparation]
B --> E[Compaction preparation]
D --> F[Documentation prompt section]
E --> F
Technical reviewBest possible solution: Land the shared bridge-based reference repair after the existing exact-head landing gates pass. Do we have a high-confidence way to reproduce the issue? Current-main discovery and prompt callers establish the reported host-path failure; the PR records live reproduction, but this review did not execute target code. Is this the best way to solve the issue? The repair belongs in shared reference discovery, reuses existing bridge mappings, covers attempts and compaction, and preserves mount ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against aa74908822e7. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +42, Tests +101, Docs +2. Total +145 across 8 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)Reviewed October 16, 2026, 10:05 PM ET / October 17, 2026, 02:05 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71a3bf45c3
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review Both remote-reference findings are addressed at 8e66859. The production remote bridge retains readable docs/source paths, including configured symlink aliases. The new alias regression fails before the fix; all 72 reference/prompt tests pass after it. Core/test types, scoped lint, snapshot generation, and applicable ratchets are complete; the independent review is clean at P2 and above. The PR body records the unchanged live proof, zero snapshot/token delta, and prior-head inherited CI failure. |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…w#174856) * fix(agents): keep sandbox documentation references reachable Resolve docs and source paths through the admitted sandbox filesystem bridge so prompts only advertise mounted container paths. Fall back to public URLs for host-only references and acknowledge when neither local docs nor web retrieval is available. Use the same owner for normal turns and prepared compaction without expanding sandbox mounts. Fixes openclaw#173657. Thanks to @seriouslysean for reporting the failed reads and @LiuwqGit for the earlier repair and read-only workspace coverage. Co-authored-by: LiuwqGit <[email protected]> * fix(agents): preserve remote sandbox documentation paths * fix(agents): retain remote workspace mount aliases --------- Co-authored-by: LiuwqGit <[email protected]>
What Problem This Solves
Fixes #173657. Sandboxed agents were told to read the gateway host's OpenClaw documentation directory even when that directory was absent from the sandbox. Following the prompt produced failed reads and could leave local models answering from memory.
User Impact
Sandboxed runs receive readable docs/source paths already exposed by their filesystem bridge, or the existing public reference URLs. This includes seeded SSH-derived workspaces, whose bridges intentionally omit a local
hostPath, and workspaces configured through a symlink. When neither local docs nor web tools are available, the prompt marks recalled behavior as unverified. No mounts or permissions are added.Why This Change Was Made
The shared resolver projects candidates through the admitted filesystem bridge. Its declared path mappings identify the backing source, preserving the configured mount alias for projection and using canonical paths only to check backing identity and containment. Shadow mounts and escaping symlinks remain excluded; docs-only mounts do not expose the parent source tree. Older bridges without mapping descriptors retain their host-backed check.
Normal attempts and prepared compaction supply the same admitted context. Host CLI/system overview references remain unchanged, and remote worker prompts retain their explicit empty references. The Documentation section moves into a small section module so the oversized main renderer shrinks.
Production +81/-39 (+42 net); tests +104/-3 (+101 net); docs +2. Necessary production growth covers projection identity, mount aliases, and unavailable-retrieval guidance. No alternate resolver or mount policy was added.
Thanks @seriouslysean for the report and offline-retrieval clarification, and @LiuwqGit for the earlier repair and read-only workspace coverage in #173720. Contributor co-author credit is preserved.
Evidence
RemoteShellSandboxFsBridgeregression failed on58dabaef(1 failure / 12 passes, 57.90s wall), then retained/remote/workspace/docsand/remote/workspaceafter repair. A separate symlinked-root regression failed on71a3bf(1 failure / 13 passes, 21.48s wall). Both now pass alongside unmounted, admitted workspace, read-only workspace, explicit bind, shadow, escaping-symlink and missing-bridge controls.58dabaef: isolatedpnpm openclaw agent --local, workspace rw, no package-docs mount. Before, the actual read of the advertised host path failed. After, the fixture used public URLs with no read; admitted/workspace/docsread succeeded. Native Ollamaqwen3:4bchanged from a 2,048-token truncated baseline to a normal URL answer without a read (64.80s CLI / 37.93s agent). These live runs were not repeated for the remote-mapping corrections.ceil(chars/4)(−22 estimated tokens). Earlier snapshot generations have zero committed byte/token delta.Platform: macOS host with Linux Docker for the original live proof. Remote regressions use the production bridge locally; no live SSH or Podman run is claimed. The original full SDK declaration build stalled, while supported runtime builds and original-head CI passed.
Prior-head CI (
71a3bf, run 38991335333) failed only the baseline-ratchets job and its aggregate gate: an unrelated updater-test mock omitted./update-command-database-context.js. The exact CI basefaeeb6fba770c10b431db8412593692f2ecad726reproduces the same diagnostic using an isolated Git index (34.39s); this PR changes neither that fixture nor its checker. Independent committed-branch Codex autoreview is scoped-clean at P2 and above on8e66859bef63d71d501ed4a634b6bca81f431c56, including real bridge and shared mapping source context. ClawSweeper reviewed that exact head: both earlier findings are resolved, no actionable findings or Before merge items remain, and it is ready for maintainer review. The disclosed live-SSH proof gap remains.Current-head CI run 38993224377 completed with 40 successful jobs, 25 skips, and the same unrelated mock-export failure in baseline-ratchets. The job pins base
1c72fb73b5e3de412c53d11dd082961bf887162f; an isolated index populated with that exact base reproduces the same updater diagnostic (70.43s). The moving PR API base is newer and passes the check, so attribution uses the job’s pinned checkout. No CI rerun, baseline relaxation, or unrelated source change was made.openclaw/ci-gateis red solely from that attributed baseline-ratchet failure; the inherited-failure exception remains for the lead. This PR has not been merged.