Skip to content

fix: give root-aware recovery when file tools reject another repository - #194473

Merged
joshavant merged 6 commits into
openclaw:mainfrom
jason-allen-oneal:fix/file-tool-workspace-recovery
Nov 10, 2026
Merged

joshavant merged 6 commits into
openclaw:mainfrom
jason-allen-oneal:fix/file-tool-workspace-recovery

Conversation

@jason-allen-oneal

@jason-allen-oneal jason-allen-oneal commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: host file tools suggest ineffective worker recovery when an authorized task targets a repository outside the session's recorded root.

User Impact

Read, write, edit, directory listing, and patch rejections now explain recovery that matches the effective boundary. Configuration-only containment can use a permitted worker with the target cwd; a hidden native child cannot widen an inherited session root by changing cwd. An operator-authorized session rooted at the target can complete the task. Required roots, sender restrictions, and sandbox boundaries remain enforced. No permissions, allowed roots, defaults, or configuration semantics change.

Why This Change Was Made

The existing patch-tool recovery was appropriate for configuration-only containment but was also advertised for recorded session roots. This PR shares the diagnostic owner across host file tools, carries the already-recorded containment source into their messages, and corrects the sessions_spawn.cwd description to match the enforced hidden-child contract. Scratch-file guidance remains available; container/mount errors retain their existing explanation.

Related: #194472 addresses the separate owner-tool/network-taint failure and remains unchanged.

Evidence

  • Regression composition exercises the prepared policy and production read/write/edit/ls/patch tools with a target cwd outside the recorded root. The two new cases fail on the prior PR source and pass with this amendment; rejected operations leave target files unchanged, while in-root writes remain permitted. The spawn-contract regression also fails against the prior schema.
  • Isolated live Gateway proof used a real agent/model and public session/chat APIs. Configuration-only containment recovered through a hidden target-cwd worker; Workspace mode with admitted admin authority recovered through a visible target-rooted worker without changing the parent root; a directly created target-rooted Workspace session completed without Full Access. Without operator.admin, visible creation was forbidden, no child was persisted, files stayed unchanged, and the delivered final named the required operator action. Successful cases verified all four file operations, exact canary/newline contents, persisted roots/modes, and delivered final events.
  • One initial acceptance assertion incorrectly rejected all child spawns, including the valid admin-authorized visible worker. Inspection of the original records and independent filesystem checks established that allowed outcome; the contrasting lower-scope run verified the denial. A yielding acknowledgment alone was never counted as completion.
  • Compatibility validation passed 157 tests across nine files before the final spawn-description correction. The final candidate passed 41 focused tests, production and affected test type checks, targeted lint/format, and the runtime build. Live source hashes matched the reviewed candidate. Hosted CI for the new head remains a separate gate.
  • Independent review: Codex autoreview completed a P0–P3 review of the amendment against d0c37b128383e05031f639ab5c5dd04acb9222ca, with no actionable findings (scoped-clean). The reviewed local snapshot was committed unchanged as 4c23b3c5a8ab2281ca94f87df970d777b1cba03a. This was source review; it did not independently rerun the reported tests. Prior authentication failures produced no review and are superseded only by this completed pass.

Combined-head acceptance — November 10, 2026 (UTC)

Tested the actual clean merge 563502299d4245056f07912e4bb7311ed0f2a59d (tree 1bb5847949fb13c0da929c1c73ec04f096863a48), combining this PR at 2f9a8284def51bfe5375192456d3cc1d011e3b0a with #194472 at 3548ccde70c8d9f9e96f6a09c4f6261bf5e91de1. This PR integrated main e95289326a7907f6ce926afbb4e81a03bbedef98 only to resolve real generated-prompt conflicts. The four recovery production modules are unchanged from the previously reviewed amendment. Contributor source, builds, tests, and real-model Gateway runs executed in a task-owned VM with separate synthetic state; no operator Gateway was changed.

These are sanitized observations from persisted transcripts, session records, independent disk checks, and received public Gateway events, rather than assistant completion claims:

