Skip to content

fix(cloud): keep source packaging and worker teardown reliable - #136084

Merged
steipete merged 5 commits into
mainfrom
codex/cloud-session-stress-fixes-20260902
Sep 2, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/cloud-session-stress-fixes-20260902

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Source-built cloud sessions could fail while packing archives, and worker teardown could return before a heartbeat child settled or terminate legitimate provider cleanup too early. This follows the cloud-lifecycle refactor in #135583, the isolated-linking source-install repair in #135728, and provisioning cancellation on Stop in #133735.

Review and stress testing also exposed two connected shutdown bugs. On Windows, a timed-out graceful taskkill could kill the root while the forced helper still enumerated its descendants. At the service boundary, a cached strict-stop rejection made final Gateway shutdown skip its own cleanup grace; the opposite call order could suppress the strict deadline entirely.

Why This Change Was Made

The package owner streams archives through inherited file descriptors while preserving the caller's working directory. runPackageTar remains the single flow, with both default npm and explicit pnpm packing supported. Archive neighbors cannot supply tar's gzip executable, and native Windows paths do not pass through tar's remote-archive interpretation. There is no new resolver, archive-sized buffer, dependency, or fallback.

The Crabbox heartbeat owner keeps cancellation and settlement together. Stopped entries remain owned until their child settles, concurrent disposal joins that lifetime, and late inspection cannot restart the heartbeat. The Stop budget retains the supported 0.48.0 CLI's request, backoff, observation, and process-settlement allowances; the released-version distinction and tradeoff are documented below. No retries or configuration options were added.

Windows termination now has one fallback owner: root cancellation follows settlement of every started taskkill, including failed helpers. This removes result-shape inference and per-helper direct-root kills. Graceful and forced helpers still overlap; their timeouts are unchanged.

Plugin cleanup belongs to each service startup attempt, including failed starts. Callers share that once-only operation but keep their own wait policy. Both the service handle and its deferred Gateway wrapper stop caching the first caller's deadline. Strict replacement still fences capabilities and rejects after its existing five-second deadline; final shutdown can join pending cleanup within its separate existing grace. Public plugin start/stop signatures are unchanged.

The ACPX doctor detector loads runtime resources only when it has a session to inspect or migrate. Missing/empty-session tests exercise the public doctor contract with a runtime-load tripwire. No migration or stored representation changed.

The branch incorporates main through 8ea5c8f02b995ae052cbba7d22deee598159a9e2. Main's canonical command runner and tests supersede all three earlier helper-file changes (#136434, #136478, #135945); the duplicate collector and its incompatible unbounded pipe-drain test are removed. Main's dependency repair, Mac staging, and package-manager fixes remain intact. The archive validator stays selected alongside packaging in the first Windows CI shard, while the second shard retains main's new canonical command-helper coverage.

User Impact

Creation retains both package-manager routes. Reclaim and shutdown retain ownership of pending work without replaying cleanup or publishing a replacement early. Model authentication stays on the Gateway. No new configuration, dependency pin, SQLite schema, protocol version, runtime fallback, or production UI change is introduced. The Control UI regression uses the actual deletion acknowledgement.

Production and build-tool code decreases by 9 lines (+163/−172); regression tests and test support increase by 519 lines (+731/−212). Documentation adds two lines net; package-script metadata is line-neutral. The test table reuses the existing replacement suite and supersedes the old promise-identity test. There is no generated-code or lockfile growth.

Evidence

Candidate: 2eff0a2ceb874cd5beb3ece7774a44d168c425e5, tree 00729f29b773fa020f8716256326e5840306ac52.

Exact-candidate local validation passed on Node 24.20.0 / pnpm 12.1.0: frozen-lockfile install; 523 tests (479 owner tests across seven files, 41 canonical-helper tests, two CI-selection regressions, and one built-CLI SQLite lifecycle test). One helper test is native-Windows-only and was skipped on macOS. The normal pnpm build:package passed in 242.833s; the exact prebuilt SQLite lifecycle command passed in 68.036s using the current targeted plugins inspect openai --json preflight. Source, dependency pins, build stamps, and UI bytes remained unchanged, and task-owned temporary state was removed.

