Skip to content

fix: keep resumed Goals running after Gateway restarts - #181102

Merged
roboclaw-bot merged 4 commits into
mainfrom
openclaw/calm-shell
Oct 23, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
openclaw/calm-shell

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: a Goal explicitly resumed by an operator can stop after a Gateway restart instead of continuing automatically.

User Impact

Resumed Goals retain their authorized restart continuation. Pressing Stop still prevents recovery. No configuration or migration is required.

Why This Change Was Made

Goal Resume is an authenticated operator action, but its hidden transcript message is marked as internal. That marker inadvertently excluded the action from restart-authority capture. Classify only the validated Resume operation as operator input for this capture, without changing its transcript provenance. Existing live-authority, scope, execution-lineage, and incognito checks remain in place.

Evidence

  • Strengthened the existing public Goal Resume boundary regression: it fails on the base because the acknowledged Resume has no recovery source, then passes with this fix. The existing hidden-input and idempotency assertions remain intact.
  • 83 focused tests pass across Goal chat admission, Goal RPC operations, restart recovery, and requester recovery.
  • A real isolated Gateway and production agent, using a synthetic loopback HTTP model, survive two actual process crashes after Resume. Each replacement process automatically makes a new model request; the final response reaches public chat history. A stopped sibling remains killed across both restarts. No manually seeded recovery state or recovery RPC.
  • Gateway and root-E2E test typechecks, targeted lint/format, and diff checks pass. Independent autoreview reports no actionable P0–P2 issues, including a complete-context authority-boundary pass.

Live model and recovered-effect verification

  • A separately isolated, compiled Gateway using real OpenAI inference passed public authenticated Goal Resume across process replacement. The recovered model executed its barrier command again and delivered the expected result to public chat history; a stopped sibling did not restart. The live case passed in 39.14 seconds.
  • The committed cold-process test now also verifies a real recovered exec write exactly once, plus a separately authenticated operator revoked through public device.token.revoke while its recovered model response is held. Releasing that stale tool response produces no filesystem effect, no follow-up provider request, and no success reply; neither stopped nor revoked control resurrects on the next restart. This run passed in 29.54 seconds.
  • Revocation occurs during an already-admitted provider request, before subsequent tool/provider effects—not before the initial recovery provider call. The revocation fixture uses a synthetic HTTP model; the separate restart smoke uses a real provider. Gateway and command processes and disposable state were verified removed. Hosting Gateway state was untouched.
  • This follow-up changes tests only. Its typecheck, type-aware lint, formatting, diff checks, and fresh P0–P2 independent review passed. The published Git tree matches the tested tree.
Captured passing run output (local fixture paths omitted)

Cold-process effect/revocation run; the only omitted JSON field is the disposable local stateRoot path:

{
  "proof": "goal-resume-cold-restart",
  "pids": [
    2123960,
    2126763,
    2128675
  ],
  "resumeCalls": {
    "continue": 4,
    "stop": 1,
    "revoked": 2
  },
  "allowedRecoveredEffect": true,
  "revokedEffectAbsent": true,
  "entrypoint": [
    "dist/index.js"
  ],
  "node": "v26.3.0"
}
✓ recovers Goal effects across crashes but rejects stopped and revoked operators 29537ms
Test Files  1 passed (1)
Tests       1 passed (1)
Duration    73.96s

The four continue requests include its allowed tool-result follow-up. The revoked count of two is its original request plus the recovered request already in flight when revoked; it does not increase after the held response is released. The passing committed test also asserts no revoked success reply and no resurrection after the next process replacement.

Separate real-provider run:

{
  "proof": "live-model-goal-resume",
  "pids": [
    2182702,
    2188463
  ],
  "commandPids": [
    {
      "name": "continue",
      "pid": 2187216,
      "ppid": 2187215
    },
    {
      "name": "stop",
      "pid": 2188283,
      "ppid": 2188282
    },
    {
      "name": "continue",
      "pid": 2192351,
      "ppid": 2192350
    }
  ],
  "model": "openai/gpt-5.4",
  "marker": "LIVE_GOAL_RECOVERED_3d7415ea-4673-454d-bdb3-bd8a6002391f",
  "entrypoint": [
    "dist/index.js"
  ],
  "node": "v26.3.0",
  "delivered": {
    "provider": "openai",
    "model": "gpt-5.4"
  },
  "stoppedSiblingRemainedStopped": true
}
✓ continues real-model Goal Resume across process death while Stop remains terminal 39142ms
Test Files  1 passed (1)
Tests       1 passed (1)
Duration    94.76s

The process tests cover cold process replacement, not browser clicks or a managed-service deployment. The E2E reuses the existing Gateway fixture and is skipped on Windows because it uses SIGKILL.

Credit: @steipete for requesting the reliability audit and repair.

Work sessions

Worked on by

roboclaw-bot and others added 2 commits October 22, 2026 23:58
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: e1c3cb84-2759-4fb2-bc58-221b2729f29e
@clawsweeper

clawsweeper Bot commented Oct 22, 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: M labels Oct 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserve restart-recovery authority for authenticated Goal Resume operations while keeping their transcript input hidden.

Example: An operator resumes “Finish the release checklist,” then the Gateway process crashes.

  • Before: The resumed work lacks its operator recovery source and cannot continue with the original authority.
  • After: The replacement Gateway continues the work under revalidated authority; Stop and device revocation still prevent further effects.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused production repair with shipped-entry-point proof, meaningful negative controls, passing current-head gates, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Captured output exercises authenticated public Goal Resume through a compiled isolated Gateway, real agent execution, repeated process replacement, allowed recovered exec, and device revocation during a held recovered response; revoked work produces no filesystem effect or subsequent provider request, and separate real-provider output reaches public history.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Explicitly resumed Goal work can stop continuing after a Gateway restart.
Reason: The maintainer-authored direction restores authorized continuation through existing owners and retains hidden input, idempotency, Stop, and revocation behavior.

Merge readiness

✅ Ready for maintainer review

This PR provides a focused repair still needed on main; no actionable introduced defects remain, and the captured output satisfies the prior proof request.

Priority: P2
Reviewed head: 52b4e459136be800a08b7eef27061c1d6b05ee51

Before merge

None.

Findings

None.

Agent review details

How this fits together

Goal RPC admission validates the operator and session, records the continuation through the existing transcript owner, and supplies durable source facts to restart recovery.

flowchart TD
  A[Operator Resume] --> B[Goal RPC authorization]
  B --> C[Chat admission]
  C --> D[Transcript and recovery source]
  D --> E[Gateway restart recovery]
  E --> F[Current authority checks]
  F --> G[Provider and tool effects]
Loading

Technical review

Best possible solution:

Merge the narrow Resume capture correction using the existing recovery and live-authority owners.

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

Current source assigns Resume internal-system provenance, which the recovery-source predicate excludes; the PR also reports a base-failing admission regression and supplies passing process-replacement output, without this review executing target code.

Is this the best way to solve the issue?

The patch fixes classification at the existing capture boundary without changing transcript attribution, widening general internal-input eligibility, or introducing another recovery owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Operator recovery-source capture changes intended behavior with a stated reason (961f5c0: Preserve authenticated operator access during restart recovery while excluding unrelated internal or delegated work.)
  • Goal Resume admission regression keeps the original intent (0474704: Resume starts one real continuation without adding a visible human command message; later reconnect work preserved committed success despite notification failure.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: Raw commit 961f5c0 adds src/gateway/server-methods/chat-user-turn-recorder.ts:173 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 961f5c0b7099; files: src/gateway/server-methods/chat-user-turn-recorder.ts)

PR surface

Source +5, Tests +379. Total +384 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 6 1 +5
Tests 2 381 2 +379
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 387 3 +384

Review metrics

Metric Value Why it matters
Production versus test changes Production +6/-1; tests +381/-2 The small capture correction is supported by distinct acknowledgment-time persistence, cold-process recovery, Stop, and revoked-operator final-effect coverage.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The defect interrupts explicitly resumed Goals after Gateway replacement and has a focused repair.
  • merge-risk: 🚨 security-boundary: Resume now retains operator source facts across process replacement; inspected source and captured final-effect proof preserve current authorization and revocation.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-23T00:14:01.666Z sha c37a985 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T01:12:10.952Z sha 52b4e45 :: needs real behavior proof before merge. :: none

Reviewed October 22, 2026, 9:29 PM ET / October 23, 2026, 01:29 UTC (Revision 3).

roboclaw-bot and others added 2 commits October 23, 2026 01:05
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 88fd153e-2190-4e4b-8dbb-156225624daa
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@roboclaw-bot
roboclaw-bot merged commit 784d9ce into main Oct 23, 2026
163 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/calm-shell branch October 23, 2026 01:38
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. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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