Skip to content

fix(goals): pause terminal failures and clarify goal states - #155694

Merged
vincentkoc merged 2 commits into
mainfrom
fix/goal-error-pause-state-20260922
Sep 22, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/goal-error-pause-state-20260922

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes goals still appearing active after their run has exhausted retries or timed out.

User Impact

Goals now pause after a terminal failure and remain paused until explicitly resumed. Running goals show a green target; paused goals show a yellow pause icon and a frozen timer. The compact status label exposes the reason on hover or keyboard focus, with the full note available in expanded details.

Why This Change Was Made

The Gateway records the goal pause together with the authoritative failed-run state, so every client receives the same result. Retryable errors remain active, and delayed failures cannot undo a newer resume or replacement goal. Objectives and usage accounting are preserved.

Evidence

  • Focused lifecycle and real chat-handler regressions cover exhausted failures, timeouts, retryable errors, stale events, newer goal intent, sanitization, and published session snapshots.
  • The current UI candidate passes all 65 goal-chat and sessions-view tests (15.33 seconds total; the pause-reason regression takes 23 milliseconds).
  • Backend/core type checks and focused regressions passed; refreshed UI typecheck and targeted lint passed after the tooltip refinement. Final goal test file: 7/7 passed in 6.85 seconds (pause-reason case: 27 milliseconds). The final exact-head PR CI is green after the test-layout follow-up.
  • Browser evidence uses the real component with synthetic data, not a full running Gateway. The full-app capture attempt was unsuccessful; no live-provider behavior is claimed.

Desktop component screenshots

State Before After
Running Running before Running after
Paused Paused before Paused after

The paused reason is available on keyboard focus or hover:

Paused reason tooltip

Screenshots are inspected synthetic real-component fixtures. The mobile expanded fixture clips its right edge, so full mobile layout is not claimed.

CI follow-up

  • Fixed the line-cap ratchet failure by moving the terminal goal regression and roster goal cases into coherent sibling test suites; shared roster fixtures remain single-owned. No production behavior changed.
  • Preserved all cases: Gateway suites 226/226 passed (64.13 seconds cold); roster suites 58/58 passed (3.45 seconds). The moved terminal cases took 1.25 and 1.06 seconds; roster goal cases took 9 and 6 milliseconds. The two owning test-type graphs, focused lint, formatting, and line-cap ratchet pass.
  • The first CI run also failed the clock-jump delivery settlement assertion and a session-list model-registry publication timeout. Both untouched fixtures passed a bounded local replay in the same isolated-database test project (4/4 cases, 114.74 seconds), but not the original full shard concurrency/order. This replay is not a proven fix; fresh exact-head CI remains required.

Current-head CI investigation

  • The exact-head CI recovery run passed the baseline ratchet and has one observed failure in untouched tooling: core-tooling-16, managed-child-process.test.ts / “shares listeners across parallel inherit commands even when another spawn throws”. The output-spy assertion timed out; all 12 stdout and stderr fixture lines are present in the job log before the deadline.
  • The failing test and its process owner are byte-identical to main at d72709c2b7fe5b6538ec8a45c713ffeaf986335e. The bounded full-file replay passed all 115 tests in 51.52 seconds (53.37 seconds including runner; the inherited-output case took 195 milliseconds). The original 76-file shard concurrency/order has not been reproduced. No product or test fix is claimed, and this PR does not change either file. This historical failure remains documented; the later full exact-head CI run passed. No repair to the untouched fixture is claimed.

Final qualification

  • Full CI passed on cea5bd38cb5e5c5fd37c560a01f133a4de694338, with enforced CI, dependency-review, and security-sensitive-review gates successful.
  • Fresh canonical-helper Codex AutoReview completed on that exact source, base, and patch: scoped-clean, no findings at the explicitly selected P0-only threshold. This does not claim automated P1–P3 clearance. Independent source review found no blocking issue.
  • The inspected screenshot evidence and full-app/mobile proof limitations above are unchanged.

