Skip to content

fix(test): wait for complete CLI output before returning - #136286

Merged
steipete merged 2 commits into
mainfrom
codex/test-perf-sixth-cli-output-close
Sep 2, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-perf-sixth-cli-output-close

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

The CLI test fixture could report completion while a descendant still held inherited output. Its executor intentionally releases pipes after a bounded post-exit drain, but fixture cleanup must retain uncertain resources. Reuse the existing managed-process owner for completion, timeout and cancellation. Admit each complete CLI operation before entrypoint preparation yields, drain admitted commands before Gateway shutdown, retain unjoined-work errors and failed cleanup, and reject new work after ownership becomes uncertain.

Preserve main's structured-output and environment contracts: shared capture utilities retain stdout from the beginning up to the existing 16 MiB limit and reject overflow; stderr and Gateway diagnostics remain bounded to 256 KiB. Pass the complete isolated environment directly. Preserve the managed error cause and timeout diagnostic precedence. Log capacity belongs to its constructor, including truthful truncation markers and exact-cap writes. Terminal cleanup retains main's forced Windows Gateway-tree termination. Main independently landed the SQLite proof diagnostics in #136478, so the duplicate edit is removed from this PR.

Native Windows exposed a separate defect in the newly inherited delayed-output test. In CI 33683282504, Windows job 100424910751, its non-detached child was terminated when the leader exited: the drain case returned only the leader's output. The other 36 owner cases passed and five platform-specific cases skipped. The repair shares one inherited-writer producer between stdout and stderr cases, uses Windows-only detached spawning, retains the writer PID, and releases the existing HTTP gate only after observing leader death. Cleanup releases gates, joins commands, then joins writers before deleting state. The fixed 50 ms sleep is removed; all 42 case identities, complete-output checks and the zero-retained-timer oracle remain.

The original ownership defect also has failing native and real-process evidence. The native retained-writer baseline established an exited leader, live detached writer and open inherited stderr before the missing retained claim failed; external rescue joined the writer and verified closure/state removal. On exact main fc895e4, all 37 ordinary helper cases passed, but a private held-writer probe showed premature command completion. The managed owner passed that same observation and captured the complete output after release. Those resources were joined and temporary roots removed.

Current head is 3794eb1, based on main 3f3ab5c. The final local helper suite passes 41 cases with one native-Windows skip out of 42; its source guards remain unchanged and temporary root is empty and removed. Typed lint passes. Independent source review found no actionable findings; a fresh committed-head Codex P0 review is scoped-clean, explicitly limited to P0. Final scope: seven test/support/tooling/metadata files, +672/-85; production +0/-0. No speedup is claimed for this lifecycle repair.

The current revision has passed both platform checks requested by the latest ClawSweeper review and its Rank-up moves. Native Windows job 100431504957 passes 37 cases with five unchanged platform skips out of 42 on Node 22.23.2/pnpm 12.1.0. All case names and order match the failed before-run; the only status change is the drain case from failed to passed. Complete/overflow JSON, delayed stderr and the native retained-writer/verified-rescue case also pass. Linux built-artifact job 100431504703 passes the complete built-CLI SQLite lifecycle on Node 24.19.0/pnpm 12.1.0. Both actual logs identify tested merge d9c81551b5b16a600bb8f0be0ddb4b2d52b5ab38; all 42 inspected source/runner guards are byte-identical to the published head. CI 33685294460 attempt 1 completed successfully on this exact head at 21:49:03 UTC. Earlier green runs are historical evidence.

Ordinary stream closure does not certify detached descendants that have closed their pipes. Direct entrypoint preparation retains its existing shared API outside CLI admission. Canonical timeout cleanup can outlast the formerly ignored 1.5-second close wait.

Follow-up: concurrent Control UI asset pruning can remove both older generations. Linux job 100424918574 observed two retained generations where three were expected. A single controlled real-filesystem probe on unchanged code reproduced that result: recursive deletion removed a victim's manifest, changing directory mtime while preserving its inode; another inventory reused stale verification by inode, promoted the partially removed directory and evicted the intact old survivor. Both new assets remained readable. This establishes a matching real defect; the CI job did not retain the operation trace needed to certify its exact interleaving. The follow-up belongs to the verified-record reuse and refresh metadata in src/gateway/control-ui-asset-retention.ts. Its repair must preserve the existing bounded-read contract; a bare mtime guard would rehash assets because publication currently returns metadata from before its own timestamp refresh. Full proof and cleanup receipts are retained for that follow-up; the retention oracle is unchanged.

