Skip to content

fix: say why a goal loop paused on failing or declined cycles - #33190

Merged
bolichen97 merged 1 commit into
mainfrom
fix/32530-goal-loop-failure-copy
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/32530-goal-loop-failure-copy

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A goal loop the service stopped because its cycles kept failing, or because the model declined a cycle, tells the user why in an error notice instead of a bare "Paused".

When the service stands a goal loop down on consecutive_failures (several delivered cycles in a row ended in an error or a timeout) or on model_refused (the model declined the cycle), the goal popover shows only "Paused" in the warn tone: the same line a loop shows when nobody recorded why it paused. Nothing says a failure happened.

Why it matters

A user who opens the popover cannot tell a loop that is failing from one that is resting. They get no reason, no alert and no next step, so a loop that cannot make progress just sits there, and the user has no cue to look at the chat for the error or change the goal.

Not a goal

  • Changing when the service stops a loop (the failure threshold, or which turns count as failed).
  • Changing how any other stop reason reads.
  • An "ask the agent" hand-off from this notice: the popover holds the unsaved goal, idle and max-cycle inputs.
  • Other surfaces: the crew page and the stop notification already word both reasons.

What changed (motivation → approach → change)

The popover now says why the loop stopped, in the same red error notice it already uses for a cycle that could not run:

stopped_reason The popover says
consecutive_failures Paused · several cycles in a row failed. Check this chat for the error, then press Play.
model_refused Paused · the model declined the last cycle. Change the goal or the model, then press Play.

The bare "Paused" came from a lookup that knew neither reason, so it fell back to the plain line in the warn box. Both reasons are now in that lookup (PAUSED_STATUS_KEY in AutoNudgePopover.tsx) and in the set of reasons that render through ErrorNotice (FAILED_CYCLE_REASONS), with no hand-off, as structural_terminal, session_start_failures and claim_unsaved already do. The two lines are new catalog keys in every shipped language (en.manual.json plus the 11 translations) and in the generated en-XA pseudolocale.

Backwards compatibility

Compatible: two catalog keys and two lookup entries are added; every other stop reason renders exactly as before.

Removes nothing: no key, route, field or behaviour is taken away; an unlisted stop reason still falls back to the bare "Paused".

Tests

website/src/test/AutoNudgePopover.test.tsx: a paused loop stopped on consecutive_failures, and one stopped on model_refused, each renders its own line as the role="alert" error notice, not in the warn box, with no "ask the agent" button and the title still "Paused". With AutoNudgePopover.tsx reverted to main both cases fail (main renders the bare "Paused" warn line). The existing parity tests hold every locale to the new keys.

Determinism: the two new cases passed 20 runs in a row, and the whole file passes under --sequence.shuffle with seeds 48780 and 70223.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Built website/dist from 1e99b45e37 (this head is the same patch re-synced onto main, which changed no popover code in between) and captured the whole popover with a throwaway gateway-free Playwright script (serveDist + stubDashboardApi, one loop per stop reason). Before each shot the script checks the status text, that it carries role="alert", and that the Play (resume) control is enabled and inside the frame.

Screenshots / video

The whole goal popover from that build, so the controls under the notice stay in frame: Clear stopped goal on the left, Pause and Play (resume) on the right.

State Popover
consecutive_failures, light consecutive_failures, light
consecutive_failures, dark consecutive_failures, dark
model_refused, light model_refused, light
model_refused, dark model_refused, dark
Before: the bare warn "Paused" that main shows for both reasons (taken here with an unlisted reason, which takes the same fallback) before, bare Paused

Related Issues

Closes #32530

Sibling sweep

Swept: git grep -nE "structural_terminal|session_start_failures" -- website/src
Sibling: website/src/pages/members/CrewOnItsOwn.tsx:51 -- not affected -- its FAILURE_STOP_KEYS already maps model_refused and consecutive_failures to an error line

Pattern harvest

Rule candidate: review-prompt
Pattern: a frontend lookup keyed by a backend enum (here stopped_reason) falls back silently to generic copy, so a new backend value ships unworded; a new persisted reason should land with its UI mapping or a test that enumerates the backend's codes.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 8, 2026 13:33
@bolichen97
bolichen97 requested a review from Zedmor November 8, 2026 13:33
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 76d2da31175fc4ae20949dfda855c946cf8d40f9 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

The fix adds two missing entries to the popover's existing lookup and to its existing error-notice set. No new mechanism, and no default changes.

Notes

  • Item 1 — symptom-level: the cause is the description's own "a frontend lookup keyed by a backend enum … falls back silently to generic copy". PAUSED_STATUS_KEY still has no entry for 4 failure reasons that CrewOnItsOwn.tsx:47 FAILURE_STOP_KEYS maps to an error line: session_unavailable, sentinel_dropped, verdict_stall and completion_evidence_unavailable. I grepped those names in both files and in src/kiro_crew. These are out of scope under "Not a goal: Changing how any other stop reason reads", so the general fix is deferred.