Case / run Observed operation and durable outcome Final delivery / boundary
Owner, 29efc5b1-93ec-4cd2-85d1-ea62687d8451 Explicit senderIsOwner=true; actual GitHub HTTP 200 network result; subsequent setup save and separate readback both execute with turnTainted=true; disk assignment is contributor. Non-yielded chat.final; terminal receipt sourceReplyDelivered=true, terminalDisposition=visible; one human request.
Workspace recovery, bfa1c357-7967-4dea-b3e9-fc612c252d72 Parent read denied; admin-authorized visible=true worker accepted; child records target cwd and target session root, retaining Workspace mode; actual read/write/edit/patch calls succeed; exact canary-plus-newline and both after\n files independently match. Parent coordinator root unchanged; yielding ACK followed by substantive final containing canary on the original session.
Hidden child, 82d35143-58aa-4a2e-9565-7fbbde52d58b Exactly one visible=false worker records target cwd but inherits coordinator root; actual outside-root read and write denied; child writes/readbacks inside-ok\n inside coordinator; target files unchanged. Parent performs no file operations; substantive completion final delivered; no visible child or permission widening.
Non-admin, da7d466f-95ed-4108-b381-67e6e163f48b Admitted scopes are only operator.read,operator.write; actual visible target-cwd spawn returns status=forbidden and requires operator.admin; no child persisted; files unchanged. Non-yielded final delivered with the denial; no automatic escalation.

Selected actual output, with synthetic paths/canary abbreviated:

owner setup: Updated gateway.roles.assignments.byGithubLogin.jason-allen-oneal.
owner readback: ... reads back as `"contributor"`, matching the existing role.
owner terminalReceipt: sourceReplyDelivered=true; terminalDisposition="visible".
recovery write: Successfully wrote 51 bytes to <target>/result.txt
recovery edit: Successfully replaced 1 block(s) in <target>/edit.txt.
recovery patch: Success. Updated the following files: M patch.txt
hidden read/write: Path escapes sandbox root (<coordinator>): <target>/...
non-admin spawn: {"status":"forbidden","error":"Visible session cwd \"<target>\" is outside configured agent workspaces and requires operator.admin. ..."}

Representative record correlation: owner transcript sequences 12 → 14–18 → 20 establish network result → tainted setup/readback → final; recovery child sequences 7–20 establish actual tools and readbacks. Hidden child sequences 8–18 establish both denials and the permitted write. No reasoning, credentials, private host paths, or full conversations are included here.

Combined runtime build passed (83.4s). 57 tests across four focused files passed in 156.41s: retained-owner tool authority, setup authority/persistence integration, prepared tool surface, and subagent workspace inheritance. The VM prompt-snapshot check passed; exact published-head CI also passes check-prompt-snapshots.

Exact-head CI run 42771610012 completed red, with two failures: test-line ratchet and required visible spawn selects github project (managed worktree: false). The classifier labels them new/unknown respectively; those labels are not a causal attribution. Direct raw-Git counting of CI base baccc7e152916c7f4a48596b5cb544c12264ac54 establishes 6,618,377 test lines / 6,618,307 ceiling, an inherited 70-line deficit. This PR adds exactly 88 test lines and allocations of 21 + 67; CI's merge tree reports 6,618,465 / 6,618,395, the same 70-line deficit. No budget was raised or test weakened.

The spawn failure is also reproduced independently on unchanged inspected main e95289326a7907f6ce926afbb4e81a03bbedef98: the full 27-test file reports 26 passed / 1 failed on both the combined candidate (138.91s) and main (91.91s), with the same missing status: "failed" at line 307. Both comparisons used Node 24.22.1/Linux ARM64 with the same frozen dependencies; CI used Bun/Linux x64, so this is not an exact-platform main-CI replay. The relevant spawn/root/lifecycle code and test are unchanged by this PR. Two earlier base attempts failed during temporary-checkout setup (missing UI dependency link, then the existing disk-reserve guard); neither is counted as a product result. The completed comparison retains the disk guard and has no capacity failures.

combined and main:
  FAIL required visible spawn selects github project (managed worktree: false)
  Expected: {sandbox: "required", status: "failed"}
  Received: {sandbox: "required"}  // other matched properties omitted by runner
  Tests: 1 failed | 26 passed (27)

The two CI failures are therefore attributed to inherited main conditions from the recorded evidence. CI remains red; this PR does not claim to repair that separate spawn expectation/lifecycle behavior or bypass any enforced gate.

