Repository navigation
[FIX] fix(web): add retry action for failed messages - #50
Merged
Merged
Conversation
- Show retry only for the latest retryable failed user message - Reuse safe message restart handling and cover the new behavior with tests
Contributor
Greptile SummaryThe PR adds a guarded retry action for the latest failed user message by reusing the existing edit-and-restart flow.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| 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
Reviews (2): Last reviewed commit: "[DOCS] docs(user): explain failed messag..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 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".
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Add retry action for failed messages in
MessagesTimelineresolveRetryableV2UserMessageIdto ChatView.logic.ts which returns the latest user message id only when its run status isfailed; otherwise returnsnullonRetryUserMessagehandler through ChatView.tsx intoMessagesTimeline, delegating retry toonSubmitUserMessageEditRetryUserMessageButtonin MessagesTimeline.tsx with pending/disabled state and accessibility labels, shown only for the eligible latest failed user messageMacroscope summarized 948b64f.