Skip to content

fix(workers): stop workspace transfers after caller authority closes - #159087

Merged
roboclaw-bot merged 1 commit into
openclaw:mainfrom
roboclaw-bot:fix/pr135838-workspace-authority-20260926
Sep 26, 2026
Merged

roboclaw-bot merged 1 commit into
openclaw:mainfrom
roboclaw-bot:fix/pr135838-workspace-authority-20260926

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Closed callers cannot start new workspace effects after asynchronous preparation or transport waits.
  • A cancelled joining caller does not tear down another operation's established tunnel. Accepted reconciliation and cleanup retain their own ownership.
  • No new configuration, protocol, database schema, or provider compatibility cutoff.
  • This is the transport/workspace slice. Prepared-execution and result-custody caller repairs remain separate; this does not close the whole fix(workers): stop provisioning after turn authority closes #135838 workstream.

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 e952c7c08547f03e67ba22c54aaa338ba95cc87d adds 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.

  • Isolated repaired validation: exact candidate tree 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.
  • Counterevidence and attribution limit: unchanged PR composition and unchanged exact base also passed the same input plan. Thus the original public failure remains unreproduced, not proved pre-existing at runtime, caused by these transport changes, or repaired at its exact hosted failure signature. These green comparisons do not waive the failed public gate. The invalid fixture cleanup ordering is source-confirmed.
  • The repaired run preserved observed snapshot → overlay → embedded case output order. Identical per-worker/module-instance interleaving is not proven. Hosted hardware/cold cache differs from the original Blacksmith job; no hardware-causality or speedup claim.
  • Fresh public exact-head CI and ClawSweeper review remain required before landing. Prior public CI remains failed; isolated proof is not a public-CI success claim.

Original transport evidence

Original reviewed, normal-hook transport source 24c7bd68b4bb683c0f2eb55c278534d635a50403, parent 1844d933b2dc10673db973608d5d4d9bd0ca9105, tree 87cce22f9233ec45b26217f917ba72901ebe2db9. Artifact digest, bundle, source parent/tree/patch and both human coauthor trailers were independently verified before publication.

  • Baseline regression: all 44 focused cells executed, 35 assertion failures / 9 passes. No import, setup, hook or test-timeout failures counted as behavioral red.
  • Fixed validation: 385/385 tests across 27 files, comprising all 44 focused cases and 341 sibling cases. Formatting, changed typed lint, line-cap, assertion-safety and environment-count checks passed. The max-lines command succeeded with the unrelated-file diagnostic disclosed below.
  • Core and consumer types: core plus 25/25 selected consumer graphs passed. Literal build passed. These two retained runs used the preceding tree 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.
  • Fresh independent source review: no accepted P0–P2 findings. The final test-only lint correction preserves the same cases, assertions and authority callbacks.
  • Original publication composition with main 2b2ae319c923751bc9621af6942867ccf4f3302e was 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=1 and 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 undefined instead of 600000. 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

@clawsweeper

clawsweeper Bot commented Sep 26, 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 gateway Gateway runtime size: XL labels Sep 26, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 26, 2026 18:06
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 5:40 PM ET / 21:40 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: 83921e16c3e7fb239233061d2ae974e99af15771

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair follows existing owners and has strong boundary proof, with normal integration gates still in progress.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The changed Gateway transfer owner is exercised through production HTTP handling with a real fetch client and injected caller revocation: the recorded after-fix cases reject a stale token before upload, release staged data, and permit a fresh operation. The linked successful isolated run and PR body record the result; direct run-log inspection was proxy-blocked. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed Gateway transfer owner is exercised through production HTTP handling with a real fetch client and injected caller revocation: the recorded after-fix cases reject a stale token before upload, release staged data, and permit a fresh operation. The linked successful isolated run and PR body record the result; direct run-log inspection was proxy-blocked. No stored-data contract changes.
Evidence reviewed 8 items Current main still lacks the upload caller check: Current main checks context ownership and token expiry but does not check the initiating caller on upload authorization.
Dispatch reaches the final node effect check: The workspace command rechecks its owner and caller before node lookup and at the transport's dispatch authorization callback.
HTTP capability and revocation checks: The transfer service checks caller authority for upload admission and receiving, while revocation waits for receiver disposal before releasing its slot.
Findings None None.
Security None None.

How this fits together

Gateway 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +205, Tests +1146. Total +1351 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 15 343 138 +205
Tests 18 1313 167 +1146
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 33 1656 305 +1351

Review metrics

Metric Value Why it matters
Production versus test growth production +205 net, tests +1144 net, test routing +2 net The substantial test growth covers distinct transport and revocation boundaries; the production growth carries authority through existing owners.

Technical review

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

Labels

Label changes:

No label changes.

Label justifications:

  • P1: A closed delegated caller could continue a real worker workspace operation.
  • merge-risk: 🚨 session-state: The patch changes transfer and reconciliation custody, where a regression could lose accepted workspace changes.
  • merge-risk: 🚨 security-boundary: The patch changes when caller authority is checked before node dispatch and HTTP transfer effects.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed Gateway transfer owner is exercised through production HTTP handling with a real fetch client and injected caller revocation: the recorded after-fix cases reject a stale token before upload, release staged data, and permit a fresh operation. The linked successful isolated run and PR body record the result; direct run-log inspection was proxy-blocked. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Gateway transfer owner is exercised through production HTTP handling with a real fetch client and injected caller revocation: the recorded after-fix cases reject a stale token before upload, release staged data, and permit a fresh operation. The linked successful isolated run and PR body record the result; direct run-log inspection was proxy-blocked. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Agustin Rivera: 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 (2 earlier review cycles)
  • reviewed 2026-09-26T18:14:27.514Z sha 24c7bd68b4bb683c0f2eb55c278534d635a50403 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-26T20:00:49.774Z sha e952c7c08547f03e67ba22c54aaa338ba95cc87d :: needs maintainer review before merge. :: none

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]>
@roboclaw-bot
roboclaw-bot force-pushed the fix/pr135838-workspace-authority-20260926 branch from e952c7c to 83921e1 Compare September 26, 2026 21:32
@roboclaw-bot
roboclaw-bot merged commit b077d4e into openclaw:main Sep 26, 2026
238 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@roboclaw-bot
roboclaw-bot deleted the fix/pr135838-workspace-authority-20260926 branch September 26, 2026 22:02
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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. 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.

2 participants