Repository navigation
fix(wework): replace failed turns after retry - #2246
Merged
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughRetry handling now reconciles failed assistant turns across runtime messages, cached transcripts, pane state, and UI rendering. Tests and bilingual documentation cover successful retries, repeated failures, task reopening, ordering, and duplicate prevention. ChangesRetry reconciliation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AssistantErrorCard
participant retryFailedMessageInPane
participant runtimeMessagesToWorkbenchMessages
participant append_missing_cached_failed_assistant_messages
AssistantErrorCard->>retryFailedMessageInPane: trigger retry
retryFailedMessageInPane->>AssistantErrorCard: retain error card while retry runs
retryFailedMessageInPane->>runtimeMessagesToWorkbenchMessages: process retry result
runtimeMessagesToWorkbenchMessages->>AssistantErrorCard: reconcile successful or failed assistant turn
runtimeMessagesToWorkbenchMessages->>append_missing_cached_failed_assistant_messages: restore missing cached failures
append_missing_cached_failed_assistant_messages->>runtimeMessagesToWorkbenchMessages: return ordered, deduplicated transcript
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
qdaxb
marked this pull request as ready for review
July 27, 2026 12:08
duzeng
pushed a commit
to duzeng/Wegent
that referenced
this pull request
Jul 27, 2026
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.
Summary
Root cause
The error card previously owned local dismissal state, while its failed assistant message remained in the workbench message list. This made a successful retry leave an empty assistant turn.
Transcript restoration also projected provider messages and cached failures independently. A stale cached failure could therefore be appended after a newer successful retry, which made the failure card reappear in the wrong position after switching conversations.
User impact
Once a retry is accepted, the failed assistant turn is removed. When the retry succeeds, the conversation shows the original user prompt followed by the successful assistant response, with no stale failure card and no empty turn. Reopening the task preserves the same result.
Validation
pnpm --filter wework exec vitest run src/features/workbench/runtimePaneMessages.test.ts src/components/chat/MessageList.test.tsx src/features/workbench/WorkbenchProvider.test.tsx— 285 tests passedcargo test --manifest-path executor/Cargo.toml transcript_— transcript unit and contract tests passedcargo fmt --manifest-path executor/Cargo.toml --checkcargo clippy --manifest-path executor/Cargo.toml --all-targets -- -D warningspnpm --filter wework exec node e2e/desktop/task-flow.e2e.mjs --retry-only— real desktop retry-restoration E2E passedE2E assertions
After retry success, and again after switching away and reopening the task:
assistant-error-cardcount is0message-assistantcount is1Summary by CodeRabbit
Bug Fixes
Documentation