Repository navigation
Conversation
Use the handoff-aware composer selection and the destination conversation context for cold-cache recommendations. Hide mismatched suggestions and revalidate the recommendation after send preparation, preserving direct sends, attachments, and deliberate compaction. Co-Authored-By: GPT-6.1 Sol at high effort <noreply@openai.com> Co-Authored-By: GPT-6.1 Sol at xhigh effort, review subagents <noreply@openai.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — Resume compaction is scoped to the selected Claude conversation and revalidated after uploads, reducing unintended compaction when switching providers. The reported temporary queue-display issue remains covered by the separate correctness gate. Needs human approval because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Resolve provider-thread context apps/web/src/components/chat/ContextWindowMeter.logic.ts, apps/web/src/components/chat/ContextWindowMeter.logic.test.ts |
New helpers derive context from provider-thread turns, select the latest matching root thread, and return tokens only for the matching Claude instance. Tests cover thread resolution, selection, and offer conditions. |
Resolve and pass the recommendation apps/web/src/components/ChatView.tsx |
ChatView resolves recommendations from the matching Claude provider thread and passes structured data to the composer and send hook. Provider selection uses the handoff-aware locked provider. |
Scope compaction to the selection apps/web/src/components/ChatView.logic.ts, apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/components/ChatView.logic.test.ts |
The planner checks the selected provider, instance, and destination thread. The composer derives eligible tokens from the recommendation. Tests cover provider switches, destination changes, and full-history mode. |
Revalidate before dispatch apps/web/src/components/chat/useComposerSend.ts, apps/web/src/components/chat/useComposerSend.browser.test.tsx |
The send hook checks saved eligibility against current context and rereads the turn plan after upload and settings persistence. Browser tests cover stale context and Claude destination dispatch. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant ChatView
participant ChatComposer
participant useComposerSend
participant ProviderThread
ChatView->>ProviderThread: Resolve matching Claude thread and context
ChatView->>ChatComposer: Pass structured resume-compaction recommendation
ChatComposer->>useComposerSend: Send with selected provider and destination
useComposerSend->>ProviderThread: Revalidate source timestamp and token usage
useComposerSend->>useComposerSend: Replan after uploads and settings persistence
Possibly related issues
- pingdotgg/t3code#23086 — This change evaluates resume-compaction eligibility against the selected Claude instance and saved destination context.
Possibly related PRs
- pingdotgg/t3code#24008 — Both changes govern automatic compaction in
planComposerTurn; that PR preserves the exclusion for explicit/compactcommands with instructions. - pingdotgg/t3code#25986 — Both changes address stale resume-compaction eligibility during provider switches. This PR also resolves and revalidates destination context.
- pingdotgg/t3code#24334 — Both changes use the web on-return compaction path. That PR changes the generated
/compactturn’s presentation and idle-compaction marker.
Suggested labels: bugfix
Suggested reviewers: juliusmarminge
Merge Risk: 
Minimal · up to bc2ce
-
No merge-blocking issue is established; the change is ready to merge after normal checks.
Pre-merge checks: 
4
-
Full details: Linked Issues check
-
Explanation
Issue [
#25943] requires normal dispatch after switching from Claude to Codex, while preserving deliberate/compact, and compaction when returning to an eligible saved Claude conversation.ChatViewandChatComposernow use matching provider selection.ContextWindowMeter.logic.tsscopes eligibility to the provider instance, provider thread, and context.planComposerTurnanduseComposerSendrecheck eligibility at send time. Tests cover Codex handoff, saved-Claude return, stale context, attachments, dispatch modes, manual commands, full-history choices, and warm context.
Full details: Out of Scope Changes check
-
Explanation
The production changes and tests address the stale on-return compaction path described by [
#25943]. They do not add unrelated settings, workflows, provider integrations, native-mobile paths, scheduled sends, or before-cache-expiry service changes. Related issue [#23086] remains contextual and is not treated as an additional objective.
Full details: Description check
-
Explanation
The pull request description follows the required template. It clearly states the problem, expected behavior, reproduction steps, implementation, scope and approval rationale, verification results, limitations, UI evidence, and model/harness details.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Keep the optimistic message classification and anchoring consistent with the send plan rechecked after preparation. Extend the paused-upload regression to verify optimistic state, direct-send anchoring, and explicit queue and steer controls. Co-Authored-By: GPT-6.1 Sol at high effort <noreply@openai.com>
|
@codex review Retrying the hosted review once after its previous failure to complete. Current head: |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
|
Thank you @Alb11747 for the careful reproduction and fix. #25986 fixes the same issue (#25943) with a smaller change: the resume-compaction offer now also requires that the send resumes the current conversation, reusing the handoff rule ChatView already computes, with a browser test that fails on main. We're keeping that one to keep the diff small and closing this as a duplicate. Your write-up and the send-time recheck idea are noted on the issue's record; if a stale-recommendation case shows up after https://git.cafe/pingdotgg/t3code/pulls/25986 lands, this PR is where we'll start. |
Problem
After a long Claude conversation becomes cold, selecting Codex can leave Compact next enabled and send an automatic
/compacton Codex before queueing the actual message. The parent chat view keeps the conversation's provider lock while the composer permits handoff, so the recommendation and live send destination disagree.Reproduce with a stopped Claude conversation containing 250k tokens past its cache TTL: select Codex and send an ordinary message. The expected result is one normal handoff/message dispatch. The affected source instead dispatches Codex
/compactwithidleCompaction: "onReturn", then queues the message.Fixes #25943. Related: #23086, which concerns evaluating the saved Claude destination when switching back.
Change
Resolve the parent's selection the same way as the composer, and bind resume-compaction recommendations to the selected provider instance, saved conversation, and observed context. The composer hides recommendations that do not match its selection. The send handler checks the live destination again after uploads/settings preparation, so a replaced, refreshed, or compacted conversation cannot reuse an older recommendation. The optimistic message's queue/steer classification and scroll anchor follow that final send plan.
Returning to a saved long, cold Claude conversation still offers compaction using that destination's context. Manual
/compact, full-history choices, warm-cache behavior, original message/attachments, and normal dispatch modes retain their existing behavior.Scope and approval
The issue has not received maintainer triage; no prior approval is claimed. This is submitted under the focused obvious-bug exception: an existing Claude-only recommendation is being applied to a different provider or conversation. The changes carry that existing eligibility through its UI and send boundary, without introducing a setting, workflow, or product default. All eight files address this same mismatch and its regression coverage.
Web and desktop share this composer path. Native mobile, agent/MCP sends, and scheduled sends do not inject this web on-return compaction. The separate before-cache-expiry service already checks its Claude provider/conversation and is unchanged.
Verification
vp run check:changed upstream/main: formatting, lint, knip, affected typechecks, and all 65 tests across three files passed on the upstream-only branch.54aeb9ba2df2. The fixture recorded Codex/compactfollowed by the queued message before the fix, versus exactly one Codex message after it. The source/fixture details are in [Bug]: Switching from an idle Claude thread to Codex still triggers automatic /compact #25943.bc2ce013fdf27d591919c8cc52d5b8d1f022fe50: Quality, Web tests, Tests, and all three server shards are green. The preceding revision's full CI passed on1fe0a60a58fcbb11e3f52663abf06ef91a9bdf98, based on upstream5e9d56416f6b: Quality, Web tests, Tests, and all three server shards were green.storageCleanup.test.tsinvalid-gitfile diagnostic failure. The subsequent full run above passed. The server/package trees are unchanged from upstream in this PR; the separate fork cleanup compatibility fix is excluded.Integrated UI captures use a synthetic full-AppRoot environment with mocked providers. No provider CLI, paid model call, or live database was used. The captures were made on the affected/fixed fork source before the upstream-only port; the port contains the same production fix. Slow-request toasts in the fixed fixture are caused by deliberately unanswered mock RPCs. Packaged desktop, native mobile, and post-install live-provider execution were not tested.
Returning to the saved cold Claude destination restores the intended suggestion:
Model/harness: GPT-6.1 Sol through Codex in T3 Code; independent reviews by GPT-6.1 Sol at xhigh effort. OpenAI/Codex models only.