Fresh combined independent review was attempted but unavailable: configured provider validation and default reviewer authentication failed before a validated report was produced. That is no fresh review result, not a clean review. The earlier completed amendment review remains accurately scoped above. #194472's enforced security-sensitive review is still pending. Neither PR has been merged.

The contributor's earlier scripted CLI evidence remains valid for its disclosed source hashes and scope; it did not claim real-model recovery through sessions_spawn. The live checks above cover that previously missing path. Earlier hosted CI and ClawSweeper results cover d0c37b128383e05031f639ab5c5dd04acb9222ca, not this amendment.

Contributor: @jason-allen-oneal.

@clawsweeper

clawsweeper Bot commented Nov 7, 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 agents Agent runtime and tooling extensions: codex size: S labels Nov 7, 2026
@jason-allen-oneal
jason-allen-oneal marked this pull request as ready for review November 7, 2026 04:56
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR makes host file-tool recovery messages distinguish configuration containment, recorded session roots, and required roots.

Example: A Workspace-mode session rooted at /work/coordinator tries to edit /work/project/note.txt.

  • Before: The patch rejection suggests respawning a hidden worker with cwd=/work/project, although that child retains the recorded root.
  • After: The rejection explains that changing cwd cannot widen the inherited root and directs the operator to an authorized target-rooted session.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch has no identified correctness defect, but inspectable runtime evidence covers only the earlier behavior.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Agents can follow a file-tool rejection's recovery advice and encounter the same rejection because changing a hidden child's cwd does not widen its recorded root.
Reason: Accurate recovery extends established diagnostics and preserves the designed filesystem boundaries.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: it fixes misleading recovery guidance still present on main, with no actionable code or security findings.

Priority: P3
Reviewed head: 4c23b3c5a8ab2281ca94f87df970d777b1cba03a

Before merge

  • Add real behavior proof - The inspected linked CLI artifacts prove the earlier configuration-bound rejection and correctly bound access, but precede the source-aware amendment. The body describes real-model Gateway checks without corresponding inspectable output. The PR owner should publish the retained redacted logs or terminal capture showing the amended session-root rejection, target-rooted recovery, and reported lower-scope denial, with the candidate/source mapping; no rerun is needed if those records already exist. Redact IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: The reported Gateway checks for the amendment need inspectable output showing recorded-root rejection and authorized target-rooted recovery.
Agent review details

How this fits together

Core coding tools validate filesystem requests against prepared containment policy and return recovery diagnostics through the selected agent harness.

flowchart TD
  A[Agent filesystem request] --> B[Core coding tools]
  B --> C[Prepared containment policy]
  C --> D[Permitted filesystem operation]
  C --> E[Root rejection]
  E --> F[Shared recovery diagnostic]
  F --> G[Agent harness response]
Loading

Technical review

Best possible solution:

Retain the shared, source-aware recovery diagnostics while preserving the existing containment owners and permitted paths.

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

Current-main source unconditionally recommends cwd-based respawning for session-root patch rejections, while the spawn and prepared-policy owners preserve a separate recorded root; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is a focused repair using the existing diagnostic owner and policy source, with no competing state, configuration, or permission mechanism.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Workspace-safe scratch guidance keeps the original intent (9445960: Explain workspace-local scratch recovery without relaxing containment.)
  • Worker repository-binding recovery changes intended behavior with a stated reason (c0ffba6: Explain omitted cwd and why changing exec workdir cannot rebind file tools.)
  • Operator and container diagnostics keeps the original intent (6f2faba: Keep permission-policy advice operator-only and preserve bridge-owned containment explanations.)
  • Advertised spawn cwd contract changes intended behavior with a stated reason (4830658: Tell orchestrators how cwd affects file-tool resolution and containment.)
  • Control UI failure-heading assertion keeps the original intent (dd11a9c: Exercise visible startup failure and recovery; the corrected assertion matches unchanged production copy.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c0ffba6 adds src/agents/apply-patch-containment-hint.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c0ffba6e18a3; files: src/agents/apply-patch-containment-hint.ts)

PR surface