What this change ships

Inventory (4 items) — 4 justified

Intent: when the service stops a goal loop because its cycles kept failing or the model declined one, the user is told why instead of seeing a bare "Paused". This is a FIX (Closes #32530).

  1. A loop stopped on consecutive_failures shows "several cycles in a row failed…" — justified
  2. A loop stopped on model_refused shows "the model declined the last cycle…" — justified
  3. Both lines show in the red error notice (role="alert") instead of the warn box — justified
  4. Two new catalog keys in en.manual.json, the 11 translations and en-XA — justified

[FIRST-PRINCIPLES-REVIEWED] 76d2da3

Description read

[DESCRIPTION-READ] 2a245ac57964d3f14a8a0f1bbac21376acad02eee88bbfc67ef23fee610ca542

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 76d2da31175fc4ae20949dfda855c946cf8d40f9 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: it adds two lookup entries the backend already emits (autonudge_service/model.py:106,134), takes nothing away, and five downloaded screenshots show the reshaped notice.

Notes

  • The silent fallback that hid these two reasons is still there for the next backend reason added without a UI mapping. A small test that lists the backend's stop-reason constants against PAUSED_STATUS_KEY would catch the next one. That is a follow-up, not part of this PR.

[DESIGN-REVIEWED] 76d2da3

Description read

[DESCRIPTION-READ] f550906f627f01fe8f25eba02e606445907b3c4f43c78c0f175ff0b35d86821d

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 76d2da31175fc4ae20949dfda855c946cf8d40f9 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 76d2da3

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 76d2da31175fc4ae20949dfda855c946cf8d40f9 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 76d2da31175fc4ae20949dfda855c946cf8d40f9 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The new notices are shown in light and dark, and the blind reader read both correctly. Only the next steps are left for the user to work out.

Notes

  • The blind reader said paused_model_refused asks the user to "change… the model", but the popover has no model control: "I see nothing in this panel that does that, so I wouldn't know where to go." Name where the model is set, or drop "or the model" from the notice.
  • paused_consecutive_failures says "Check this chat for the error", but nothing links to it. The reader said "I'd have to hunt for the error myself." Consider adding a jump to the last failed turn next to the notice.

[UX-REVIEWED] 76d2da3

Description read

[DESCRIPTION-READ] d36434e88d94a3db047d1a00931fb57a64d87dfc88b1e97ddff954424f0f9016

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 76d2da31175fc4ae20949dfda855c946cf8d40f9 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 76d2da3

Verdict parsed from the review's SHA-scoped output markers for commit 76d2da31175fc4ae20949dfda855c946cf8d40f9.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 76d2da31175fc4ae20949dfda855c946cf8d40f9 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 8, 2026 13:44
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 8, 2026
A goal loop the service stood down on consecutive_failures (several
cycles in a row failed) or model_refused (the model declined a cycle)
showed only the bare "Paused" line in the warn tone, because the goal
popover's status lookup knew neither reason.

Both reasons now have their own line in every locale and render
through ErrorNotice, with no hand-off beside the unsaved goal fields,
like the other failed-cycle reasons.

Closes #32530
@bolichen97
bolichen97 force-pushed the fix/32530-goal-loop-failure-copy branch from 402e17b to 76d2da3 Compare November 8, 2026 17:17
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/acp/kas_cli_settings.py since this head's CI ran (ec255d3 -> b306a0b); CI re-running.

The red Backend Tests (3.12, 3) shard (19 tests in test/test_kas_skill_scope.py, test/test_mate_conductor_agent.py, test/test_mate_conductor_parity.py and test/test_session_capabilities.py, failing on the skill-projection facade's kiro_home check) and the Coverage Gate that fails closed on it were main's red, fixed by #33221, which merged after this head's run. The change itself is the same patch; this PR touches only the goal popover and its catalog keys.
[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (15 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: a goal loop paused for consecutive failures or a model refusal now shows its reason as an error notice, with the two new strings in every locale and a test for both reasons.

@bolichen97
bolichen97 merged commit 0bca0bc into main Nov 8, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/32530-goal-loop-failure-copy branch November 8, 2026 18:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
buluoray added a commit that referenced this pull request Nov 8, 2026
A goal loop the service stood down on consecutive_failures (several
cycles in a row failed) or model_refused (the model declined a cycle)
showed only the bare "Paused" line in the warn tone, because the goal
popover's status lookup knew neither reason.

Both reasons now have their own line in every locale and render
through ErrorNotice, with no hand-off beside the unsaved goal fields,
like the other failed-cycle reasons.

Closes #32530

Original author: Bolin Chen
(cherry picked from commit 0bca0bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): goal-loop popover shows a bare Paused for consecutive_failures and model_refused

2 participants