Pause goals atomically when their run fails or times out after retries. Keep retryable failures active, and preserve newer goal intent. Show running goals in green and paused goals in yellow, with reasons on hover/focus and in expanded details.
@clawsweeper

clawsweeper Bot commented Sep 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.

@vincentkoc vincentkoc self-assigned this Sep 22, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 22, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 22, 2026 11:24
Keep the real handler and session-goal regressions in bounded sibling suites, sharing session-view fixtures. Preserve coverage without growing existing over-cap test modules.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 8:42 AM ET / 12:42 UTC (Revision 2).

ClawSweeper review

What this changes

Pauses goals after terminal run failures or timeouts and updates goal indicators, accessible status notes, documentation, and regression coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still lacks terminal-failure goal pausing. The focused repair remains useful, and this review found no actionable correctness or security defects.

Priority: P2
Reviewed head: cea5bd38cb5e5c5fd37c560a01f133a4de694338

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with useful visual evidence, targeted regression coverage, and clearly disclosed validation limits.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor runtime-proof gate does not apply to this MEMBER-authored PR. Inspected screenshots demonstrate desktop component appearance; backend coverage uses lifecycle tests, and the body discloses unsuccessful full-app capture. No stored-data format or migration contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor runtime-proof gate does not apply to this MEMBER-authored PR. Inspected screenshots demonstrate desktop component appearance; backend coverage uses lifecycle tests, and the body discloses unsuccessful full-app capture. No stored-data format or migration contract changes.
Evidence reviewed 8 items Pinned introduced change: Reviewed the merge-base-to-head production and test hunks. The lifecycle change uses the existing goal transition helper inside the accepted session update; endpoint drift was not attributed to this PR.
Still necessary on current main: Fetched main records failed and timed-out runs without updating their goals. A latest-release source lookup was unavailable, so no shipped-fix claim is made.
Regression coverage follows the production owner: The handler regression exercises retryable errors followed by exhausted failure or timeout, verifies persisted and published paused goals, and checks that a subsequent run does not resume them. Additional cases cover stale events, newer goal intent, existing stopped states, and sanitized notes. These tests were inspected, not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

The Gateway records agent-run outcomes and authoritative session goals. The Control UI consumes those session snapshots to display goal status, elapsed time, and available controls.

flowchart TD
  A[Agent lifecycle event] --> B[Retry and terminal classification]
  B --> C[Session and stale-event checks]
  C --> D[Commit run outcome and goal pause]
  D --> E[Publish session snapshot]
  E --> F[Chat and session goal indicators]
  F --> G[Explicit resume control]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +37, Tests +265, Docs +10. Total +312 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 4 67 30 +37
Tests 8 495 230 +265
Docs 1 12 2 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 574 262 +312

Review metrics

None.

Technical review

Best possible solution:

Keep terminal goal transitions in the authoritative lifecycle commit and let every client display the same paused state with explicit resume.

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

Yes, from source: a terminal failure on a session with an active goal updates the run status on current main but leaves the goal active. No runtime reproduction was executed here.

Is this the best way to solve the issue?