Source +41, Tests +88, Docs +5, Other +4. Total +138 across 15 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 63 22 +41
Tests 7 122 34 +88
Docs 2 8 3 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 15 197 59 +138

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test LOC Production +63/-22; tests +122/-34. Growth shares recovery policy across file tools and covers distinct configuration, inherited-root, required-root, container, and harness contracts.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦞 diamond lobster.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P3: This improves diagnostics for an advanced agent-worker workflow without changing allowed filesystem access.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦞 diamond lobster.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-07T05:12:55.385Z sha d7b6b7b :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-07T07:51:56.779Z sha 45e8df9 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-07T08:05:49.845Z sha d0c37b1 :: needs maintainer review before merge. :: none

Reviewed November 10, 2026, 1:35 AM ET / 06:35 UTC (Revision 4).

@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed 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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 7, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Nov 10, 2026
@joshavant
joshavant merged commit 5d5c90e into openclaw:main Nov 10, 2026
129 of 133 checks passed
RomneyDa added a commit that referenced this pull request Nov 10, 2026
…ntracts

main #194473 reworded the file-tool containment hint per source and #196756 compacted tool-result JSON; main #196459 gave unknown Claude ids mandatory adaptive thinking, so the non-reasoning fallback fixture uses a pre-Claude-5 id.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…ry (openclaw#194473)

* fix: explain worker binding when file tools reject another repository

* test(ui): match the shipped mount-failure heading

* fix: make file-tool recovery respect recorded roots

* test: refresh root-aware recovery prompt snapshots

---------

Co-authored-by: joshavant <[email protected]>
roboclaw-bot added a commit that referenced this pull request Nov 11, 2026
…#197082)

Align the worker permission fixture with source-specific containment recovery guidance introduced by #194473 and compact JSON results introduced by #196756. Preserve exact denial, outside-file contents/mode and operator-only hint assertions. No production permission policy changes.

Proof: independent isolated review clean; source-extracted diagnostic red/green checks for configured and guarded modes; exact-head CI 42974054691 passed changed tests, boundary checks, lint/types, ratchets and ci-gate. Local named runtime test could not collect without task dependencies; no local integration success claimed.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 12, 2026
## What Problem This Solves

An agent cannot collect an already-finished background process when unrelated Code Mode continuations fill all 64 suspended-run slots. The fresh observer fails before reaching `process`, even with outer `awaitResults: true`.

## User Impact and Solution

Required-completion cells keep their owner until settlement and cannot publish suspended continuations, so they no longer reserve a suspension slot at inline dispatch or checkpoint settlement. Agents can collect the original process result without relaunching work. Capacity errors and troubleshooting guidance explain this recovery path.

Default suspension admission, existing-run reservation transfer, process retention, authority checks, and cancellation are unchanged. This complements #196435's rejected-cell settlement fix; it addresses fresh-observer admission rather than process-output loss. It intentionally permits actively owned required-completion cells at the suspension cap, not a new total-live-cell resource limit.

## Evidence

- One real native background process and 64 genuine parked VM continuations: default observation fails without dispatch; required observation retrieves the original terminal output. Assertions retain one launch, one poll, the 64-slot cap, active-resume reservation, cancellation, and capacity recovery.
- Regression fails on base `5e8ed5f5b437e3a8438a036eb42c4d98009d0d86`, passes with the fix.
- Seven focused suites: **169 tests passed**, including agent-loop recovery, Node/QuickJS failure origins, required wait/cancellation, shell terminal draining, bridge behavior, and prompt-prefix stability.
- Core and changed-test TypeScript, targeted type-aware lint, formatting, MDX, and diff checks passed.
- Exact **59-line** allocation records the native-process setup and assertions added to the existing capacity test; shared scalar unchanged. Local test-line ratchet passes with 17 lines slack, and the previous head's complete baseline-ratchet CI passed. Saturation test takes about 2 seconds locally.
- No new queue, quota, recovery manager, or persistent state. Production delta: 9 added / 3 removed lines.

## CI repairs

Earlier heads exposed two inherited worker containment expectation failures in `checks-node-changed-11`. Source inspection and base reproduction established stale expectations after #194473's root-aware recovery and #196756's compact JSON serialization. Current main `18adeb3f1768b3c1371b3c294f06397d5cb352ea` still had those expectations; no competing fix was found.

The follow-up updates only `src/worker/worker-runtime-permissions.suite.ts`: independent per-policy literal expectations and exact compact JSON output. Rejection status, tool name, escaped path, operator-only hint separation/logging, unchanged outside-file contents, and file-mode assertions remain intact. No permission behavior, ignores, retries, or gates were weakened.

