Skip to content

fix(webui): clarify no-progress run failures - #7422

Merged
think-in-universe merged 3 commits into
mainfrom
issue-7351-clear-run-failures
Aug 10, 2026
Merged

think-in-universe merged 3 commits into
mainfrom
issue-7351-clear-run-failures

Conversation

@italic-jinxin

@italic-jinxin italic-jinxin commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Removes only the still-streaming unfinished assistant phase when a run fails, while preserving earlier completed phases.
  • Prevents late projection frames from restoring an unfinished draft after the terminal failure is visible.
  • Adds localized, actionable fallback copy for no_progress_detected failures when the backend frame has no failure summary.
  • Adds caller-level regression coverage and updates the WebUI streaming contract.
image

Linked Issue

Closes #7351

Validation

  • TZ=UTC corepack pnpm test
  • corepack pnpm lint:conventions
  • corepack pnpm typecheck
  • cargo test -p ironclaw_webui --all-features
  • cargo clippy -p ironclaw_webui --all-features --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • cargo test -p ironclaw_integration_tests --test reborn_integration_terminal_warning
  • git diff --check

Security Impact

No security boundary or sensitive-data handling changes.

Database Impact

No schema, migration, or persistence changes.

Blast Radius

Limited to WebChat rendering for failed or recovery-required runs and localized no-progress failure copy.

E2E Assessment

No new E2E scenario is needed. The changed behavior is local to the SPA event reducer and is covered through its wire-shaped caller seam; the backend no-progress path already has integration coverage.

Rollback Plan

Revert commit d5ab64ba2 to restore the previous failed-run rendering behavior.

Risk: low

@italic-jinxin italic-jinxin added size: M 50-199 changed lines risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Aug 10, 2026
@railway-app

railway-app Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the ironclaw-pr-7422 environment in ironclaw-ci-preview

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Aug 10, 2026 at 9:14 am

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-7422 August 10, 2026 07:50 Destroyed
@github-actions github-actions Bot added the scope: docs Documentation label Aug 10, 2026
@italic-jinxin

Copy link
Copy Markdown
Contributor Author

@ironloopai review

@ironloopai

ironloopai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🧭 IronLoop Run · Review

This comment updates in place as the Run moves through its stages.

🟩 Final result · Completed

🟨 Queued → 🟦 Working → 🟦 Posting results → 🟩 Completed

Manual command by italic-jinxin · attempt 1 of 3 · completed in 14m 44s

IronLoop completed the review and posted it to GitHub.

🔗 Result

Open submitted review →

Run details

Run: 4a9f2cfc-1b04-4163-8c10-7efc511b47e4
Base: main at cd38d88
Head: issue-7351-clear-run-failures at d5ab64b
Created: 2026-08-10 07:50 UTC
Updated: 2026-08-10 08:05 UTC

@italic-jinxin

Copy link
Copy Markdown
Contributor Author

@claude review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Failed or recovery-required chat runs now remove unfinished assistant drafts and show clear, actionable failure messages.
    • Previously completed chat phases remain visible.
    • Late-arriving streaming content can no longer restore removed failed drafts.
    • Duplicate failure messages are prevented.
  • Localization

    • Added no-progress failure messaging across supported languages, including guidance to retry with clearer or narrower instructions.
  • Tests

    • Added coverage for localized no-progress errors and failed-run streaming behavior.

Walkthrough

The WebUI removes unfinished assistant streaming phases after run failures, ignores late projection frames, and displays localized actionable copy for no_progress_detected failures. Tests cover draft finalization, failure formatting, and locale completeness.

Changes

Run failure UI

Layer / File(s) Summary
Failure projection cleanup
crates/product/ironclaw_webui/CONTRACT.md, crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts, crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts
Failed and recovery-required runs remove active streaming assistant phases while preserving completed phases. Late projection text is ignored. Tests cover terminal no-progress failures and replayed draft text.
No-progress failure localization
crates/product/ironclaw_webui/frontend/src/pages/chat/lib/failureMessages.ts, crates/product/ironclaw_webui/frontend/src/pages/chat/lib/failureMessages.test.ts, crates/product/ironclaw_webui/frontend/src/i18n/*, crates/product/ironclaw_webui/frontend/src/lib/i18n.test.ts
no_progress_detected failures use chat.failure.noProgress. All locale packs provide the message, and tests validate formatting and locale completeness.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RunStatus
  participant useChatEvents
  participant FailureFormatter
  participant ChatHistory
  RunStatus->>useChatEvents: failed or recovery_required status
  useChatEvents->>ChatHistory: remove active streaming draft
  useChatEvents->>FailureFormatter: format no_progress_detected failure
  FailureFormatter-->>useChatEvents: localized actionable message
  useChatEvents->>ChatHistory: append failure message
  RunStatus->>useChatEvents: late projection frame
  useChatEvents->>ChatHistory: ignore projection text
Loading

Possibly related PRs

Suggested reviewers: sergeiest

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the main changes, issue, validation, impact, blast radius, and rollback, but omits several required template sections. Add Change Type, Test Strategy, Reborn Trust-Boundary Checklist, Review Follow-Through, and Review track sections with completed values.
Linked Issues check ⚠️ Warning The PR addresses the truncated draft and ambiguous no-progress error in issue #7351, but it does not demonstrate prevention of repeated continuation failures. Document or implement behavior that prevents continuation attempts from immediately repeating the same no-progress failure loop.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits style and accurately summarizes the no-progress WebUI failure changes.
Out of Scope Changes check ✅ Passed The contract, localized messages, failure formatting, event handling, and regression tests are directly related to issue #7351 and the stated WebChat objectives.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts`:
- Around line 2683-2763: Add a parallel regression test for useChatEvents
handling status "recovery_required", reusing the existing
failureMessageForRunStatus harness and the same initial assistant draft,
terminal status update, message finalization, failure error content, and
delayed-text replay assertions as the no-progress failure test. Ensure the
recovery_required case also leaves only the finalized assistant message and
error message, and late projection updates cannot restore the unfinished draft.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 27081050-0383-437b-a055-c762014cb8a1

📥 Commits

Reviewing files that changed from the base of the PR and between cd38d88 and d5ab64b.

📒 Files selected for processing (17)
  • crates/product/ironclaw_webui/CONTRACT.md
  • crates/product/ironclaw_webui/frontend/src/i18n/ar.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/de.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/en.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/es.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/fr.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/hi.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/ja.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/ko.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/pt-BR.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/uk.ts
  • crates/product/ironclaw_webui/frontend/src/i18n/zh-CN.ts
  • crates/product/ironclaw_webui/frontend/src/lib/i18n.test.ts
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/failureMessages.test.ts
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/failureMessages.ts
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts

Comment thread crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts Outdated
serrrfirat
serrrfirat previously approved these changes Aug 10, 2026

@ironloopai ironloopai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 IronLoop review

🟢 No actionable findings

No actionable issues found.

Validation

  • ✅ WebUI frontend tests — 137 files / 1,197 tests passed.
  • ✅ WebUI handler-contract tests — 5 tests passed.
  • ✅ Patch whitespace check — No whitespace errors reported.
Review details
  • Run: 4a9f2cfc-1b04-4163-8c10-7efc511b47e4
  • Workflow: Review
  • Attempts: 1

@ironloopai

ironloopai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🧭 IronLoop Run · Review

This comment updates in place as the Run moves through its stages.

⬛ Final result · Stopped

🟨 Queued → 🟦 Working → ⬛ Stopped

Automatic trigger · attempt 1 of 3 · stopped after 4m 26s

IronLoop stopped because the pull request target branch or head changed while this Run was active.

Run details

Run: 30b1a692-50c2-45e1-bec5-fc09b97822f3
Base: main at cd38d88
Head: issue-7351-clear-run-failures at d5ab64b
Created: 2026-08-10 08:05 UTC
Updated: 2026-08-10 08:10 UTC

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-7422 August 10, 2026 08:09 Destroyed
@italic-jinxin italic-jinxin self-assigned this Aug 10, 2026

@hanakannzashi hanakannzashi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: withoutStreamingAssistantPhaseForRun treats isStreaming !== false as streaming. That also matches durable timeline assistant records: messagesFromTimeline leaves isStreaming undefined, while non-final assistant rows (including tool_result) have isFinalReply === false. A failed run will therefore remove completed durable rows until the async history reload succeeds (and permanently if it fails), contrary to the stated goal of preserving earlier completed phases. Please restrict this to actual live phases (isStreaming === true, or the existing isLiveAssistantMessage predicate) and add a timeline-sourced regression case.

@italic-jinxin
italic-jinxin force-pushed the issue-7351-clear-run-failures branch from 02840a1 to ff6a208 Compare August 10, 2026 08:39
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-7422 August 10, 2026 08:39 Destroyed
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-7422 August 10, 2026 09:05 Destroyed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts (1)

2695-2781: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the same-batch terminal-text path.

This helper sends the terminal run_status in a later projection. The later replay is then blocked by the existing err-run-1; it does not exercise the new batchRunStatusByRunId branch in crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts Line [631].

Add a case with run_status.status === terminalStatus and multiple text items in one snapshot. Assert that the completed phase remains and only the active phase is removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts`
around lines 2695 - 2781, Extend assertNoProgressFailureClearsDraft with a
same-projection case containing the terminal run_status and multiple text items,
so it exercises batchRunStatusByRunId in useChatEvents. Assert that the
completed assistant phase remains while only the active unfinished phase is
removed, and retain the existing assertions for the later replay path.
crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts (1)

631-647: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Terminal-batch handling and regression coverage share one gap. The implementation treats every text item in a terminal batch as late, so it can drop completed phases. The current regression does not exercise that batch shape.

  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts#L631-L647: Process terminal-batch text before failure cleanup, or distinguish an already-observed failure from a terminal status first seen in the current batch.
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts#L2695-L2781: Add one snapshot containing the terminal status and multiple text phases; assert that the completed phase remains and the active phase is removed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts`
around lines 631 - 647, The terminal-batch handling in useChatEvents.ts (lines
631-647) must process text phases before failure cleanup, or distinguish
failures already observed before the current batch from terminal statuses first
seen in it, so completed phases are retained while only the active failed phase
is removed. In useChatEvents.test.ts (lines 2695-2781), add snapshot coverage
with a terminal status and multiple text phases, asserting the completed phase
remains and the active phase is removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts`:
- Around line 2695-2781: Extend assertNoProgressFailureClearsDraft with a
same-projection case containing the terminal run_status and multiple text items,
so it exercises batchRunStatusByRunId in useChatEvents. Assert that the
completed assistant phase remains while only the active unfinished phase is
removed, and retain the existing assertions for the later replay path.

In `@crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts`:
- Around line 631-647: The terminal-batch handling in useChatEvents.ts (lines
631-647) must process text phases before failure cleanup, or distinguish
failures already observed before the current batch from terminal statuses first
seen in it, so completed phases are retained while only the active failed phase
is removed. In useChatEvents.test.ts (lines 2695-2781), add snapshot coverage
with a terminal status and multiple text phases, asserting the completed phase
remains and the active phase is removed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 05893a26-eaa8-4714-aaef-c6470120ba74

📥 Commits

Reviewing files that changed from the base of the PR and between ff6a208 and db4b51a.

📒 Files selected for processing (2)
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.test.ts
  • crates/product/ironclaw_webui/frontend/src/pages/chat/lib/useChatEvents.ts

@italic-jinxin

Copy link
Copy Markdown
Contributor Author

P1: withoutStreamingAssistantPhaseForRun treats isStreaming !== false as streaming. That also matches durable timeline assistant records: messagesFromTimeline leaves isStreaming undefined, while non-final assistant rows (including tool_result) have isFinalReply === false. A failed run will therefore remove completed durable rows until the async history reload succeeds (and permanently if it fails), contrary to the stated goal of preserving earlier completed phases. Please restrict this to actual live phases (isStreaming === true, or the existing isLiveAssistantMessage predicate) and add a timeline-sourced regression case.

Thanks for catching this — you’re right.

messagesFromTimeline leaves isStreaming undefined for durable assistant rows, so the previous isStreaming !== false check could incorrectly remove completed timeline phases.

I updated the cleanup condition to require isStreaming === true, so only an active live draft is removed. I also added a regression test using messagesFromTimeline to verify that a durable tool_result row is preserved while the unfinished live draft is removed.

Fixed in db4b51aa9.

@think-in-universe
think-in-universe added this pull request to the merge queue Aug 10, 2026
@italic-jinxin italic-jinxin added the human-verified Manually tested and verified label Aug 10, 2026
Merged via the queue into main with commit 72bcf87 Aug 10, 2026
45 checks passed
@think-in-universe
think-in-universe deleted the issue-7351-clear-run-failures branch August 10, 2026 09:48
Kampouse pushed a commit to Kampouse/ironclaw that referenced this pull request Aug 13, 2026
* fix(webui): clarify no-progress run failures

* test(webui): cover recovery-required run failures

* fix(webui): preserve durable phases on run failure
Kampouse pushed a commit to Kampouse/ironclaw that referenced this pull request Aug 13, 2026
* fix(webui): clarify no-progress run failures

* test(webui): cover recovery-required run failures

* fix(webui): preserve durable phases on run failure
l3ocifer pushed a commit to l3ocifer/frick-ironclaw that referenced this pull request Sep 3, 2026
* fix(webui): clarify no-progress run failures

* test(webui): cover recovery-required run failures

* fix(webui): preserve durable phases on run failure

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-7422 — db4b51aa Deployed Aug 10, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs human-verified Manually tested and verified risk: low Changes to docs, tests, or low-risk modules scope: docs Documentation size: M 50-199 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run failure UI is unclear: assistant message is truncated and the failure reason/result is ambiguous

4 participants