Two earlier intermittent failures also remain named follow-ups: browser control-server startup lacked its actual startup/listener evidence, and a plugin-security RSS check lacked its process-snapshot result. Their causes remain unresolved. An unchanged 42-case macOS browser run passed in the original order, which does not explain the earlier Linux refusal. No retry, timeout or assertion was weakened.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 2, 2026, 5:36 PM ET / 21:36 UTC.

ClawSweeper review

What this changes

The PR makes the test-instance command helper own command completion and inherited output draining through cleanup, adds native Windows coverage, and routes the affected tests to Windows CI.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the managed command lifecycle repair is not on current main and no introduced defect was found, but exact-head native Windows and built-CLI lifecycle validation remain required before merge.

Priority: P2
Reviewed head: 3794eb16ea6e3856be62ff8a9ff4100fe691e7a4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch follows the existing managed-process ownership boundary and has focused regression coverage, with exact-head platform validation still required.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned internal test-helper change has focused behavioral coverage; exact-head native Windows and built-CLI validation remain a merge gate rather than external user-flow proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned internal test-helper change has focused behavioral coverage; exact-head native Windows and built-CLI validation remain a merge gate rather than external user-flow proof.
Evidence reviewed 6 items Command ownership and cleanup: The introduced helper admits CLI work before asynchronous preparation, closes command admission during cleanup, settles tracked work before Gateway shutdown, and retains unjoined-work failures.
Managed-process completion contract: Normal managed-command completion is driven by the child close event, after output streams close; claims release only after that completion path.
Focused lifecycle coverage: The introduced tests cover delayed inherited stdout and stderr after leader exit, plus native Windows retention and verified external cleanup, using observed state rather than fixed sleeps.
Findings None None.
Security None None.

How this fits together

OpenClaw’s test-instance helper launches CLI and Gateway processes for lifecycle tests, then owns their output capture, deadlines, and cleanup. Its results feed built-CLI and platform CI proofs that verify process teardown without deleting state prematurely.

flowchart LR
  A[Lifecycle test] --> B[Test-instance helper]
  B --> C[Managed CLI process]
  C --> D[Output pipes]
  C --> E[Cleanup coordinator]
  D --> E
  E --> F[Windows process cleanup]
  E --> G[State removal or diagnostics]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head native Windows and built-CLI lifecycle results are still pending, so a platform-only process-cleanup or output-drain failure could remain undiscovered.
  • Complete next step (P2) - Obtain exact-head native Windows and built-artifact lifecycle results covering the introduced helper path before merge.
Agent review details

Security

None.

PR surface

Tests +581, Config 0, Other +6. Total +587 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 665 84 +581
Docs 0 0 0 0
Config 1 1 1 0
Generated 0 0 0 0
Other 2 6 0 +6
Total 7 672 85 +587

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; tests/test support +665/-84; CI/tooling metadata +7/-1 The branch changes test lifecycle coverage and CI routing rather than runtime product code.

Merge-risk options

Maintainer options:

  1. Complete platform lifecycle proof (recommended)
    Run exact-head native Windows and built-CLI lifecycle checks that exercise the introduced command cleanup and inherited-output path before merging.

Technical review

Best possible solution:

Merge after exact-head native Windows and built-CLI lifecycle runs confirm inherited output drains and verified cleanup retain or remove state as intended.

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

Yes, from source: the prior helper path did not keep pending CLI work under cleanup ownership, and the added tests model leader exit while inherited output remains open; this read-only review did not execute the failing path.

Is this the best way to solve the issue?

Yes: reuse of the existing managed-process owner centralizes command completion, output draining, process cleanup, and deadline handling rather than adding a parallel helper lifecycle path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 automation: The patch changes Windows test routing and process-lifecycle test behavior, so incomplete platform validation could leave CI failures or hangs.
  • remove merge-risk: 🚨 availability: Current PR review merge-risk labels are merge-risk: 🚨 automation.