Yes. Reusing the existing goal transition inside lifecycle persistence avoids client-specific state and preserves retry handling, accounting, and newer intent.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs misleading goal state after terminal failures with a bounded lifecycle and UI change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor runtime-proof gate does not apply to this MEMBER-authored PR. Inspected screenshots demonstrate desktop component appearance; backend coverage uses lifecycle tests, and the body discloses unsuccessful full-app capture. No stored-data format or migration contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The external-contributor runtime-proof gate does not apply to this MEMBER-authored PR. Inspected screenshots demonstrate desktop component appearance; backend coverage uses lifecycle tests, and the body discloses unsuccessful full-app capture. No stored-data format or migration contract changes.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head production and test hunks. The lifecycle change uses the existing goal transition helper inside the accepted session update; endpoint drift was not attributed to this PR. (src/gateway/session-lifecycle-state.ts:473, cea5bd38cb5e)
  • Still necessary on current main: Fetched main records failed and timed-out runs without updating their goals. A latest-release source lookup was unavailable, so no shipped-fix claim is made. (src/gateway/session-lifecycle-state.ts:463, d2b9c87ac5ad)
  • Regression coverage follows the production owner: The handler regression exercises retryable errors followed by exhausted failure or timeout, verifies persisted and published paused goals, and checks that a subsequent run does not resume them. Additional cases cover stale events, newer goal intent, existing stopped states, and sanitized notes. These tests were inspected, not executed during this read-only review. (src/gateway/server-chat.goal-lifecycle.test.ts:129, cea5bd38cb5e)
  • Existing storage and security contracts: The patch retains schema version 1 and existing paused status, timestamp, and note fields. It reuses usage accounting and the bounded, redacted last-run error, without changing authentication, permissions, dependencies, or execution authority. (src/config/sessions/goals-transitions.ts:114, cea5bd38cb5e)
  • Inspected desktop visual evidence: Inspected all four prepared before/after images: active goals become green, and paused goals gain a yellow pause icon and warning surface. These are synthetic real-component captures, not a live Gateway failure demonstration. The fifth tooltip image was not in the prepared manifest; the body also explicitly excludes full mobile-layout proof. (cea5bd38cb5e)
  • Prior review and validation context: The preceding completed review covered this same head and retained no findings or rank-up moves. The supplied body reports focused passing checks and documents bounded investigation of untouched CI failures without claiming that successful replays fixed them. No tests or target-bundled review helpers were run here. (cea5bd38cb5e)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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 (1 earlier review cycle)
  • reviewed 2026-09-22T12:12:53.646Z sha cea5bd3 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 22, 2026
@vincentkoc
vincentkoc merged commit 06a99e6 into main Sep 22, 2026
456 of 458 checks passed
@vincentkoc
vincentkoc deleted the fix/goal-error-pause-state-20260922 branch September 22, 2026 13:52
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '739e2410702e0b1ad1d17a6dac07ddc0ab6dbebb': (140 commits)
  fix(ui): pause passive polling in hidden tabs (#155617)
  improve(android): keep chat photos outside text bubbles (#155338)
  fix(ui): preserve saved project after discovery failure (#155619)
  feat: compare Kitchen Sink Gateway resource costs (#155734)
  test(gateway): arm clock-jump claim after readiness (#155748)
  chore(ui): refresh control ui locales (#155700)
  fix(ci): join archive placement fixtures before teardown (#155751)
  fix(matrix): keep bot discovery off the Gateway thread (#152122)
  fix(agents): reconcile late requester recovery receipts (#155357)
  test(gateway): guard embeddings HTTP fixture lifetimes
  fix: isolate triage fixture acquisition and cleanup (#155736)
  refactor(sessions): hydrate saved transcripts off thread (#153325)
  fix: Claude MCP turns abort before tool timeout (#155663)
  fix(goals): pause terminal failures and clarify goal states (#155694)
  fix(test): preserve watcher errors when diagnostic capture fails (#155383)
  ci: move native runtime proofs to release validation (#155606)
  fix(auth): decouple compaction from profile rotation (#155204)
  fix(agents): admit compaction outside retired plugin generations (#151232)
  perf(ui): reduce automatic session list refetches (#155705)
  test: avoid unused source repos in release input fixtures (#155733)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…#155694)

* fix(goals): pause terminal failures and clarify goal states

Pause goals atomically when their run fails or times out after retries. Keep retryable failures active, and preserve newer goal intent. Show running goals in green and paused goals in yellow, with reasons on hover/focus and in expanded details.

* test(goals): split terminal and roster goal coverage

Keep the real handler and session-goal regressions in bounded sibling suites, sharing session-view fixtures. Preserve coverage without growing existing over-cap test modules.
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 docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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