refactor(session): normalize retry recovery presentation#935
Conversation
|
Warning Review limit reached
More reviews will be available in 34 minutes and 39 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (33)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces recovery decision diagnostics tracking within the session processor and RunObservability, allowing detailed logging of recovery attempts and outcomes. Additionally, it renames the "safe_recovery" presentation type to "recovery" across various UI components, localization files, and tests, while maintaining backward compatibility for the legacy "safe_recovery" value. The review feedback suggests a minor improvement in packages/opencode/src/session/status.ts to use z.enum instead of z.union with z.literal for a more idiomatic and concise Zod schema definition.
Perf delta summaryComparator: pass
|
Summary
Normalizes #925's final recovery presentation layer so automatic replay uses a user-facing recovery state instead of exposing the internal safe-retry mechanism.
This PR:
safe_recoverytorecovery, while keeping legacysafe_recoveryparsing/rendering compatible;recovery_decisiondiagnostics in run observability and sanitized exports, including technical retryability, safety gate result, recovery mode, attempt metadata, timeout policy, retry-attempted state, provider progress, and final recovery outcome;SessionStatustypes for the new presentation value.Why
This is PR 4 for #925. PRs #928, #929, and #931 moved model execution retry mechanics toward one shared retry pipeline. The remaining work was to make UI and diagnostics consume stable recovery-oriented metadata rather than processor-local safe-retry naming.
Related Issue
Closes #925.
Human Review Status
Pending
Review Focus
Please focus on whether the new
recovery_decisionsummary answers the intended diagnostics questions without implying broader #927 run-resume support, and whether keepingsafe_retry_failedas the persisted notice kind is the right compatibility boundary.Risk Notes
Behavior risk is intended to be low: retry scheduling, replay budget, #922 timeout behavior, SSE reconnect, and partial-output/tool recovery behavior are unchanged. The visible UI copy changes from "retrying" wording to "recovering" wording. The persisted notice kind remains
safe_retry_failedto avoid a storage/schema migration.Skipped conditional checklist items:
docs/for verification and was not staged.How To Verify
Screenshots or Recordings
Safe retry snap was generated and visually checked locally:
It shows the running row as "正在恢复…" and the notice as "恢复失败。你可以稍后再试,或换一个模型。" without layout overlap.
Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.