Label justifications:

  • P2: This is a bounded test-infrastructure reliability repair without a reported runtime user outage.
  • merge-risk: 🚨 automation: The patch changes Windows test routing and process-lifecycle test behavior, so incomplete platform validation could leave CI failures or hangs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned internal test-helper change has focused behavioral coverage; exact-head native Windows and built-CLI validation remain a merge gate rather than external user-flow proof.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain exact-head native Windows and built-CLI lifecycle results covering the introduced helper path.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-02T16:43:27.822Z sha 6c89a1a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:11:29.169Z sha 6c89a1a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:36:15.522Z sha bab0e0c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:51:24.282Z sha bab0e0c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T19:41:11.763Z sha fc52f8e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T20:24:50.949Z sha fc52f8e :: needs changes before merge. :: [P2] Fail oversized structured stdout instead of returning a successful tail
  • reviewed 2026-09-02T20:39:56.392Z sha 2d9dec22415bd01ac3d94f35fc9754bfb241b812 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T21:14:59.962Z sha 8c06d38 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M and removed size: XS labels Sep 2, 2026
steipete added a commit that referenced this pull request Sep 2, 2026
Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by #136286. CI follow-through for #136036.
@steipete
steipete force-pushed the codex/test-perf-sixth-cli-output-close branch from c6b2db2 to ae048cd Compare September 2, 2026 14:53
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head be3c729 preserves structured CLI stdout within a separate 1 MiB bound after the current built inventory exceeded the diagnostic tail. The PR body includes the reproduced failure, exact artifact before/after results, finite-overflow regression, and the prior native Windows managed-owner proof. Fresh final-head CI is still required before landing.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the codex/test-perf-sixth-cli-output-close branch from be3c729 to e8bc345 Compare September 2, 2026 16:12
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

The reviewed stdout revision now passes native Windows: 34 owner cases passed with five platform-specific skips, including large structured output and the retained-writer/rescue scenario. The Linux built-CLI SQLite lifecycle also passed. Both job links and tested-source parity are in the PR body.

CI exposed an additional corner-shape assertion mismatch. The final commit compares the standard computed value, normalizing only round to superellipse(1). Real Chrome 152 reproduced two failures before the change and passed all three cases afterward; Chrome 151 passed all three before and after. All geometry, excluded surfaces and root tokens remain checked. Independent source review, Codex P0 review, formatting and typed lint are clean. Final-head required CI remains the landing gate.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 2, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Rebased head bab0e0c9c3a0bdad488ea8bc6d0630de04736b1e preserves the reviewed seven-commit series.

Range-diff maps all commits one-for-one. Six are patch-identical; the only adapted hunk carries the existing bounded stdout/stderr failure diagnostics onto main's newer plugins inspect openai --json precheck. The changed file set and LOC totals remain identical, and no behavioral conflict was introduced.

Post-rebase focused verification passed through the native review wrapper:

  • test/helpers/openclaw-test-instance.test.ts
  • src/scripts/ci-changed-scope.windows.test.ts
  • ui/src/styles/corner-shape.browser.test.ts

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

