🤖 fix: harden /btw side-question retry state#3324
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review Amended to also realign two stale comments in |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review Updated the PR with a small /btw retry-state fix: trailing side-question user rows and side-answer rows are now excluded from main-agent retry eligibility, preventing an idle-chat |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7435c56161
ℹ️ 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".
|
@codex review Addressed the retry-candidate issue: retry eligibility now skips trailing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c68df6d9ff
ℹ️ 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".
|
@codex review Addressed the context-error suppression issue by exporting |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd41b4f022
ℹ️ 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".
|
@codex review Addressed the legacy tool-part concern by preserving |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: baf8422975
ℹ️ 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".
Small post-merge hardening for the /btw side-question feature (#3293): - Inline dead processStreamEvent/dispatchProcessStreamEvent indirection. - Drop tautological prompt-copy assertions; keep behavioral ones. - Name SIDE_QUESTION_MIN_FALLBACK_ATTEMPTS instead of bare 3. - Type summarizeToolPart against MuxMessage parts union; remove unknown casts. - Narrow aiService dep to SideQuestionAIService = Pick<AIService, 'createModel' | 'getStreamInfo'>; drop the as-unknown-as-AIService test cast. - Export SIDE_QUESTION_COMMAND so the /btw literal lives in one place. - Ignore /btw side-question rows when evaluating main-agent retry state so idle /btw does not flash the Stream interrupted banner, while earlier interrupted main streams remain retryable. Validation: - make static-check - bun test src/common/utils/messages/retryEligibility.test.ts - bun run typecheck --- Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $307.29
|
@codex review Addressed the tolerance concern: |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Small follow-up on the
/btwside-question feature merged in #3293. This keeps the implementation easier to maintain and fixes an idle-chat UI flash where sending/btwcould momentarily show the main-agentStream interruptedretry banner.Background
#3293 landed
/btwacross the backend side-question service, frontend streaming aggregator, transcript rendering, and tests. A focused post-merge cleanup found a few low-risk maintainability wins. While validating the idle/btwpath, we also found that retry eligibility treated a trailing/btwuser row like a normal main-agent send with no response yet, which briefly mountedRetryBarrierbefore the side-answer placeholder arrived.Implementation
WorkspaceStore.processStreamEvent→dispatchProcessStreamEventwrapper.sideQuestionService.test.ts; keep behavioral assertions and rely on thestreamTexttest for the tools-denied contract.SIDE_QUESTION_MIN_FALLBACK_ATTEMPTSinstead of a bare3in the candidate-attempt loop./btw's AI dependency toSideQuestionAIService = Pick<AIService, "createModel" | "getStreamInfo">, removing the test fake'sas unknown as AIServicecast."/btw"literal asSIDE_QUESTION_COMMANDfor frontend draft restoration and backend persisted command metadata.sideQuestionService.tswith the actual side-answer-aware aggregator/store lookups./btwtranscript extraction tolerant of persisted history: malformed parts are skipped, currentdynamic-toolparts are summarized, and legacy AI SDKtool-<name>rows from olderchat.jsonlhistories are preserved as[tool name]context.getLastMainRetryCandidateMessage()so retry eligibility,ChatPanesuppression, andRetryBarriercopy all skip/btwrows consistently while still evaluating any earlier main-agent interruption or stream error.Validation
make static-checkbun test src/node/services/sideQuestionService.test.tsbun test src/common/utils/messages/retryEligibility.test.tsbun test src/browser/features/Messages/ChatBarrier/RetryBarrier.test.tsxbun run typecheckRisks
Low. The retry behavior change is constrained to retry-barrier eligibility.
/btwrows are a read-only side branch, not resumable main-agent turns, so they should be skipped when selecting the main retry candidate. The tests cover both sides: idle/btwno longer shows retry UI, and an earlier interrupted main response or context-exceeded stream error remains classified through the previous main-agent row even if/btwrows appear after it.Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$307.29