- `node scripts/run-vitest.mjs src/worker/worker.runtime.test.ts --maxWorkers=1`: **69 passed**, 40.79 seconds suite / 47.24 seconds wrapper. The existing suite's real background-process cleanup tests dominate duration; the two repaired cases take 29/24 ms.
- Changed-test TypeScript graph (`gateway-other`), type-aware lint, formatting, diff check, and test-line ratchet passed.
- New-head CI is being evaluated separately; previous-head results are not claimed as current-head CI proof.

## Review and limitations

Independent native-subagent reviews of the implementation, exact allocation, and worker repair found no actionable defects. Local reviewer CLIs and bound autoreview tool were unavailable; no review tools were installed. These were narrative independent reviews, not helper-enforced isolation or structured helper validation. Hosted review of `1269cc403ec7243b847eb4cbec0ff0b5a8d08f6e` also reported no findings.

The new saturation case executes Node. QuickJS support is backed by shared owner-path inspection and existing parity/failure tests, not a separate saturation run. No shipped Gateway/live-model saturation capture or guarantee of model recovery choices is claimed; proof exercises the actual Code Mode/native-process integration boundary.

## Main integration (November 11, 2026)

Merged main into the published PR branch without rewriting history (head `33a9fa55f09e6cbb41300cc0aa67ee9ef2edf94b`). Verified tree equivalence with the reviewed rebase plus the disjoint main update. The equivalent rebased code passed the native-process capacity regression and 69 worker tests, targeted type-aware lint, and formatting. The final merge passed diff checks and the test-line ratchet with 10 lines slack; no shared budget increase. Updated-head CI verified on November 11, 2026: 71 checks passed, 59 skipped, no failures or pending checks on `33a9fa55f09e6cbb41300cc0aa67ee9ef2edf94b`. The PR remains open; no merge was performed.

## Main conflict resolution (November 12, 2026)

Merged main `4947e40db109` normally into the PR without force-pushing. New head: `225c5b5bcf06f45ef6018580425bc94349c1b9c2`. The only conflict was in the worker containment test: main now has the same corrected messages and compact JSON expectation. Kept the already-reviewed independent per-policy literal expectations; no new production behavior. The database-worker test inventory auto-merged both additions.

Scoped proof on the integrated tree: native-process saturation regression passed; all 69 worker runtime tests passed; worker test typecheck, type-aware lint, formatting, and diff check passed. Existing implementation review remains applicable to this mechanical integration. The initial worker invocation hit unresolved conflict markers after a failed editing command; the corrected complete worker suite passed. Current-head CI is pending and is required before merge; previous-head green checks are not claimed as current proof.

<!-- openclaw-publication:496957c8-5491-47fa-9565-7ecf6d229daa -->
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
…openclaw#197082)

Align the worker permission fixture with source-specific containment recovery guidance introduced by openclaw#194473 and compact JSON results introduced by openclaw#196756. Preserve exact denial, outside-file contents/mode and operator-only hint assertions. No production permission policy changes.

Proof: independent isolated review clean; source-extracted diagnostic red/green checks for configured and guarded modes; exact-head CI 42974054691 passed changed tests, boundary checks, lint/types, ratchets and ci-gate. Local named runtime test could not collect without task dependencies; no local integration success claimed.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
## What Problem This Solves

An agent cannot collect an already-finished background process when unrelated Code Mode continuations fill all 64 suspended-run slots. The fresh observer fails before reaching `process`, even with outer `awaitResults: true`.

## User Impact and Solution

Required-completion cells keep their owner until settlement and cannot publish suspended continuations, so they no longer reserve a suspension slot at inline dispatch or checkpoint settlement. Agents can collect the original process result without relaunching work. Capacity errors and troubleshooting guidance explain this recovery path.

Default suspension admission, existing-run reservation transfer, process retention, authority checks, and cancellation are unchanged. This complements openclaw#196435's rejected-cell settlement fix; it addresses fresh-observer admission rather than process-output loss. It intentionally permits actively owned required-completion cells at the suspension cap, not a new total-live-cell resource limit.

## Evidence

