Skip to content

[FIX] fix(web): add retry action for failed messages - #50

Merged
coreybain merged 2 commits into
mainfrom
t3code/add-message-retry-button
Aug 28, 2026
Merged

coreybain merged 2 commits into
mainfrom
t3code/add-message-retry-button

Conversation

@coreybain

@coreybain coreybain commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

What Changed

Added a retry action beneath the latest failed user message. Retry is shown only when the message can safely restart, with loading state, disabled interaction, tooltip, and accessible labels. Added focused logic and component tests.

Why

Users previously had no direct way to retry a failed message. Reusing the existing message-edit restart flow keeps the behavior small and consistent while preventing retries for unsupported messages or older turns.

UI Changes

The latest failed user message now displays a visible refresh button beneath the message. No screenshots are included.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Note

Add retry action for failed messages in MessagesTimeline

  • Adds resolveRetryableV2UserMessageId to ChatView.logic.ts which returns the latest user message id only when its run status is failed; otherwise returns null
  • Wires the resolved id and an onRetryUserMessage handler through ChatView.tsx into MessagesTimeline, delegating retry to onSubmitUserMessageEdit
  • Introduces RetryUserMessageButton in MessagesTimeline.tsx with pending/disabled state and accessibility labels, shown only for the eligible latest failed user message
  • Behavioral Change: the restart-failure error toast text changed from 'Failed to restart from the edited message.' to 'Failed to restart the message.'

Macroscope summarized 948b64f.

- Show retry only for the latest retryable failed user message
- Reuse safe message restart handling and cover the new behavior with tests
@greptile-apps

greptile-apps Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a guarded retry action for the latest failed user message by reusing the existing edit-and-restart flow.

  • Resolves retry eligibility from the latest editable user message and its failed run status.
  • Adds retry loading, disabled, tooltip, and accessible-label behavior to the message timeline.
  • Adds focused resolver and rendering tests plus user documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/web/src/components/ChatView.logic.ts Adds retry eligibility resolution by combining existing safe-edit checks with latest-run failure status.
apps/web/src/components/ChatView.tsx Wires retry eligibility and delegates accepted retries to the established edit-and-restart handler.
apps/web/src/components/chat/MessagesTimeline.tsx Adds the retry control and its local pending, disabled, tooltip, and accessibility behavior.
apps/web/src/components/ChatView.logic.test.ts Covers failed-run eligibility and rejection of completed or rollback-unsafe messages.
apps/web/src/components/chat/MessagesTimeline.test.tsx Verifies that the retry action appears only for the designated message.
docs/user/retrying-failed-messages.md Documents retry availability, restart semantics, and attachment preservation.

Sequence Diagram

sequenceDiagram
    actor User
    participant Timeline as MessagesTimeline
    participant Chat as ChatView
    participant Server as Orchestrator
    User->>Timeline: Select Retry message
    Timeline->>Timeline: Set retrying state
    Timeline->>Chat: onRetryUserMessage(messageId, text)
    Chat->>Chat: Revalidate retry eligibility
    Chat->>Server: Edit and restart message
    Server->>Server: Preserve original attachments
    Server-->>Chat: Command result
    Chat-->>Timeline: Retry result
    Timeline->>Timeline: Clear retrying state
Loading

Reviews (2): Last reviewed commit: "[DOCS] docs(user): explain failed messag..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 948b64ff9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Users had no shipped-product explanation for the retry action or its safety limits.

Document when Retry message appears, what content it preserves, how the failed attempt is restarted, and the fallback when retry is unavailable.

Generated with GPT-5.6 Sol in T3 Code using the Codex harness.
@coreybain
coreybain merged commit 4d694ad into main Aug 28, 2026
4 checks passed
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.

1 participant