Repository navigation
fix(workers): stop workspace transfers after caller authority closes - #159087
roboclaw-bot merged 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 5:40 PM ET / 21:40 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch carries live caller checks through worker tunnel startup, node and SSH workspace operations, and HTTP transfer tokens, and adjusts session snapshot test cleanup. Merge readiness✅ Ready for maintainer review Current main still has the caller-authority gap in worker transfers. This PR addresses a distinct part of the broader open worker-authority work, and this review found no concrete introduced blocker. Priority: P1 Review scores
Verification
How this fits togetherGateway worker placement sends delegated sessions to node or SSH environments and prepares their remote workspaces. The transfer service moves workspace files through short-lived HTTP capabilities, after which reconciliation returns accepted changes to the session. flowchart LR
A[Session dispatch] --> B[Caller and placement authority]
B --> C{Still current?}
C -->|No| D[Reject effect]
C -->|Yes| E[Worker tunnel and transport]
E --> F[Workspace transfer]
F --> G[Remote workspace and accepted result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +205, Tests +1146. Total +1351 across 33 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep effect-time authorization with the Gateway's transport and transfer owners while leaving accepted reconciliation and cleanup under their independent owners. Do we have a high-confidence way to reproduce the issue? Yes. Current main lacks the caller check at upload admission, and the contributor reports focused baseline failures for injected caller closure. This review did not execute the tests. Is this the best way to solve the issue? Yes. Carrying the existing live authority to the final transport and transfer checks is a narrow repair that preserves separate ownership of accepted work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 047c88d1337e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
Preserve reviewed transport authority and snapshot cleanup on current main, including the landed updater fixture repair. Co-authored-by: sallyom <[email protected]> Co-authored-by: vincentkoc <[email protected]>
e952c7c to
83921e1
Compare
|
Merged via squash.
|
…penclaw#159087) Carry the initiating caller's live authority through node and SSH startup, repository preparation, and workspace-transfer effects. Preserve independent custody of accepted work and join upload revocation with receiver disposal. Await snapshot fixture database resources before deleting their temporary root. No public protocol, configuration, or database-schema migration. Reviewed head: 83921e1 Public CI: https://github.com/openclaw/openclaw/actions/runs/36273289390 Independent ClawSweeper review: no actionable findings; Before merge: None. Related: openclaw#135838 Work sessions: - Original discussion with @sallyom: https://team.openclaw.ai/chat/roboclaw/dashboard/70f8933b-db6b-4809-b9a8-941957263614 - Implementation and verification: https://team.openclaw.ai/chat/roboclaw/~key/subagent/27f4f8cb-1fd1-445b-b7d2-72a4b73fa8f1 Co-authored-by: sallyom <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Related: #135838
Additional instructions
Allow edits from maintainers remains enabled.
What Problem This Solves
Fixes an issue where cancelling or replacing a delegated request could still allow tunnel startup, workspace synchronization, or repository transfer after the caller's authority ended.
Why This Change Was Made
Carry the existing composed caller guard through node and SSH startup, repository preparation, and transfer effects. Keep established tunnel/workspace custody independent of the initiating request. Upload revocation joins the existing disposal owner, and reconciliation takes completed-upload custody before revocation; transfer options retain the existing ten-minute budget.
User Impact
Contributor credit: @sallyom and @vincentkoc.
Work sessions
Evidence
Current refreshed source
Current head 83921e1 is based on main 19c6ef8, incorporating the already-landed updater fixture repair #159127. No duplicate updater fix is added. All 32 nonrouting feature blobs match the preceding reviewed head, including snapshot cleanup; the routing file preserves main's additional Cron registration.
Fresh bounded validation passed normal hooks, format, targeted typed lint and four ratchets, plus all 29 planned files: 385 transport cases (44 focused + 341 siblings), 33 snapshot cases and the updater wrapper asserting 19 native cases with zero failures/skips. That is 419 Vitest cases, with the 19 native cases nested under one wrapper—not extra Vitest cases. No full build/typecheck or live-operator run is claimed by this bounded recipe. Artifact 10916347002, actual commit/parent/tree/patch and both human trailers were independently verified before publication.
The prior public updater failure was introduced in main's strict test fixture, before restart verification; its missing dependency facts are fixed by the upstream commit incorporated here. Earlier failed public runs remain failed historical evidence. Fresh public exact-head CI and review are still required before landing. The original SQLite hosted signature remains unreproduced by the earlier unchanged GREEN/GREEN comparison; its limits below are preserved.
Earlier fixture-lifetime repair (retained evidence)
Previous head
e952c7c08547f03e67ba22c54aaa338ba95cc87dadds one test-only repair on the original public merge composition. The snapshot fixture previously removed its temporary database directory before asynchronous reclamation workers finished closing. It now awaits agent-resource and shared-state cleanup before deletion, preserves the root if drainage fails, and restores the environment independently. All existing test assertions are unchanged; zero production changes, +15/-7 test lines in this follow-up. Independent canonical source review found no actionable P0–P2 issues.231e29505393abccc34c3526604eeed3d9d2b9ac; format, changed typed lint and services typegraph passed. The original two-group input ran 2,756 core + 6,992 UI tests, with 15 existing skips, followed by 33/33 focused snapshot tests. The CI-created commit, bundle digest, parent, tree, one-file patch and both coauthor trailers were independently verified before publication.Original transport evidence
Original reviewed, normal-hook transport source
24c7bd68b4bb683c0f2eb55c278534d635a50403, parent1844d933b2dc10673db973608d5d4d9bd0ca9105, tree87cce22f9233ec45b26217f917ba72901ebe2db9. Artifact digest, bundle, source parent/tree/patch and both human coauthor trailers were independently verified before publication.284b567; the only difference is a +4/-4 test-only lint repair binding a method and renaming a shadowed parameter. All production/build inputs are byte-identical. Final-source typed lint and runtime proof passed; these retained runs are not represented as fresh final-SHA type/build runs.2b2ae319c923751bc9621af6942867ccf4f3302ewas conflict-free; the worker-environment owners and reviewed routing have not changed since the proof parent. Public exact-head CI remains the final integration gate before landing.Measured cost, scope and diagnostics
Focused five-file proof used
pnpm test <five proof files> --maxWorkers=1and the native resource reporter: 58.41 s process wall, 54.495 s Vitest elapsed, 17.068 s summed module test durations. This is aggregate suite wall time, not per-file process wall or a controlled speedup claim. FULL consumed 895 CI job-seconds; its validation recipe consumed 537 s. The sibling run passed 341 tests in 169.44 s Vitest / 173.18 s wrapper wall. These are measured durations, not billing estimates.Runtime evidence covers dispatch, real placement/transfer owners, HTTP transfer/revocation, node/SSH adapters, replacement ownership and independent cleanup. It is not live cloud allocation or an external SSH-server acceptance claim. Upstream Codex source was personally inspected at
e766f759,codex-rs/core/src/tools/parallel.rs:125–220; runtime cancellation does not supply host effect-time authority.Not every baseline positive control passed: the independent-attachment budget assertion observed
undefinedinstead of600000. That is a real budget assertion, not a timeout, and passes on the fixed implementation. Candidate-only transfer-command tests run green-only; they are excluded from negative proof.The max-lines command emitted a non-failing diagnostic for
extensions/openrouter/index.test.ts:1. That file and the baseline ledger are unchanged by this patch; no suppression or budget was added or waived. Recorded follow-up: F-MAXLINES-OPENROUTER, reconcile that baseline diagnostic separately. Historical failed lint runs remain failed, not relabeled green.Original transport production delta: +205 lines; tests +1136 and routing +2. The fixture follow-up adds zero production lines and +8 net test lines. The growth carries missing authority across existing owners and joins cleanup without adding another state store or fallback execution path.
View the OpenClaw team session