Skip to content

fix(sandbox): report install errors and keep pnpm stores out of results - #192051

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-sandbox-dependency-template-pnpm-install-fails-silently-20260919
Nov 3, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-sandbox-dependency-template-pnpm-install-fails-silently-20260919

Conversation

@steipete

@steipete steipete commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sandbox dependency installation reports only an exit code, and a pnpm store under a task-local XDG data directory can be captured as workspace output until staging exceeds its byte limit.

User Impact

Failed installs now include a bounded, redacted diagnostic. The observed artifacts/task-environment/local/share/pnpm/store root is excluded from capture, transfer, and staged-result recovery while sibling reports, nested fixtures, and admitted staged inputs remain available.

Why This Change Was Made

The installer keeps the final 2,048 characters after redacting both output streams; pnpm versions report errors on either stream. One entry in the existing shared path policy removes the content store before hashing, staged byte limits, and Git-input writes. No config or schema changes.

Source-only templates already reuse identical inputs, including installation failures; that policy is unchanged. A real offline Docker install with pinned pnpm 12.15.0 fails with ERR_PNPM_NO_OFFLINE_META, while the same frozen package installs online with a read-only root. This establishes an isolated reproduction, not the cause for every deployment's exit 1.

Evidence

  • Red regressions: two installer stream cases fail because the error detail is absent; two store cases fail because cache bytes and cache-only ancestry are captured.
  • Focused proof: 98 tests pass, two existing skips, across installer, template, capture/transfer, and local projection/recovery suites. Wrapper wall time: 139.77 seconds.
  • Real Docker/APFS preparation: 62,002 source files, 1,181,100,497 bytes. The first failed install logs its actual error; a second session reuses the source-only template without another install. All source bytes remain exact and no fixture builder survives. This is functional proof, not a speedup claim.
  • Performance acceptance declared before measurement: 62k synthetic files/~1.1 GB, A/A controls plus five interleaved A/B samples; store capture/hash/staged bytes must become zero, authored bytes must match, and no unexplained >=20% latency/CPU/allocation regression. Physical btrfs IO and large agent-database performance are outside this capture/staging workload.
  • Five interleaved A/B samples on 62,000 files / 1,181,100,000 logical bytes (2,000 authored files + 60,000 store files): capture median/p95 4,554/5,053 → 145/159 ms; total capture+staging median 5,537 → 441 ms; CPU median 10,367 → 663 ms; normal fast-import bytes written 43,084,762 → 589,668. Captured store bytes 1,143,000,000 → 0; hashes 62,000 → 2,000. Separate sampled V8 allocation 3,266,840,704 → 168,078,160 bytes. Authored digests match. Same-source A/A totals: 7,009/5,944 ms. APFS, warm filesystem/cold owner; physical device IO unmeasured. The baseline reproduces the actual 768 MiB staging cap; the candidate succeeds. Command and workload are documented in scripts/perf/README.md.
  • Changed-file checks completed; benchmark brace lint is corrected and targeted script lint passes. Core lint found the About-page Navigator-spread regression from improve(ui): redesign the About page around version facts and links #191289, already fixed on main in 547d5c496b94; integrated that named repair by rebasing onto 9c5f014050e7; the previously failing About test passes targeted lint. All other selected gates passed. A separate test-budget check finds 393 lines of existing shared debt at the integrated parent despite this change's exact 17-line allocation. Shared reconciliation is tracked in fix(ci): reconcile exact test budget and restore browser fixtures #192026. This is not claimed as an inherited-red landing exception.
  • Codex autoreview P0–P2: scoped-clean on the local change against 51bee40d3c7f; no actionable findings. The allocation was mechanically corrected from 15 to 17 after formatting; four benchmark brace pairs were corrected after lint. The rebase only consumes unrelated main changes, including the named lint repair. No Control UI import boundary is touched.
  • Production delta: +14 lines including generated output (+12 handwritten); regression delta: +17 lines, funded by the task-specific allocation. Growth adds the requested diagnostic and one shared exclusion; no state owner or cache is added.

Current CI and review disposition

The approved scalar change 6,325,211 → 6,325,292 landed in #192207 as 135c63e. Duplicate #192216 was closed after the native merge guard verified it would make no change to main. No duplicate increase was applied.

Per-PR attribution since f08cd31: #192172 -1, #156399 +10, #192169 -3, #192170 -2, #191409 -1, #191411 -2, #191470 +533 = +534 test LF lines; #191470 allocated 453, leaving the approved 81. Newer main independently changed the count; the final sandbox candidate has 6,441,596 test lines / 6,441,685 ceiling (89 slack), including this task's exact 17-line allocation.

Current head 88c321b rebases patch-identically onto the merged repair and retains its prior focused behavior proof and Codex review. Exact-head CI run41708216137 passed. Native auto-merge landed the exact head as3b4e66e37807ff7b0910fa9ad0f253891127131a. No inherited-CI exception was used.

Hosted review's requested raw installer logging is rejected: the task explicitly requires a bounded, redacted diagnostic, overriding the general raw-log default for this output. Canonical redaction before truncation and the credential regression remain intentional.

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling size: M labels Nov 3, 2026
@steipete
steipete marked this pull request as ready for review November 3, 2026 16:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T20:00:52.068131Z 88c321b New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 88c321bbe39acf2ca897300d384a04e1f5ed4fd7
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sandbox/dependency-template.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4ac9f24bc

ℹ️ 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 clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds bounded installer diagnostics and excludes the observed task-local pnpm store from workspace results.

Example: An offline pnpm 12.15.0 dependency installation fails with ERR_PNPM_NO_OFFLINE_META.

  • Before: The warning reports only pnpm install failed (exit 1).
  • After: The warning includes a bounded diagnostic containing ERR_PNPM_NO_OFFLINE_META.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, narrowly owned repair with reported real-runtime measurements, but the confirmed raw-log contract violation needs correction.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports Docker/APFS installer behavior and production-owner staging measurements, while the inspected images demonstrate only the linked About-page change.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Sandbox installation failures hide their cause, and generated task-local pnpm store files can prevent workspace results from staging.
Reason: The maintainer-authored direction addresses observed failures through existing owners while preserving source-only reuse, authored files, and current limits.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored PR addresses concrete sandbox failures, but installer-side redaction violates the repository’s raw-log contract.

Priority: P2
Reviewed head: b4ac9f24bc88d5c09a7d1aa3dc0916eeadc60573

Before merge

  • Preserve raw diagnostics until the logging egress (P2) - When an installation fails with a diagnostic such as password=fixture-secret, this call irreversibly masks the value before local-workspace-template.ts:247 passes result.reason to log.warn. The subsystem logger consequently stores the masked message in the protected file log, losing the original diagnostic despite AGENTS.md requiring raw records and egress-only redaction. Keep the bounded diagnostic raw for the logging owner and apply masking at console/export boundaries; update the regression so it verifies those separate audiences.

Findings

  • [P2] Preserve raw diagnostics until the logging egress — src/agents/sandbox/dependency-template.ts:289-291

Tests

  • Missing end-to-end proof: The reported Docker/APFS sandbox runs have no accompanying inspectable runtime trace; the prepared screenshots show unrelated About-page behavior.
Agent review details

How this fits together

Sandbox preparation installs dependencies in disposable containers, while the shared workspace policy selects files for capture, transfer, reconciliation, and recovery.

flowchart TD
  A[Managed workspace preparation] --> B[Disposable dependency installer]
  B --> C[Source or dependency template]
  B --> D[Subsystem logging]
  C --> E[Private session workspace]
  E --> F[Shared generated path policy]
  F --> G[Captured and staged source results]
Loading

Technical review

Best possible solution:

Keep the exact-root exclusion and bounded diagnostics, preserving raw diagnostic records while the existing logging egress owners redact wider-audience output.

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

Current-main source omits installer output and does not exclude the demonstrated task-local store; the body reports red regressions and real Docker reproduction, but no target code was executed during this review.

Is this the best way to solve the issue?

The existing classifier is the smallest complete owner for the cache repair, and the diagnostic change needs only the logging-ownership correction rather than another state or policy layer.

Full review comments:

  • [P2] Preserve raw diagnostics until the logging egress — src/agents/sandbox/dependency-template.ts:289-291
    When an installation fails with a diagnostic such as password=fixture-secret, this call irreversibly masks the value before local-workspace-template.ts:247 passes result.reason to log.warn. The subsystem logger consequently stores the masked message in the protected file log, losing the original diagnostic despite AGENTS.md requiring raw records and egress-only redaction. Keep the bounded diagnostic raw for the logging owner and apply masking at console/export boundaries; update the regression so it verifies those separate audiences.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c5c4ec06d1f5.

Provenance checked

  • Installer failure diagnostics changes intended behavior with a stated reason (7283a5c: The dependency-template implementation intentionally withheld installer output because it can contain registry credentials; the PR explains the need for bounded diagnostics.)
  • Shared generated-path classification and embedded consumers keeps the original intent (9012743: Exact runtime-owned roots are excluded consistently from capture, transfer, reconciliation, and historical result recovery while neighboring authored files remain eligible.)
  • Failed-install source-only template reuse keeps the original intent (6f323c4: Clean failed installations should reuse validated source rather than rebuild the entire checkout.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/agents/sandbox/dependency-template.test.ts src/gateway/worker-environments/local-workspace-template.test.ts --maxWorkers=1
  • Run the affected logging-boundary regression and demonstrate that the raw-record assertion fails before the repair.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/sandbox/dependency-template.ts src/agents/sandbox/dependency-template.test.ts
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 7283a5c adds src/agents/sandbox/dependency-template.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7283a5cd90c2; files: src/agents/sandbox/dependency-template.ts)
  • Shakker: Raw commit 9012743 adds src/gateway/worker-environments/workspace-path-exclusions.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 90127436fa45; files: src/gateway/worker-environments/workspace-path-exclusions.ts)

PR surface

Source +12, Tests +17, Docs +37, Generated +2, Other +198. Total +266 across 13 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 16 4 +12
Tests 3 26 9 +17
Docs 4 40 3 +37
Config 0 0 0 0
Generated 2 2 0 +2
Other 2 198 0 +198
Total 13 282 16 +266

Labels

Label changes:

  • add P2: The PR repairs diagnosability and a bounded sandbox workspace-staging failure without evidence of a widespread urgent regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The PR repairs diagnosability and a bounded sandbox workspace-staging failure without evidence of a widespread urgent regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 3, 2026, 11:23 AM ET / 16:23 UTC.

@steipete

steipete commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

The redaction is intentional for this repair. The task explicitly requires a bounded, redacted tail of installer output, overriding the general raw-log default for this diagnostic. Package-manager output can contain registry credentials; preserving those values is unnecessary to diagnose the failure category. The implementation uses the existing canonical redactor before truncation, and regression tests verify both output streams retain the error while masking synthetic credentials. No logging-owner policy is changed. I am retaining this behavior and rejecting the requested raw-secret logging change.

The runtime evidence is Docker/APFS synthetic preparation and capture/staging measurements, documented in the PR body and committed rerunnable benchmark. This PR has no UI change or screenshot proof; any About-page screenshots are unrelated to this patch.

@steipete
steipete force-pushed the steipete/perf-micro-sandbox-dependency-template-pnpm-install-fails-silently-20260919 branch from b4ac9f2 to c4d6666 Compare November 3, 2026 19:28
Keep bounded redacted installer diagnostics and remove the task-local pnpm content store through the existing capture, transfer and recovery exclusion owner. Preserve source-only template reuse, source artifacts and admitted inputs. Add red-to-green regression coverage and a synthetic 62k-file staging benchmark.
@steipete
steipete force-pushed the steipete/perf-micro-sandbox-dependency-template-pnpm-install-fails-silently-20260919 branch from c4d6666 to 88c321b Compare November 3, 2026 19:58
@steipete
steipete enabled auto-merge (squash) November 3, 2026 20:09
@steipete
steipete merged commit 3b4e66e into main Nov 3, 2026
135 of 137 checks passed
@steipete
steipete deleted the steipete/perf-micro-sandbox-dependency-template-pnpm-install-fails-silently-20260919 branch November 3, 2026 20:12
@steipete

steipete commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…enclaw#192051)

Keep bounded redacted installer diagnostics and remove the task-local pnpm content store through the existing capture, transfer and recovery exclusion owner. Preserve source-only template reuse, source artifacts and admitted inputs. Add red-to-green regression coverage and a synthetic 62k-file staging benchmark.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Release adaptation: backport only the Socket Mode reconnect waiter owner
and focused regression tests; omit the performance harness and main-only
transport documentation addition. Add listener-count assertions for timer
settlement and disconnect cancellation; adjust the test allocation to 41.

Companion dispositions: #198007 is specific to SDK 3.2 callback/abort
semantics and is not applicable to this line pinned to socket-mode 3.1.0.
#197657 retires main allocations; other audit hits (#200523, #197009,
#194964, #184507, #192197, #192051, #190003, #189850) only overlap the
excluded shared perf README. No later #188745 mention through bd692e9.

(cherry picked from commit a1d1da7)

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts security-sensitive-changed size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant