Skip to content

fix: goals fail to resume after stopping a run - #185273

Merged
brokemac79 merged 3 commits into
mainfrom
openclaw/tide-shrimp
Oct 29, 2026
Merged

brokemac79 merged 3 commits into
mainfrom
openclaw/tide-shrimp

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: Goal Resume fails with “requires an idle built-in local session with recoverable history” after an operator stops a run, even after that work has fully settled. Definitive admission refusals also appear as an unconfirmed update.

User Impact

Operators can resume the same stopped Goal without resetting the conversation or losing its history. Unsupported admission is reported as a rejection instead of leaving an uncertain operation waiting for reconciliation.

Why This Change Was Made

Explicit Resume may follow a settled abort, not just the special running-Goal replacement flow. Apply that distinction to local and supported Codex cloud-worker admission, while retaining live-work exclusion, freshness, placement, session identity, and current-authority checks. Use the existing typed Goal rejection contract so the existing UI can retire the refused request. Ordinary chat and Goal Start eligibility are unchanged.

Evidence

  • Integrated main 5516b9086e6092af42dac1ac42e635267e70d3b5 into the contributor branch after the admission-owner refactor. The retired restart-recovery module stays deleted; both current local and worker Resume predicates receive the fix.
  • Fresh shared AutoReview of 5516b9086e6092af42dac1ac42e635267e70d3b5..60ff8e09bbe2922b9da9459fd5ca86c5cfe0259b completed with no actionable P0-P2 findings. A separate independent source review also found no blockers.
  • Current candidate: all 42 Gateway Goal tests and all 33 UI Goal recovery tests passed. Restoring the three production files from the baseline, while retaining the regression tests, made both targeted regressions fail for the expected admission defects.
  • Current-head CI completed with one attributed upstream failure: the full-tree mock-export ratchet reports 14 violations in src/gateway/server-shutdown.runtime.test.ts and src/gateway/server.spawn-broker.test.ts. Main independently reports the same 14 violations. The two tests, baseline ledger, checker and inspected checker inputs are unchanged between the protected-main parent and the tested PR merge. security-fast passed; all other jobs passed or were skipped. CI remains failed and is recorded in native pre-existing-failure evidence for landing; no CI rerun or unrelated source repair is claimed.

Real Behavior Proof

  • Claim: an operator can Resume the same Goal after Stop has settled, and a definitive unsupported-admission refusal retires the pending UI operation.
  • Exercised surface: production Gateway Goal RPC admission, queue/lifecycle handling and SQLite state, plus the existing UI Goal recovery owner.
  • Scenario/fixture: Stop, wait for settlement, Resume with a new operation, complete, and replay the receipt without duplicate execution; unsupported admission retains its typed goal-invalid rejection.
  • Command/environment: Crabbox provider=local-container, lease cbx_bff6cd3713ae, run run_76ce59bd0f38; Linux, node:24-bookworm, Node 24.20.0, pnpm 12.15.0, one test worker and bounded compiler threads. Canonical baseline source plus the six-file reviewed patch reconstructed tree 116593a9972df7b5c36a050230d4f7bf14ed5d01, checked before execution; source hashes were checked and restored after the baseline replay.
node scripts/run-vitest.mjs src/gateway/server.chat-goal.test.ts --maxWorkers=1 --reporter=verbose
pnpm --dir ui test src/pages/chat/chat-goals.test.ts --maxWorkers=1 --reporter=verbose
# With the three production admission files restored from the baseline:
node scripts/run-vitest.mjs src/gateway/server.chat-goal.test.ts --maxWorkers=1 --reporter=verbose --testNamePattern='stops automatic pursuit and resumes|keeps an unscoped reply-dispatch hook'
  • Observed result: candidate Gateway 42/42 and UI 33/33 passed; baseline replay failed exactly the two intended regressions. The candidate source hashes matched again after restoration.
  • Artifact/trace: the executed run produced green.log, ui-green.log, red.log, and receipt.json. Summary of the captured output:
{"proof":"goal-stop-settlement-resume","green":{"passed":42},"uiPassed":33,"baselineRegressionFailures":2,"canonicalTree":"116593a9972df7b5c36a050230d4f7bf14ed5d01"}
  • Limits: model execution and worker transport are simulated. This proves the production admission/state boundary and UI rejection contract; no live-model, real cloud-worker transport, deployed Gateway, or production-session mutation is claimed. The initial Windows rsync trial ended before test execution and is excluded from these results.

The proof command exited 0 and its captured receipt was verified. Crabbox's controller subsequently exited 7 on a workspace-owner renewal after lease release; the owned container's removal was verified. This cleanup diagnostic is separate from the executed test results.

Work sessions

Worked on by

Worked on by:
- @jjjhenriksen

Co-authored-by: jjjhenriksen <[email protected]>
OpenClaw-Publication: cb8ca5ec-cfb9-4612-bac7-2609b5ae6115
@clawsweeper

clawsweeper Bot commented Oct 27, 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 docs Improvements or additions to documentation gateway Gateway runtime size: S labels Oct 27, 2026
Worked on by:
- @jjjhenriksen

Co-authored-by: jjjhenriksen <[email protected]>
OpenClaw-Publication: b9c1dfaf-60fd-4dbd-9daf-fc973f93a217
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 27, 2026 00:58
@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. 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. 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 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR allows explicit Goal Resume after stopped work settles and classifies unsupported admission as a definitive rejection.

Example: Stop the goal “Finish a three-turn checklist,” wait for settlement, then choose Resume.

  • Before: Resume rejects the stopped session because abortedLastRun remains true.
  • After: Resume starts another turn for the same Goal, and replaying that request does not start duplicate work.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused and source-consistent repair with useful integration coverage; supplied behavior evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; its supplied evidence exercises real RPC admission, queues, and SQLite with simulated model and worker execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Choosing Resume after stopping a Goal rejects the settled session and can leave the control showing an unconfirmed outcome.
Reason: Restoring explicit Resume has clear user value, follows the maintainer-authored direction, and preserves existing execution and authorization owners.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR addresses a current Goal Resume failure with a focused change to existing admission owners; no introduced correctness defect was found.

Priority: P2
Reviewed head: 681bcc6d2738711d29f9e3e9d36db871ba86c441

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: A shipped Gateway Stop → settlement → Resume run with real model execution is not supplied; the PR explicitly limits its evidence to the production-admission harness.
Agent review details

How this fits together

Goal controls enter through Gateway RPCs, pass session and lifecycle admission, and commit through existing transcript and Goal operation owners before model execution.

flowchart TD
  A[Operator Resume] --> B[Goal RPC owner]
  B --> C[Chat admission]
  C --> D[Session lifecycle and authority checks]
  D --> E[Local or worker execution]
  E --> F[Goal and transcript state]
  C --> G[Typed rejection response]
Loading

Technical review

Best possible solution:

Use the existing Resume admission and rejection owners while preserving settlement, current authority, session identity, and replay guarantees.

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

Current-main source rejects ordinary Resume when abortedLastRun is true; the extended production-admission regression covers that exact state, and the PR reports it failed before the fix.

Is this the best way to solve the issue?

The patch is the smallest complete repair: broaden the existing explicit Resume distinction, reuse typed rejection handling, and extend existing regression coverage without adding state or another owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Aborted-session eligibility changes intended behavior with a stated reason (ed3e84a: Objective replacement needed to resume the same Goal after interrupting and settling its prior run.)
  • Stop and automatic continuation keeps the original intent (c845d6d: Stop cancels current pursuit without completing the unfinished Goal; continuation remains owned by the existing queue.)
  • Admission rejection responses keeps the original intent (bfbfae7: Admission errors retain typed RPC responses; subsequent storage handling distinguishes terminal persistence failures from ordinary refusals.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f586b49 adds src/gateway/server-methods/chat-restart-recovery.ts:339 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f586b491f164; files: src/gateway/server-methods/chat-restart-recovery.ts)
  • Galin Iliev: Raw commit eec3594 adds src/gateway/server-methods/chat-send-goal-admission.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: eec35949bda1; files: src/gateway/server-methods/chat-send-goal-admission.ts)

PR surface

Source +7, Tests +34, Docs +1. Total +42 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 13 6 +7
Tests 2 37 3 +34
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 53 11 +42

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A stopped Goal cannot resume through the normal control despite settled work; the defect affects an established workflow with limited scope.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 26, 2026, 9:13 PM ET / October 27, 2026, 01:13 UTC.

@brokemac79
brokemac79 merged commit acf995b into main Oct 29, 2026
128 of 131 checks passed
@brokemac79
brokemac79 deleted the openclaw/tide-shrimp branch October 29, 2026 00:48
@brokemac79

Copy link
Copy Markdown
Contributor

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 29, 2026
* fix: goals fail to resume after stopping a run

Worked on by:
- @jjjhenriksen

Co-authored-by: jjjhenriksen <[email protected]>
OpenClaw-Publication: cb8ca5ec-cfb9-4612-bac7-2609b5ae6115

* Publish openclaw/tide-shrimp

Worked on by:
- @jjjhenriksen

Co-authored-by: jjjhenriksen <[email protected]>
OpenClaw-Publication: b9c1dfaf-60fd-4dbd-9daf-fc973f93a217

---------

Co-authored-by: jjjhenriksen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawtributors PR from a clawtributor docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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