The changed-file gate also passed (format, lint, core/test types, dead exports, and repository guards). A complete 26-file structured Codex review found no P0–P2 findings, followed by a clean bounded review of the mechanical Windows-list resolution. All 25 non-package changed files stayed byte-identical through the rebase.

Exact-head CI run 33691964622 completed successfully on its first attempt, including the required openclaw/ci-gate. Both native Windows 2025 shards passed on Node 22.23.2: CI1 exercised archive validation (41 passed, 5 platform skips) and packaging (62 passed, 3 platform skips); CI2 exercised the 28 Windows termination regressions and real-process smoke. The execCommand parent/descendant smoke is in src/agents/sessions/exec.real.test.ts; the separate two-case exec.windows.integration.test.ts covers the agent-core process-tree utility, not the changed controller. No CI rerun was needed for this candidate.

Before repair, the retained regressions reproduced premature root termination, strict/ordinary wait interference in both call orders, dropped failed-start cleanup, the deferred-wrapper rejection, and premature final Gateway close. The same regression cases pass after repair. The service replacement test uses a real local child; deterministic Windows helper-ordering tests use the existing mocked process boundary. Neither is presented as live AWS proof or a universal successful Windows replacement within five seconds.

ClawSweeper follow-through: the unsafe per-helper root kill is removed, and the existing Windows CI2 selection includes the deterministic helper-failure regressions plus a real execCommand parent/descendant cleanup smoke test. The request to guarantee successful cleanup inside every five-second strict replacement window is not adopted: a stalled helper may exhaust that window, so replacement must reject and fence old capabilities. Final shutdown independently joins the still-owned cleanup; no deadline or assertion is weakened to turn that failure into success. The process smoke checks eventual PID extinction after resolution and is not represented as exact settlement-order proof.

No migration or upgrade fixture is applicable to these OpenClaw changes: persisted representations, configuration, plugin start/stop signatures, provider pins, and protocol shapes are unchanged. PluginServicesHandle is the internal orchestration owner, not a new plugin API. Released Crabbox CLI behavior is separately exercised in the coordinator wire proof below.

Earlier packaging red/green used unmodified GNU tar 1.35 and captured executable lookup from the archive directory. Earlier native Windows packaging and validation passed with npm and pnpm.cmd. The prior exact-head CI at 27d1e739 passed in run 33673206023. The later c9cd1291 manual run failed its merge-ref identity preflight, not tests: GitHub's merge ref still pointed at the previous head because three helper files conflicted with main. This rebase resolves those conflicts using main's canonical implementations. Earlier-head evidence is not substituted for the candidate's checks.

Released Stop contract: ClawSweeper follow-through

Retain the 1,005-second allowance for the still-supported Crabbox 0.48.0 contract. This is not the effective Stop budget of 0.48.1. OpenClaw's requirements do not require 0.48.1; narrowing the allowance to that release would silently strand supported installations.

Direct inspection of released commit 26b735abbaf6571d5f46620e07514b7ce9ff0d7b establishes these cancellation budgets:

Phase Released 0.48.0 contract
Initial and optional pre-cleanup Resolve 10 seconds each; the second occurs only for guarded guest cleanup with an SSH target.
Guest routing and cleanup 35 seconds combined, using remoteConnectionCleanupTimeout.
Release mutation Five 60-second attempts, with 2/4/6/8-second error backoffs: 320 seconds.
Admin release branch The same helper only after normal-release 401/404 and with configured admin credentials: up to another 320 seconds.
Pending cleanup observation A separate five-minute window; confirmed or retained releases return immediately.

The phase sum is 2*10 + 35 + 2*(5*60 + 20) + 300 = 995 seconds, plus OpenClaw's 10-second exit allowance. These are source-defined cancellation budgets, not a measured strict worst-case runtime; claim locking and local artifact finalization also exist. The OpenClaw process deadline remains bounded.

Crabbox 0.48.1 instead starts a shared five-minute context before explicit Stop's Resolve; observation inherits it. Its phases therefore do not add independently. OpenClaw does not extend that CLI-owned deadline or impose a minimum wait on successful Stop operations.

The operational tradeoff is explicit: the ordinary non-Machine0 destroy allowance increases from 16m20s to 28m05s when including the existing 660-second warm-image capture budget and two 10-second child-settlement allowances; with warm images disabled it is 17m05s. This keeps the lifecycle owner alive for valid older-CLI cleanup instead of abandoning it early. No retries, version-based runtime fork, configuration, or dependency minimum were added.

A retained real-binary red/green run used released 0.48.0 (44539a257aa51f885881aaf11f77ab800a48f72103e1072752f84dae3ab60a4e; version and unmodified Go VCS metadata bind it to the release commit above). Against a synthetic broker with a 35-second release response and cleanup completing at 320 seconds, the old 310-second deadline interrupted pending cleanup at 310.436s (exit 5); the expanded allowance let it finish normally at 321.501s (exit 0). The direct control completed at 321.498s. This used no cloud allocations or production credentials; it does not simulate every retry/admin maximum or establish 0.48.1 timing. These earlier-head observations supplement, rather than replace, the exact-head owner regressions and CI.

The review's data-model flag is not applicable: the only package.json change adds test/scripts/check-openclaw-package-tarball.test.ts to Windows CI1. No data schema, migration, persisted value, dependency, or operator configuration changes.

Cloud stress and upstream boundary

The original real AWS stress run failed. Its OpenClaw canary activated in 300.107s, ran a model-driven remote command without an explicit CWD, reconciled a file back to the Gateway, and reclaimed in 40.262s. The concurrent wave then hit the broker limit. Two accepted leases received clean release receipts, but the rejected fixed-ID candidate had no broker lease row and Stop returned 404. Forced Gateway termination and a post-driver process check also failed the run. A later read-only observation found no task processes; that does not turn the run into a pass or establish provider-side absence for the missing record.

The provider-owned repair is Crabbox #1749: cancellable fixed-ID creation before allocation. It is implemented under the approved persistent-lifecycle scope. Released 0.48.0 and 0.48.1 CLIs passed 84 checks against the actual local Worker/authentication/SQLite coordinator, including quota rejection → Stop, held preparation, restart, downgrade fencing, negative ownership checks, and normal cleanup. Its provider boundary is synthetic; this is not cloud-allocation proof.

A full repeated cloud/Codex/UI stress run remains unperformed: the upstream coordinator repair is not deployed, and the historical missing-record candidate still requires authoritative AWS inventory access. No quota increase, unrelated resource cleanup, or success-shaped handling of 404 was added. These upstream/operator prerequisites do not change the correctness of OpenClaw's package and process-ownership repairs, but the missing end-to-end proof remains an explicit limitation. The actual Control UI lifecycle recording is also still missing; the earlier readiness-only recording is not substituted for it.

Remaining named follow-ups: the existing Parallels escaped-pipe timeout fixture's readiness/clock control, the separate missing-base Git-fetch owner, and doctor discovery loading unrelated runtime graphs before phase filtering. This PR now covers the plugin-service final-shutdown grace rather than leaving it as a follow-up.

@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 docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts docker Docker and sandbox tooling extensions: crabbox size: L maintainer Maintainer-authored PR labels Sep 2, 2026
@steipete
steipete marked this pull request as ready for review September 2, 2026 07:02
@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: 🦪 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. 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, 7:28 PM ET / 23:28 UTC.

ClawSweeper review

What this changes

The PR makes cloud-worker teardown, plugin-service shutdown, source-package archive handling, ACPX Doctor detection, and Windows process termination more reliable.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open for normal maintainer landing review: current main still lacks the lifecycle ownership fixes, while the branch keeps cleanup with its producer across replacement and shutdown deadlines. Focused owner-boundary regressions and reported exact-head CI support the patch; the cited Crabbox release schedule could not be independently re-fetched because this reviewer environment cannot resolve GitHub.

Priority: P1
Reviewed head: 2eff0a2ceb874cd5beb3ece7774a44d168c425e5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused owner-boundary coverage and reported exact-head CI support a clean lifecycle repair, with external timeout-contract retrieval unavailable to this reviewer.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed production lifecycle owners are exercised by focused regressions using a real local heartbeat child and strict replacement path, and the supplied PR evidence reports exact-head CI plus a released Crabbox binary red/green timing scenario. The latter was not independently rerun because this read-only environment cannot reach GitHub.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production lifecycle owners are exercised by focused regressions using a real local heartbeat child and strict replacement path, and the supplied PR evidence reports exact-head CI plus a released Crabbox binary red/green timing scenario. The latter was not independently rerun because this read-only environment cannot reach GitHub.
Evidence reviewed 8 items Heartbeat cleanup ownership: The branch aborts and joins the retained heartbeat promise before removing its entry, and disposal joins all heartbeat entries.
Provider caller boundary: Lease stop, inspection loss, destruction, and provider disposal await heartbeat cleanup before releasing the worker lifecycle.
Plugin service cleanup ownership: Every issued service remains owned through cleanup, while individual stop callers use their own deadline around one memoized cleanup operation.
Findings None None.
Security None None.

How this fits together

Cloud workers and plugin services start local subprocesses and external worker resources for agent requests. Their lifecycle owners must settle those resources before replacement, shutdown, packaging, or diagnostics can safely proceed.

flowchart LR
  Request[Agent or service request] --> Worker[Cloud worker lifecycle]
  Worker --> Heartbeat[Heartbeat subprocess]
  Heartbeat --> Cleanup[Owner-managed cleanup]
  Cleanup --> Replacement[Replacement or shutdown]
  Package[Source package archive] --> Tar[Tar subprocess]
  Tar --> Release[Release validation]
Loading

Before merge

  • Resolve merge risk (P1) - The destroy allowance intentionally expands to as much as 1,005 seconds for supported Crabbox cleanup; this avoids premature abandonment but can delay replacement or shutdown. The branch cites the released 0.48.0 schedule, but independent upstream retrieval was unavailable in this review environment.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -17, Tests +519, Docs +2, Config 0, Other +8. Total +512 across 26 files.

View PR surface stats
Area Files Added Removed Net
Source 7 112 129 -17
Tests 14 731 212 +519
Docs 2 4 2 +2
Config 1 1 1 0
Generated 0 0 0 0
Other 2 51 43 +8
Total 26 899 387 +512

Review metrics

Metric Value Why it matters
Production vs test LOC production/tooling +163/-172 (net -9); tests/test support +731/-212 (net +519) The repair is net-negative in production/tooling while adding targeted lifecycle, archive, and platform regressions.

Stored data model

Persistent data-model change detected: migration/backfill/repair: package.json. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the supported cleanup window (recommended)
    Land with the documented 1,005-second ceiling so a supported worker cleanup sequence is allowed to settle rather than being abandoned early.

Technical review

Best possible solution:

Keep one owner-managed cleanup operation and allow replacement, shutdown, and inspection callers to apply their own bounded wait policy without abandoning that cleanup.

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

Yes for source-level reproduction: the ownership paths and regressions cover an active heartbeat or cleanup operation crossing strict replacement, final shutdown, and inspection loss. I did not execute tests in this read-only review.

Is this the best way to solve the issue?

Yes: retaining cleanup at the producing worker or service owner is preferable to sharing a caller's deadline or removing lifecycle state before an active subprocess settles.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production lifecycle owners are exercised by focused regressions using a real local heartbeat child and strict replacement path, and the supplied PR evidence reports exact-head CI plus a released Crabbox binary red/green timing scenario. The latter was not independently rerun because this read-only environment cannot reach GitHub.

Label justifications:

  • P1: Worker and service teardown faults can disrupt active cloud-agent replacement and shutdown.
  • merge-risk: 🚨 availability: The PR changes subprocess cleanup and lifecycle timing, which can affect whether shutdown or replacement completes promptly.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production lifecycle owners are exercised by focused regressions using a real local heartbeat child and strict replacement path, and the supplied PR evidence reports exact-head CI plus a released Crabbox binary red/green timing scenario. The latter was not independently rerun because this read-only environment cannot reach GitHub.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production lifecycle owners are exercised by focused regressions using a real local heartbeat child and strict replacement path, and the supplied PR evidence reports exact-head CI plus a released Crabbox binary red/green timing scenario. The latter was not independently rerun because this read-only environment cannot reach GitHub.

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)

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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-02T16:52:45.933Z sha aaa4b7d :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:13:45.293Z sha aaa4b7d :: needs changes before merge. :: [P1] Keep heartbeat disposal within the strict reload deadline
  • reviewed 2026-09-02T19:35:14.774Z sha 27d1e73 :: found issues before merge. :: [P1] Bound heartbeat cleanup to the replacement deadline
  • reviewed 2026-09-02T20:48:55.576Z sha c9cd129 :: found issues before merge. :: [P1] Bound heartbeat cleanup to the strict replacement deadline
  • reviewed 2026-09-02T21:56:06.039Z sha c9cd129 :: blocked before merge. :: [P1] Keep heartbeat disposal within the strict replacement deadline
  • reviewed 2026-09-02T22:29:27.766Z sha c9cd129 :: blocked before merge. :: [P1] Bound heartbeat cleanup within the replacement deadline
  • reviewed 2026-09-02T22:59:49.527Z sha 2eff0a2 :: blocked before merge. :: none
  • reviewed 2026-09-02T23:13:45.608Z sha 2eff0a2 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. P2 Normal backlog priority with limited blast radius. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 2, 2026
steipete added a commit that referenced this pull request Sep 2, 2026
Share dependency-free executable lookup with pnpm while preserving its
launcher behavior. Resolve native tar before changing archive directories,
including Windows native executables and Unix default/relative PATH rules.

Use one validator tar flow with drive-safe and colon-safe archive operands
and normalized Windows directory arguments. Preserve listing limits,
extraction cleanup, frozen-source packaging, and strict artifact checks.

Cover caller-relative lookup, missing PATH, neighboring Windows tar.exe,
real isolated package validation, and copied Mac harness dependencies.

Refs: #136084
@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 force-pushed the codex/cloud-session-stress-fixes-20260902 branch from c282def to 1f02943 Compare September 2, 2026 15:34
Keep complete UTF-8 CLI stdout and wait for stdio closure instead of
applying the Gateway diagnostic tail to machine-readable results. Preserve
bounded diagnostic logs, exact child environments, and owned deadlines.
Include bounded CLI diagnostics when the built artifact proof fails.

Defer ACPX resource helpers behind the existing empty-record boundary so
Doctor does not load the runtime graph when there is nothing to migrate.
Move empty-state cases to the public doctor entrypoint; keep record, lease,
archive, and recovery semantics unchanged.

Verify real-child red/green regressions, 39 helper tests, 20 ACPX tests, and
the original 18-file/194-case Doctor execution order. The real built CLI
returns 297849 bytes for 151 plugins; the original helper truncates that
JSON while the fixed helper matches direct capture byte for byte.

Refs #136084
Share each service cleanup operation without sharing a caller's deadline.
Retain failed-start cleanup for final Gateway shutdown and keep deferred
service handles from replaying an expired strict-stop result.

Join all Windows taskkill helpers before canceling the root, so a timed-out
helper cannot kill the parent while its sibling enumerates descendants.
Preserve existing deadlines, capability fencing, and once-only cleanup.
@steipete
steipete force-pushed the codex/cloud-session-stress-fixes-20260902 branch from c9cd129 to 2eff0a2 Compare September 2, 2026 22:45
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated to 2eff0a2ceb874cd5beb3ece7774a44d168c425e5: fixed the Windows helper/root-cancellation race, repaired per-service cleanup ownership across strict replacement and final Gateway shutdown, and resolved main conflicts while preserving both Windows test selections. The PR body now records the removed paths, production-versus-test LOC, compatibility scope, and the explicit cloud stress limitations.

The complete source review and owner regressions passed. Exact-head CI and the fresh local build checks are in progress; this is not a claim that those pending gates or the repeated cloud stress run passed.

@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

The final timing/rank-up request is now verified directly against both released Crabbox sources, with the version distinction recorded in the PR body.

Retain 1,005 seconds for supported 0.48.0, not because 0.48.1 needs that duration. In 0.48.0, Resolve is 10s per call, optional guest cleanup is 35s, each release branch allows five 60s attempts plus 20s backoff, and pending observation has its own five-minute window. The admin branch is conditional on configured admin credentials and a final normal-release 401/404. The source-defined phase sum is 995s plus OpenClaw's 10s exit allowance; it is not a measured strict worst-case wall-clock bound.

By contrast, 0.48.1 starts one shared five-minute context before Resolve, inherited by observation. The larger OpenClaw allowance neither overrides that cancellation nor delays an early successful exit. It preserves the documented older-CLI support instead of forcing an unrequested minimum-version change. Including existing warm capture and child settlement, the ordinary non-Machine0 destroy allowance is 28m05s (17m05s with warm images disabled).

The retained 0.48.0 binary's SHA/version/VCS metadata match the released source. With a synthetic delayed-success broker, the old 310s owner killed pending cleanup at 310.436s; the revised owner returned exit 0 at 321.501s. That is real CLI/process proof, not AWS allocation proof or a full worst-case timing test.

The data-model flag is a false positive: package.json only adds the archive-validator test to Windows CI1; no schema, migration, stored representation, dependency, or config change exists. Exact head 2eff0a2ceb874cd5beb3ece7774a44d168c425e5 has 523 passing local tests, a successful normal package build and built-CLI lifecycle test, clean structured review, and green required CI. The original failed cloud stress and still-unavailable repeated cloud/UI proof remain explicitly recorded rather than called successful.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 2, 2026
@steipete
steipete merged commit c657918 into main Sep 2, 2026
282 checks passed
@steipete
steipete deleted the codex/cloud-session-stress-fixes-20260902 branch September 2, 2026 23:32
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit to openclaw/crabbox that referenced this pull request Sep 3, 2026
Record fixed-ID creation at the coordinator admission owner before preparation or quota checks, and let Stop cancel that exact owner/org/provider-bound attempt before allocation. Preserve the cancellation across restart and duplicate replay, including the post-reservation race, without inventing a lease row or treating unknown IDs as released.

Reuse the existing attempt lifecycle and remove duplicate reservation construction. Version-2 fixed admissions stay fenced on older coordinators; confirming pre-allocation Stop after rollback requires upgrading the coordinator again. Canonical IDs never fall back to friendly-name lookup.

Keep the Go checkpoint contracts and race detector intact while allowing fixture-isolated cases to run in parallel. No timeout, dependency, configuration, SQLite schema, or CLI release change.

Verified: 2,069 Worker tests; released 0.48.0/0.48.1 CLI-to-authenticated-coordinator/SQLite proof (18 commands, 84 checks, synthetic provider boundary); exact-head CI 33694862559 with all 11 jobs successful; structured Codex reviews. Full live AWS stress remains separate from this coordinator proof.

Related: #1561
Related: openclaw/openclaw#136084
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…law#136084)

* fix(cloud): join worker cleanup and stream package archives

* test(ci): cover package validation on Windows

* fix(ci): preserve CLI output and defer empty ACPX runtime loads

Keep complete UTF-8 CLI stdout and wait for stdio closure instead of
applying the Gateway diagnostic tail to machine-readable results. Preserve
bounded diagnostic logs, exact child environments, and owned deadlines.
Include bounded CLI diagnostics when the built artifact proof fails.

Defer ACPX resource helpers behind the existing empty-record boundary so
Doctor does not load the runtime graph when there is nothing to migrate.
Move empty-state cases to the public doctor entrypoint; keep record, lease,
archive, and recovery semantics unchanged.

Verify real-child red/green regressions, 39 helper tests, 20 ACPX tests, and
the original 18-file/194-case Doctor execution order. The real built CLI
returns 297849 bytes for 151 plugins; the original helper truncates that
JSON while the fixed helper matches direct capture byte for byte.

Refs openclaw#136084

* test(cloud): verify strict service replacement joins heartbeat cleanup

* fix: retain cleanup ownership across shutdown deadlines

Share each service cleanup operation without sharing a caller's deadline.
Retain failed-start cleanup for final Gateway shutdown and keep deferred
service handles from replaying an expired strict-stop result.

Join all Windows taskkill helpers before canceling the root, so a timed-out
helper cannot kill the parent while its sibling enumerates descendants.
Preserve existing deadlines, capability fencing, and once-only cleanup.
steipete added a commit that referenced this pull request Sep 3, 2026
Give initialization, scheduled discovery, manual checkout refresh, and
pre-handoff update work one abort-and-join lifecycle owner. Propagate
cancellation through owned Git commands while keeping temporary-worktree
cleanup independent, and keep automatic maintenance inside the process tree
on both current and older Git versions. Remove duplicate refresh ownership
and separate timers; leave managed-service handoff with its existing owner.

Cloud stress exposed the shutdown tail while investigating #136084. Verified
502 focused tests, real held-fetch cancellation, temporary-worktree cleanup,
and native Git 2.43 foreground maintenance. Full cloud stress follows the
fresh committed build; no pass is claimed here.

Refs #137071
steipete added a commit that referenced this pull request Sep 3, 2026
Join update discovery and native-auth preparation before shared Gateway
teardown. Capture scoped positive and negative auth facts before handing work
to catalog workers, while retaining the synchronous plugin hook contract.

Use generation-owned workspace allocations for remote skill inputs, derive
one location for writes and mounts, and keep the private marker until payload
cleanup succeeds. Surface bootstrap network and cleanup failures explicitly.

Retain ownership through cancelled Git worktree creation and independent
managed-update handoff. No configuration, database, or protocol changes.

Refs: #137071, #136084, #136995.
steipete added a commit that referenced this pull request Sep 3, 2026
* fix(gateway): own cloud startup and teardown resources

Join update discovery and native-auth preparation before shared Gateway
teardown. Capture scoped positive and negative auth facts before handing work
to catalog workers, while retaining the synchronous plugin hook contract.

Use generation-owned workspace allocations for remote skill inputs, derive
one location for writes and mounts, and keep the private marker until payload
cleanup succeeds. Surface bootstrap network and cleanup failures explicitly.

Retain ownership through cancelled Git worktree creation and independent
managed-update handoff. No configuration, database, or protocol changes.

Refs: #137071, #136084, #136995.

* test(auth): align OAuth fixture with async synthetic lookup

Preserve the no-refresh assertions while following the async absence contract. Reproduced two missing-export failures before the one-line fixture repair; all 209 owning and sibling tests plus the changed-file gate pass.

Refs: #137071.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: crabbox gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

1 participant