- One real native background process and 64 genuine parked VM continuations: default observation fails without dispatch; required observation retrieves the original terminal output. Assertions retain one launch, one poll, the 64-slot cap, active-resume reservation, cancellation, and capacity recovery.
- Regression fails on base `d53716c9b1671e5509516227f720722e25d9e1d4`, passes with the fix.
- Seven focused suites: **169 tests passed**, including agent-loop recovery, Node/QuickJS failure origins, required wait/cancellation, shell terminal draining, bridge behavior, and prompt-prefix stability.
- Core and changed-test TypeScript, targeted type-aware lint, formatting, MDX, and diff checks passed.
- Exact **59-line** allocation records the native-process setup and assertions added to the existing capacity test; shared scalar unchanged. Local test-line ratchet passes with 17 lines slack, and the previous head's complete baseline-ratchet CI passed. Saturation test takes about 2 seconds locally.
- No new queue, quota, recovery manager, or persistent state. Production delta: 9 added / 3 removed lines.

## CI repairs

Earlier heads exposed two inherited worker containment expectation failures in `checks-node-changed-11`. Source inspection and base reproduction established stale expectations after openclaw#194473's root-aware recovery and openclaw#196756's compact JSON serialization. Current main `ecfec37bdb3551b3555550d398d19655c9327a9f` still had those expectations; no competing fix was found.

The follow-up updates only `src/worker/worker-runtime-permissions.suite.ts`: independent per-policy literal expectations and exact compact JSON output. Rejection status, tool name, escaped path, operator-only hint separation/logging, unchanged outside-file contents, and file-mode assertions remain intact. No permission behavior, ignores, retries, or gates were weakened.

- `node scripts/run-vitest.mjs src/worker/worker.runtime.test.ts --maxWorkers=1`: **69 passed**, 40.79 seconds suite / 47.24 seconds wrapper. The existing suite's real background-process cleanup tests dominate duration; the two repaired cases take 29/24 ms.
- Changed-test TypeScript graph (`gateway-other`), type-aware lint, formatting, diff check, and test-line ratchet passed.
- New-head CI is being evaluated separately; previous-head results are not claimed as current-head CI proof.

## Review and limitations

Independent native-subagent reviews of the implementation, exact allocation, and worker repair found no actionable defects. Local reviewer CLIs and bound autoreview tool were unavailable; no review tools were installed. These were narrative independent reviews, not helper-enforced isolation or structured helper validation. Hosted review of `1269cc403ec7243b847eb4cbec0ff0b5a8d08f6e` also reported no findings.

The new saturation case executes Node. QuickJS support is backed by shared owner-path inspection and existing parity/failure tests, not a separate saturation run. No shipped Gateway/live-model saturation capture or guarantee of model recovery choices is claimed; proof exercises the actual Code Mode/native-process integration boundary.

## Main integration (November 11, 2026)

Merged main into the published PR branch without rewriting history (head `33a9fa55f09e6cbb41300cc0aa67ee9ef2edf94b`). Verified tree equivalence with the reviewed rebase plus the disjoint main update. The equivalent rebased code passed the native-process capacity regression and 69 worker tests, targeted type-aware lint, and formatting. The final merge passed diff checks and the test-line ratchet with 10 lines slack; no shared budget increase. Updated-head CI verified on November 11, 2026: 71 checks passed, 59 skipped, no failures or pending checks on `33a9fa55f09e6cbb41300cc0aa67ee9ef2edf94b`. The PR remains open; no merge was performed.

## Main conflict resolution (November 12, 2026)

Merged main `ec930d1030e9` normally into the PR without force-pushing. New head: `225c5b5bcf06f45ef6018580425bc94349c1b9c2`. The only conflict was in the worker containment test: main now has the same corrected messages and compact JSON expectation. Kept the already-reviewed independent per-policy literal expectations; no new production behavior. The database-worker test inventory auto-merged both additions.

Scoped proof on the integrated tree: native-process saturation regression passed; all 69 worker runtime tests passed; worker test typecheck, type-aware lint, formatting, and diff check passed. Existing implementation review remains applicable to this mechanical integration. The initial worker invocation hit unresolved conflict markers after a failed editing command; the corrected complete worker suite passed. Current-head CI is pending and is required before merge; previous-head green checks are not claimed as current proof.

<!-- openclaw-publication:496957c8-5491-47fa-9565-7ecf6d229daa -->
RomneyDa added a commit that referenced this pull request Nov 14, 2026
…during compaction (#196550)

* fix: reduce Gateway heap spikes during long-session compaction

OpenClaw-Publication: 3c8ed9c2-cdf2-4a3e-9cfc-cb237d488ace

* fix: reuse compaction facts without repeated transcript parsing

OpenClaw-Publication: b899f5e4-7fb9-46f0-9b19-635e33a8b99c

* Publish openclaw/keen-prawn

OpenClaw-Publication: 33dc62a0-c779-4768-97d2-4b3fa2323cdf

* Publish openclaw/keen-prawn

OpenClaw-Publication: f8c0512a-6354-4487-b291-d85f50f68262

* fix: reconcile compaction regression-test allocation

OpenClaw-Publication: 90ea6a98-3750-4df1-8f07-6333b0ba229c

* fix(compaction): free the compaction worker during summary model calls

* fix: match compaction concurrency test-line credit to its net growth

* perf(compaction): check only captured rows before rerendering summary input

* test: align worker containment and Claude fallback tests with main contracts

main #194473 reworded the file-tool containment hint per source and #196756 compacted tool-result JSON; main #196459 gave unknown Claude ids mandatory adaptive thinking, so the non-reasoning fallback fixture uses a pre-Claude-5 id.

* refactor(compaction): keep preflight metadata in its reader

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

* fix(compaction): detach bounded floor facts from transcript payloads

Prevent small excerpts and identifier captures from retaining whole source strings while a compaction plan is cached. Add a GC retention regression for the owning producer.

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

* fix(workers): defer slow idle GC logging imports

Keep the slow-GC diagnostic behind its own lazy operation boundary so small workers do not eagerly evaluate the logging graph. Preserve collection thresholds and warning fields.

The existing production build gate reproduces 240 identity-worker modules on the base and passes at 203 after the repair (budget 220 unchanged). Full and sourcePerformance builds, 11 focused worker tests, infra typecheck, lint, and format checks pass. Independent native review found no actionable P0/P1/P2 findings; local autoreview was unavailable because Codex was not installed.

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

* fix: complete compaction wrapper inventory

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

---------

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
…during compaction (openclaw#196550)

* fix: reduce Gateway heap spikes during long-session compaction

OpenClaw-Publication: 3c8ed9c2-cdf2-4a3e-9cfc-cb237d488ace

* fix: reuse compaction facts without repeated transcript parsing

OpenClaw-Publication: b899f5e4-7fb9-46f0-9b19-635e33a8b99c

* Publish openclaw/keen-prawn

OpenClaw-Publication: 33dc62a0-c779-4768-97d2-4b3fa2323cdf

* Publish openclaw/keen-prawn

OpenClaw-Publication: f8c0512a-6354-4487-b291-d85f50f68262

* fix: reconcile compaction regression-test allocation

OpenClaw-Publication: 90ea6a98-3750-4df1-8f07-6333b0ba229c

* fix(compaction): free the compaction worker during summary model calls

* fix: match compaction concurrency test-line credit to its net growth

* perf(compaction): check only captured rows before rerendering summary input

* test: align worker containment and Claude fallback tests with main contracts

main openclaw#194473 reworded the file-tool containment hint per source and openclaw#196756 compacted tool-result JSON; main openclaw#196459 gave unknown Claude ids mandatory adaptive thinking, so the non-reasoning fallback fixture uses a pre-Claude-5 id.

* refactor(compaction): keep preflight metadata in its reader

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

* fix(compaction): detach bounded floor facts from transcript payloads

Prevent small excerpts and identifier captures from retaining whole source strings while a compaction plan is cached. Add a GC retention regression for the owning producer.

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

* fix(workers): defer slow idle GC logging imports

Keep the slow-GC diagnostic behind its own lazy operation boundary so small workers do not eagerly evaluate the logging graph. Preserve collection thresholds and warning fields.

The existing production build gate reproduces 240 identity-worker modules on the base and passes at 203 after the repair (budget 220 unchanged). Full and sourcePerformance builds, 11 focused worker tests, infra typecheck, lint, and format checks pass. Independent native review found no actionable P0/P1/P2 findings; local autoreview was unavailable because Codex was not installed.

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

* fix: complete compaction wrapper inventory

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

---------

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 clawtributors PR from a clawtributor docs Improvements or additions to documentation extensions: codex P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants