fix(server): stop Codex threads with queued follow-ups - #5762
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved 84f5321 Straightforward bug fix that preserves the active turn ID when Codex queues a follow-up, ensuring interrupt targets the correct turn. Change is small, self-contained, and includes a comprehensive integration test. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * chore: vouch gfsaaser24 by @t3dotgg in pingdotgg/t3code#5761 * chore: vouch saphid by @t3dotgg in pingdotgg/t3code#5763 * fix(server): stop Codex threads with queued follow-ups by @t3dotgg in pingdotgg/t3code#5762 * fix(web): usage page loses the cost quality panel, gains a back button by @t3dotgg in pingdotgg/t3code#5756 * feat(server): agents can now open the images you paste into chat by @t3dotgg in pingdotgg/t3code#5757 * fix(web): pinned reorder no longer reshuffles while writes land by @t3dotgg in pingdotgg/t3code#5767 * feat(web): overhaul project settings into a real settings page by @t3dotgg in pingdotgg/t3code#5768 * fix(web): usage totals no longer jump while devices report in by @t3dotgg in pingdotgg/t3code#5772 * fix(server): settle no longer leaves monitors and dev servers running by @t3dotgg in pingdotgg/t3code#5774 * feat: pick worktree or current checkout per project by @t3dotgg in pingdotgg/t3code#5766 * fix(web): sidebar rows show the branch again, not a truncated plan step by @t3dotgg in pingdotgg/t3code#5776 * feat(server): vp run migrate-dev-db seeds worktree dev dbs with real data by @t3dotgg in pingdotgg/t3code#5773 * feat(web): keep unsent drafts one click away in the sidebar by @t3dotgg in pingdotgg/t3code#5777 **Full Changelog**: pingdotgg/t3code@v0.0.33-nightly.20260809.1039...v0.0.33-nightly.20260809.1040 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.33-nightly.20260809.1040
The desktop update tooltip flattens the release body into plain bullet lines, so the structured nightly highlights (`## Nightly highlights`, `### Added`, …) rendered their headings as list items and wasted 3 of the tooltip's 8 item slots. This PR makes the generated changelog and the tooltip work together, and leans harder into the LLM pipeline while keeping attribution. ## Changes - **Nightly highlights are a flat list** of plain items with compact PR references that survive the tooltip's markup stripping (`#61` for fork PRs, `t3code#123` for upstream, short SHAs for direct commits). Removals are phrased as "Remove …" via prompt guidance instead of a section label. - **Attribution is structural:** summary items are now `{ text, evidenceIds }` objects. The model only returns evidence IDs; URLs are rendered deterministically and IDs are validated against the collected evidence, so references can't be fabricated. The rolling fork-features issue gets the same per-item references. - **Extraction sees diffs:** each commit contributes a truncated patch (4 KB cap, lockfiles excluded) so descriptions are grounded in what actually changed rather than paraphrasing PR titles. Over the 160k-char prompt budget, the largest diffs are dropped first — titles and PR bodies never are. - **`## What's Changed` stays** as the exhaustive record and now credits contributors once per PR (`by @username`, fetched via `gh api` with graceful fallback). - **The tooltip parser stops at `## What's Changed`** when curated highlights precede it, so raw commit lines no longer mix with highlight lines. Bodies that open with the commit list (upstream-style, or a nightly with no highlights) still show it. ## Pipeline example Evidence in (abridged; one upstream commit from the delta below): ```jsonc { "id": "pingdotgg#5756", "title": "fix(web): usage page loses the cost quality panel, gains a back button", "description": "<sanitized PR body>", "files": ["apps/web/src/components/usage/UsagePage.tsx", "…"], "diff": "--- a/apps/web/src/components/usage/UsagePage.tsx\n+import { useCanGoBack, useNavigate, useRouter } from \"@tanstack/react-router\";\n…" } ``` Summary items out (actual output — note one PR correctly yielding both an improvement and a removal): ```json { "text": "Return from Usage through history or to home", "evidenceIds": ["pingdotgg#5756"] } { "text": "Remove Cost quality panel from the Usage page", "evidenceIds": ["pingdotgg#5756"] } ``` Rendered in the release body: ```markdown - Return from Usage through history or to home ([t3code#5756](pingdotgg#5756)) - Remove Cost quality panel from the Usage page ([t3code#5756](pingdotgg#5756)) ``` ## Regenerated release notes for `v0.0.33-nightly.20260809.121` Rerunning the new generator against the existing release's refs produced 13 items (the published release had 5, plus 3 heading lines). What the tooltip shows, via the actual parser: ``` • Identify sidebar threads with unsent drafts (#23) • Show subagent activity counts in right-panel controls (t3code#5745) • Return from Usage through history or to home (t3code#5756) • Give agents access to pasted image files (t3code#5757) • Manage projects from the dedicated Settings page (t3code#5768) • Preserve selected diff view across panel closures and reloads (t3code#5731) • Show pointer cursors for clickable controls and actions (t3code#5716) • Resume Claude sessions without falsely completing skipped turns (t3code#5710) ``` <details> <summary>Full regenerated nightly highlights</summary> - Identify sidebar threads with unsent drafts ([#23](#23)) - Show subagent activity counts in right-panel controls ([t3code#5745](pingdotgg#5745)) - Return from Usage through history or to home ([t3code#5756](pingdotgg#5756)) - Give agents access to pasted image files ([t3code#5757](pingdotgg#5757)) - Manage projects from the dedicated Settings page ([t3code#5768](pingdotgg#5768)) - Preserve selected diff view across panel closures and reloads ([t3code#5731](pingdotgg#5731)) - Show pointer cursors for clickable controls and actions ([t3code#5716](pingdotgg#5716)) - Resume Claude sessions without falsely completing skipped turns ([t3code#5710](pingdotgg#5710)) - Stop the active Codex turn before queued follow-ups ([t3code#5762](pingdotgg#5762)) - Keep pinned thread ordering stable while saving changes ([t3code#5767](pingdotgg#5767)) - Show multi-device usage progress while totals load ([t3code#5772](pingdotgg#5772)) - Remove Cost quality panel from the Usage page ([t3code#5756](pingdotgg#5756)) - Remove the limited project settings modal ([t3code#5768](pingdotgg#5768)) </details> <details> <summary>Regenerated rolling fork-features summary (excerpt, for issue #43)</summary> ## Added - Identify yngatech builds through names, icons, palettes, and About details ([#3](#3), [#27](#27), [#29](#29), [#30](#30), [#56](#56)) - Choose and preview sounds for completed agent turns ([#5](#5), [#7](#7), [#19](#19)) - Detect GitHub outages and show status in the sidebar ([#14](#14)) - Show unsent thread drafts with sidebar pencil indicators ([#23](#23)) - Start new threads with GitHub issues as context ([#31](#31)) - Open thread pull or merge requests from command palette ([#46](#46)) - Synchronize existing-thread text and composer settings across connected devices ([#39](#39), [#44](#44)) ## Improved - Inspect full commands, labeled streams, numeric exit codes, and failures ([#11](#11), [#4](#4), [#36](#36)) - Close terminals directly from the grouped terminal list ([#22](#22)) - Show clearer snooze countdowns near hour and day boundaries ([#45](#45)) - Show setup script outcomes in the thread timeline ([#40](#40)) - Install yngatech alongside upstream T3 Code on Windows ([#49](#49)) </details> ## Rollout The generator and workflow changes take effect on the next nightly. The tooltip parser change ships inside the app, so currently installed builds still show the mixed list until users update onto a build containing it. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Codex stop requests failed when a thread had a queued follow-up. T3 replaced the active provider turn ID with the queued turn ID, so Codex rejected the interrupt.
Keep the existing active turn ID until Codex sends turn lifecycle notifications that advance it. The integration test reproduces the observed active and queued turn ordering.
Test:
vp test run apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.tsCreated by GPT-5.6 in T3 Code using the Codex harness.
Note
Medium Risk
Changes turn-tracking used by Stop/interrupt on the Codex provider path; scope is narrow and covered by a new integration test, but incorrect active-turn bookkeeping could still break interrupt behavior.
Overview
Stop on Codex threads failed when a follow-up was queued while the current turn was still running: each
turn/startresponse overwroteactiveTurnIdwith the queued turn id, but Codexturn/interruptonly accepts the currently active turn.sendTurnnow keeps the existingactiveTurnIdwhen Codex returns a queued follow-up (session.activeTurnId ?? turnId); lifecycle handlers (turn/started/turn/completed) still advance or clear it.updateSessionaccepts an updater function so that logic can read the prior session state.Adds an integration test (two
sendTurncalls, theninterruptTurn) and extends the collab mock peer with per-call turn ids, optional suppression of a secondturn/started, and interrupt validation when the wrong turn id is sent.Reviewed by Cursor Bugbot for commit 84f5321. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
interruptTurnto target the active turn when Codex has a queued follow-upturn/start,session.activeTurnIdwas being overwritten with the new (queued) turn id, causing subsequent interrupts to target the wrong turn.updateSessioncalls in theturn/startflow to a functional form that preserves the existingactiveTurnIdif one is already set.codexCollabMockPeer.mjsto support deterministic turn ids, suppressingturn/startedfor queued turns, and validating interrupt targets.CodexCollabRuntime.integration.test.tsthat reproduces the bug and asserts the interrupt targets the first (active) turn id.📊 Macroscope summarized 84f5321. 2 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.