steipete added a commit that referenced this pull request Sep 2, 2026
Refresh against authenticated comparison-base checkout on main. Reuse the
reviewed corner serialization, CLI fixture, and queue-depth test repairs
from #136286, #136469, and #136434.
steipete added a commit that referenced this pull request Sep 2, 2026
Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by #136286. CI follow-through for #136036.
steipete added a commit that referenced this pull request Sep 2, 2026
Reuse the reviewed Gateway process-fixture cleanup from 667ce2b (PR #136469) to remove repeated configuration setup without changing assertions, timeouts, child invocations, or values.

Align the equivalent corner-shape normalization with 6c89a1a (PR #136286) so the shared CI repairs integrate without conflicting spellings. No production behavior changes.
@steipete
steipete force-pushed the codex/test-perf-sixth-cli-output-close branch 2 times, most recently from fc52f8e to 2d9dec2 Compare September 2, 2026 20:32
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Integrated the new main CLI output/environment changes with the managed lifecycle owner after a verified merge conflict. The new main held-writer probe fails before the repair and passes after; the integrated 40-case local suite and typed lint pass. Please review head 2d9dec22415bd01ac3d94f35fc9754bfb241b812. Fresh native Windows and built-artifact CI remain required before landing.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@steipete
steipete force-pushed the codex/test-perf-sixth-cli-output-close branch from 2d9dec2 to 8c06d38 Compare September 2, 2026 21:06
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review head 3794eb1. Main conflict integration preserves forced Windows terminal cleanup and removes the duplicate SQLite diagnostic edit. Native Windows then proved the inherited drain fixture lost child output. Its repair now shares the existing gated writer and PID cleanup, releasing output after observed leader exit, with all 42 cases and their output/deadline assertions retained. Full local helper tests, typed lint, independent source review and scoped Codex P0 review pass. Fresh CI 33685294460, native Windows after-proof and the complete built-CLI lifecycle remain required before landing. The separately reproduced asset-cache pruning defect is documented as a named follow-up in the body.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

steipete added a commit that referenced this pull request Sep 2, 2026
Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by #136286. CI follow-through for #136036.
@steipete
steipete merged commit 717d9c5 into main Sep 2, 2026
261 checks passed
@steipete
steipete deleted the codex/test-perf-sixth-cli-output-close branch September 2, 2026 21:52
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 2, 2026
Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by #136286. CI follow-through for #136036.
steipete added a commit that referenced this pull request Sep 3, 2026
Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by #136286. CI follow-through for #136036.
steipete added a commit that referenced this pull request Sep 3, 2026
* fix(gateway): honor Full Access for delegated OpenClaw changes

Use the requesting run’s effective permission policy to authorize exact delegated proposals without an extra operator card. Preserve restricted approvals and late run/worker guards, and discard canceled proposals before a later turn can execute them.

Fixes #136032. Covers default and explicit Full Access with actual isolated Gateway config persistence, proposal-route regressions, and cancellation ordering.

* test(qa): include delegation proof in E2E ownership inventory

* fix(setup): retain scoped runtime artifacts during verification

Preserve the requesting registry’s built/source selection when loading fresh inference-owner metadata. Otherwise a healthy built Gateway probe is revalidated against source TypeScript and rejected as plugin artifact drift.

Discovered and reproduced with live Codex while validating #136036. Keep exact artifact/auth guards and standalone source defaults unchanged; cover both contextual selection modes.

* docs(gateway): align delegated change approval guidance

* fix(gateway): bind delegated proposals to their requesting run

Reconcile foreign and terminal proposals before routing new input, preserve exact live approval ownership, and clear executable state even if approval cancellation fails. A concurrent Full Access read must never apply another run's pending write. Keep model-facing summaries policy-neutral. Covers live and closed run boundaries, storage failure, worker claim reuse, and rendered prompts for #136032.

* test(gateway): admit delegated session ownership fixture

Use a real live run claim for the cross-connection delegation assertion, release it in finally, and verify the retained caller cannot invoke the engine after closure. Keep the production authority guard intact.

* fix(gateway): join metadata work before shutdown

Give every Gateway lifetime a metadata stop owner, including lazy minimal-Gateway preparation. Close new work through the existing generation fences and join pending readers, refreshes, commands and projections before model/config teardown.

The minimal and ordinary lifecycle regressions fail before this repair; 68 focused tests, full changed checks and fresh P0 autoreview pass. Found during real-Gateway validation for #136036. The broader pre-entry RPC shutdown gap remains separate; no timeout, logger, schema or dependency policy is weakened.

* test(ui): isolate pairing help navigation from live docs

Own the popup document through an exact BrowserContext route before clicking. Preserve the real popup, secure target/rel, focus and credential-lifecycle assertions; check the full anchored destination and controlled response.

CI33632492208 stalled waiting for the external page load after opening pairing help. The live canonical URL is valid. Four focused browser tests, scoped checks and fresh P0 review pass; production behavior and timeouts are unchanged.

* fix(gateway): retire failed delegated proposals before reuse

Retire exact session approval ownership, its record and the engine proposal through one cleanup owner. Cover failures before resolver entry and registration as well as application, retaining delayed cleanup inside the serialized task so it cannot cancel a later same-hash proposal.

Real handler/run regressions fail before the repair: a closed run's unregistered proposal was executed by the next Full Access read, and a real database-open failure retained a partial approval owner. The fix passes 174 focused/sibling tests, scoped checks and fresh P0 review. Follow-through for #136036; no configuration, schema or protocol change.

* test: preserve complete CLI output before parsing

Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by #136286. CI follow-through for #136036.

* test: separate refusal ordering from deadline policy

Keep native startup, inherited stderr, retry state, and cleanup real while controlling policy time in the positive refusal table. A 1250ms fixture delay reproduced SIGTERM instead of status 1 under the unchanged 1000ms budget; the repaired table passes with the same delay. Dedicated readiness and drain expiry cases still enforce their deadlines.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…6286)

* fix(test): retain managed CLI ownership through output closure

* test: gate inherited CLI output until its leader exits
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…law#136036)

* fix(gateway): honor Full Access for delegated OpenClaw changes

Use the requesting run’s effective permission policy to authorize exact delegated proposals without an extra operator card. Preserve restricted approvals and late run/worker guards, and discard canceled proposals before a later turn can execute them.

Fixes openclaw#136032. Covers default and explicit Full Access with actual isolated Gateway config persistence, proposal-route regressions, and cancellation ordering.

* test(qa): include delegation proof in E2E ownership inventory

* fix(setup): retain scoped runtime artifacts during verification

Preserve the requesting registry’s built/source selection when loading fresh inference-owner metadata. Otherwise a healthy built Gateway probe is revalidated against source TypeScript and rejected as plugin artifact drift.

Discovered and reproduced with live Codex while validating openclaw#136036. Keep exact artifact/auth guards and standalone source defaults unchanged; cover both contextual selection modes.

* docs(gateway): align delegated change approval guidance

* fix(gateway): bind delegated proposals to their requesting run

Reconcile foreign and terminal proposals before routing new input, preserve exact live approval ownership, and clear executable state even if approval cancellation fails. A concurrent Full Access read must never apply another run's pending write. Keep model-facing summaries policy-neutral. Covers live and closed run boundaries, storage failure, worker claim reuse, and rendered prompts for openclaw#136032.

* test(gateway): admit delegated session ownership fixture

Use a real live run claim for the cross-connection delegation assertion, release it in finally, and verify the retained caller cannot invoke the engine after closure. Keep the production authority guard intact.

* fix(gateway): join metadata work before shutdown

Give every Gateway lifetime a metadata stop owner, including lazy minimal-Gateway preparation. Close new work through the existing generation fences and join pending readers, refreshes, commands and projections before model/config teardown.

The minimal and ordinary lifecycle regressions fail before this repair; 68 focused tests, full changed checks and fresh P0 autoreview pass. Found during real-Gateway validation for openclaw#136036. The broader pre-entry RPC shutdown gap remains separate; no timeout, logger, schema or dependency policy is weakened.

* test(ui): isolate pairing help navigation from live docs

Own the popup document through an exact BrowserContext route before clicking. Preserve the real popup, secure target/rel, focus and credential-lifecycle assertions; check the full anchored destination and controlled response.

CI33632492208 stalled waiting for the external page load after opening pairing help. The live canonical URL is valid. Four focused browser tests, scoped checks and fresh P0 review pass; production behavior and timeouts are unchanged.

* fix(gateway): retire failed delegated proposals before reuse

Retire exact session approval ownership, its record and the engine proposal through one cleanup owner. Cover failures before resolver entry and registration as well as application, retaining delayed cleanup inside the serialized task so it cannot cancel a later same-hash proposal.

Real handler/run regressions fail before the repair: a closed run's unregistered proposal was executed by the next Full Access read, and a real database-open failure retained a partial approval owner. The fix passes 174 focused/sibling tests, scoped checks and fresh P0 review. Follow-through for openclaw#136036; no configuration, schema or protocol change.

* test: preserve complete CLI output before parsing

Keep finite command results separate from bounded Gateway diagnostics. The Linux artifact proof emitted valid plugin JSON above256KiB; reusing the log tail corrupted that successful result. Preserve bounded timeout diagnostics and report actual inventory-command failures.

Real UTF-8 child regression fails before the change;56 helper and sibling tests, scoped checks, and independent P0 review pass. CLI exit/close lifetime work remains separately owned by openclaw#136286. CI follow-through for openclaw#136036.

* test: separate refusal ordering from deadline policy

Keep native startup, inherited stderr, retry state, and cleanup real while controlling policy time in the positive refusal table. A 1250ms fixture delay reproduced SIGTERM instead of status 1 under the unchanged 1000ms budget; the repaired table passes with the same delay. Dedicated readiness and drain expiry cases still enforce their deadlines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants