fix(web): show working state while provider sessions start #23590
main fromrefs/pull/23590/head·merged by juliusmarminge View on GitHubProblem#
While a provider is still starting after the draft becomes a thread, a reload or another client opening it shows the chat as idle, though the sidebar says it is working. ChatView's working state counts the running phase and this tab's own send, not the connecting phase.
Change#
Derive timeline activity from the existing runtime phase in deriveTimelineWorking, so the working row survives a reload during provider startup. Text entry, Send and follow-ups keep main's behavior: since #34581 a follow-up sent during startup steers once setup finishes by default, and with Queue it queues behind the run. After a reload, Compact waits for startup to finish, as on the tab that sent the message.
Scope#
Bug fix: wrong state shown while the agent starts. #35008 fixed the startup label from #14244 (now closed), but after a reload during startup main still shows no working row; this PR restores it. Julius's triage identifies the dead flag and endorses using the connecting phase. The "Syncing messages..." label and the timer's start time stay outside this fix; #17654's send behavior is kept.
Verification#
To see it on Linux web:
vp run dev, open the pairing URL, add any git project and pick a Codex model.- Send a message and reload the page while the provider is still starting (I held
codex app-serverwith a wrapper). - The sidebar says Working and Stop generation shows, but the timeline has no working row.
I ran main e93f2a5181 first, then this head 315c530fa3, each with a fresh home, a synthetic project and the real Codex CLI (GPT-6-Luna) through an API gateway, with the start held until I released it.
- After a reload during the held start, main has no working row on web or Linux desktop. This head shows "Working for 18s" with "Starting" on web and "Working for 15s" on Linux desktop.
- A follow-up sent during the held start shows "1 queued" on both and survives a second reload; after release it steers into the first run and the row clears.
Web, reload during startup (left main e93f2a5181, right 315c530fa3).

Linux desktop, same steps (left main e93f2a5181, right 315c530fa3).

Not checked:
- macOS desktop: not run.
- Windows desktop: not run.
- A startup failure on this head: covered by the unit case only.
- Mobile (its own thread screen, not changed here), a second client, remote connections.
Method, follow-up captures and checks
- Input: web in the Browser panel; Linux desktop ran the built app from source (
vp run build:desktop), with input sent through the renderer's debugging port. Codex CLI 0.165.0. Each server ran under the label "Test machine". - The held start keeps the run in
starting(read from each test database) until release. This head's web bundle containsderiveTimelineWorking; main's does not. - Run state from each test database: main and this head both end with run 1 completed and run 2 (the follow-up's queued run) cancelled, because the follow-up was delivered as a steer into run 1. One reply arrives: QUEUE-CHECK-OK.
vp test run apps/web/src/components/ChatView.logic.test.ts apps/web/src/session-logic.test.ts: 100 pass. With main's expression in the helper, the three startup cases fail and 97 pass.vp run check:changed: format, lint, knip, typecheck, tests and React Compiler pass.- This head merges main into the branch; the PR's two
planComposerTurncases that queued a steer during setup were dropped, because #34581 now steers such a send once setup finishes and main's own test covers it. Without that, the two cases fail on the merge (expectedqueue, receivedsteer).
Web, follow-up sent during the held start (main e93f2a5181).

Web, follow-up sent during the held start (this head 315c530fa3).

Web, the same thread after a second reload (this head 315c530fa3).

Web, after release (this head 315c530fa3).

Prior PRs#
#14000 by Raj Sharma (xrehpicx) proposed the same derivation and was closed for missing live-client evidence, which the author supplied afterward. Thanks to Joseph Vidal (josephv123) for #14244 and the follow-up.
Generated with GPT-6.1 Sol and Claude Opus 5.5 in T3 Code Nightly
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
1e52c15Macroscope's review found this PR approvable — This is a focused web bug fix that derives the existing timeline working state from persisted provider session phases, restoring startup activity after reloads without changing send or queue semantics. The production logic is small and covered by targeted tests, with no defaults, schema, infrastructure, or static-analysis changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.- Last reviewed commit: 315c530fa3c61ddeed45f24a8644060f16194802
- Latest commit, not reviewed: 66772ba5cbef84ba5f8d3afc8e853f856dda57e8
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- Resume reviews
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
ChatView now uses
deriveTimelineWorkingfor timeline working-state logic. The helper covers session phase, send state, compaction, and runless work. Tests now cover persisted session phases and the derived working state.Changes: Timeline Working State
Layer / File(s) Summary Derive and use timeline working state
apps/web/src/components/ChatView.logic.ts,apps/web/src/components/ChatView.tsx,apps/web/src/components/ChatView.logic.test.tsderiveTimelineWorkingnow centralizes the working-state check from phase, send-busy state, compaction state, and runless-work start time.ChatViewuses the helper. Tests coverpreparing,starting, andqueuedsessions, and they checkreadyandfailedcases.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk:
Minimal · previous review315c5-
The working row now stays visible while a provider session is starting, including after a reload. No actionable merge-blocking risk remains.
Pre-merge checks:
4-
Check name Status Explanation Title check The title "fix(web): show working state while provider sessions start" matches the main change: the timeline working row now derives from the connecting/starting phase via the new deriveTimelineWorkin… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Description check The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific detail. The Problem section states the bug and the expect… Full details: Title check
-
Explanation
The title "fix(web): show working state while provider sessions start" matches the main change: the timeline working row now derives from the connecting/starting phase via the new deriveTimelineWorking helper, so it stays visible during provider startup after a reload. It is a conventional commit title in plain language and names the affected area (web) and behavior.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific detail. The Problem section states the bug and the expected behavior. The Change section explains the derivation in deriveTimelineWorking and the send and Compact behavior. The Scope section links the issue and the triage comment, and it names what is excluded. The Verification section gives reproduction steps, the commands run, the observed results on main and on the PR head, and a list of checks not run. Screenshots are embedded for the UI change, as the template requires. The agent attribution is included at the end. The description is long, but it covers the required information.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: e93f2a5
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e3ffd8fc-bdb6-4a29-bd5e-82004e2ccfa9
Commits-
Reviewing files that changed from the base of the PR and between f0363dafac9db24dd85098e898a81b32d6f6d681 and 315c530fa3c61ddeed45f24a8644060f16194802.
Files selected for processing: 3-
apps/web/src/components/ChatView.logic.test.tsapps/web/src/components/ChatView.logic.tsapps/web/src/components/ChatView.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
Note
Written by
gpt-6.1-solon behalf of Mariathanks @only21mil. deriving timeline activity from the persisted phase fixes the reload gap while preserving startup queued sends.
i kept your implementation and commits, merged current main (
62245d8e3ad5) without conflicts, and pushed257942a6506fbec18e55098086e7bcbc78a639e3to this branch. the diff remains three files, +69/-6. no replacement, extra abstraction, or send-gating change was needed.verification on this head:
- all 28 ci checks passed. coderabbit found no actionable issues. two independent code reviews approved this exact head.
- blacksmith: 98 focused tests passed;
vp run check:changedpassed format, lint, both knip checks, affected typechecks and adjacent tests. its isolated shallow snapshot needed the main tree fetched and a worker-only history graft to compute the three-file diff. - red first: all three startup regression cases fail when the helper uses main's unchanged working expression.
- real dev web client, system chrome, isolated state, repo acp mock through the grok adapter: reload during held session creation shows no timeline activity on main and restores it on this head. typing and send remain enabled. a follow-up persists across reload, both replies arrive after release, the queue empties, and the working row clears. a startup failure also cleared the row.
unverified: authenticated hosted providers, electron shell, native mobile, a separate second client, remote/relay/tunnel connections, and actual worktree setup. the existing syncing label and timer origin remain outside this fix.
matching data, viewport and light theme, before on current main:

after on this head:

queued follow-up, reload, release and completion. loading frames around reload were cut; the remaining sequence plays at normal speed. uploaded playback and seeking were checked in chrome.

juliusmarminge added labelsbugfix
juliusmarminge added labelspr:gate-failed
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
verified as-is at
257942a6506fbec18e55098086e7bcbc78a639e3. no code changes or pushes.- reproduced on current
github/main,9c6429d74b59c7a06fb7357526457d192a744a9f, in a separate worktree. after reload during startup, the sidebar says working and Stop generation is available, but the timeline has no working row. - ran
vp iin both checkouts and one backgroundvp run devat a time, with separate empty state. stopped the captured main dev process group before starting the pr server. main web/server ports: 8693/16733; pr: 5733/13773. - drove the actual web app with the repo playwright and
/usr/bin/google-chromeon this linux boat vm. created the project pointing to the real/home/user/t3codegit repo, threads, and real codexgpt-6.1-solturns through the local proxy. no mocks, fixtures, demo data, or database writes. - briefly paused the actual codex app-server process with SIGSTOP to hold its startup response open, then resumed it with SIGCONT. this exposes the transient startup phase without replacing the provider or its replies. on the pr, the working row survives reload. text entry remains usable, Send is enabled, and a follow-up stays queued across another reload.
- after resuming codex, both
STARTUP-CHECK-OKandQUEUE-CHECK-OKarrive through the client. the queue empties and the working row clears. - neighboring behavior: Stop generation during held startup produces
Run interrupted before provider startand clears the row. another message in that thread producesRECOVERY-CHECK-OK, and the row clears again. - blacksmith ran
vp test run apps/web/src/components/ChatView.logic.test.ts apps/web/src/session-logic.test.ts: 98 passed. no new test files.
short runtime transcript, read-only from this dev server's projections after the browser interactions:
provider: codex | model: gpt-6.1-sol | session: ready startup thread: run 1 completed; run 2 completed cancellation thread: run 1 interrupted; run 2 completed client after startup reload: Working for 2s client after queue reload: Queued 1 client after completion: STARTUP-CHECK-OK, QUEUE-CHECK-OK; working rows 0; queued rows 0same project, prompt, viewport (1440x1000), and light theme. before on main:

after on the exact pr head:

startup activity, queued follow-up surviving reload, and both real replies completing. loading frames around reload were cut; remaining footage plays at normal speed. inspected the exported clip and checked uploaded playback and seeking in t3's preview player.

Not verified#
native ios/android, electron, remote/relay/tunnel connections, other providers, actual worktree setup, compaction, and provider startup failure were not exercised. a separately paired second browser tab stalled during pairing, so second-client behavior is unverified. the verified path is the local web client and real codex provider.
ci is not fully green: the existing
Agent context budgetcheck fails becausemcpToolListJsonBytesis 54964 versus current main's 42328. the three-file pr diff does not modify that budget. build/typecheck, lint, server tests, and web tests pass. i did not change labels, merge, rebase, or force-push.- reproduced on current
Note
🤖 Opus 5.5 and Sol 6.1 replying on behalf of Victor.
@maria-rcks we merged main into this branch to clear the conflict with #26238. It's one merge commit on top of your
257942a650, with no rebase, and your commits stay as they were.The old red Agent context budget run was stale. GitHub built its merge ref on an older main (
278fdce1af, with 54964 MCP tool-list bytes) and compared it with the main from after #25790 cut that to 42328. This PR adds 0 bytes: after the merge,agentContextBudget.jsonmatches main exactly, andAgentContextBudget.test.tspasses.The conflict came from #26238, which deleted the unused
isConnectingstate and rewrote theisWorkingline this PR replaces. We keptderiveTimelineWorking(...). It is main's new expression plusphase === "connecting", and main still leaves that phase out, so after a reload during provider startup the timeline still looks idle there. The test file keeps both imports (deriveTimelineWorkingand main'srestorePlanFollowUpComposer). The diff against main is still the same three files, +69/-2.Results on the merge:
ChatView.logic.test.ts+session-logic.test.ts: 96/96 pass (the PR body's earlier 98 was before main removed tests in those files)vp run check:changed: format, lint, knip, typecheck, tests and react compiler all pass- With main's expression in the helper, the 3 startup cases (preparing, starting, queued) fail; with this PR's helper they pass
- No UI behavior changed in the merge, so the existing screenshots still apply
Note
🤖 Opus 5.5 replying on behalf of Victor.
@maria-rcks this PR conflicts with main again, so we merged current main into it on a fork branch. You merged main here on your
takeover-23590branch, so we haven't pushed to this branch. It's ready if you want it.- Commit:
30fe4dddc5d755852e3b5c46c764091fda35cee1, one merge commit with main0a9abddaeeon top of this PR's head232777be14. No rebase, and every existing commit stays as it is. - Fork branch:
r13/a184-show-the-working-state-while-a-provider--offeron only21mil/t3code (the PR branch name ends in-, hence the double dash) - To take it:
git fetch https://github.com/only21mil/t3code r13/a184-show-the-working-state-while-a-provider--offer && git merge --ff-only FETCH_HEAD
What it fixes: the conflict with #33131. That PR removed plan mode, along with
restorePlanFollowUpComposerand its tests. The only conflicting hunk was the test file's import list. The merge keepsderiveTimelineWorkingand drops the removed import.ChatView.tsxandChatView.logic.tsmerged cleanly, and the diff against main is still the same three files, +69/-2. Main still leaves the connecting phase out ofisWorking, so the fix is still needed, and nothing in it was dropped.Verification on the merge:
ChatView.logic.test.ts+session-logic.test.ts: 93/93 pass. That's 3 fewer than before because #33131 removed the plan follow-up tests.- With main's expression in the helper, the 3 startup cases (preparing, starting, queued) fail. With this PR's helper they pass.
vp run check:changed: format, lint, knip, typecheck, tests and react compiler all pass.- Real web client against an isolated dev server and a synthetic project, with the repo's ACP mock behind the Grok driver, holding session start. After a reload during startup, main's client shows Working in the sidebar but no working row in the timeline. This merge shows the row (left: main, right: this merge):

- During the same held startup, a follow-up queues, and a startup failure clears the row:


What it can't clear: the
pr:gate-failedlabel, which has no stated reason we can act on. Also, the mock in this run never completed a reply because it doesn't accept the Grok model id, so completion was not recaptured on this head. Your 10-28 run covers that path, and the merge doesn't change it.If you'd rather have it on this branch directly, say so and we'll push it here as a fast-forward.
- Commit:
Note
🤖 Opus 5.5 replying on behalf of Victor.
@maria-rcks, a question about PRs you've marked as a takeover in your notes or branch names. On those we now leave the branch alone: we put the merge of main and any fix on a fork branch and leave a comment, like the one above. Several PRs are waiting that way now. Would you rather we push merges of main and review fixes directly to those branches, only as fast-forwards on top of your latest commit, or keep offering branches for you to pull? We'll follow whichever you prefer, on all of them.
tanstack-source added labelsbug
Note
🤖 Opus 5.5 replying on behalf of Victor.
@maria-rcks you verified
257942a650. This branch is now atf0363dafac, which adds three merges of main on top of it (232777be14,30fe4dddc5,f0363dafac) and no change to the fix itself. The diff against main is the same three files, +69/-2. The only conflict in the last merge wasChatView.tsxagainst #24138: I kept its compaction and steering lines as they are and keptisWorking = deriveTimelineWorking(...).Note
🤖 Opus 5.5 replying on behalf of Victor.
I merged main into this branch; it now contains #35008, which changed the same working row. I dropped this PR's two planComposerTurn cases, which main's own test now covers. What is left: after a reload while a run starts, the timeline shows the working row.
juliusmarminge added labelstakeover:in-progress
Evidence#
Hold replay provider session startup, send the prompt, then reload while startup remains pending. Real Chromium web client, 1280×800, light theme, fresh synthetic databases on both commits. Base loses the timeline working row; head preserves it. Releasing startup on head completes the turn and clears working state.
Before After ac180919a6 66772ba5cb 

Before recording After startup/reload recording excerpt 
Not shown:
- Startup failure was not exercised; completion cleanup was verified on head.
- A separate second client and the desktop shell were not exercised; reload verified a fresh web mount without local send state.
- Codex-specific startup and the exact HOLD-CHECK-OK reply were not exercised; the permitted replay agent held the same provider-starting phase and supplied its recorded reply.
juliusmarminge added labelstakeover:ready
juliusmarminge removed labelstakeover:in-progress
juliusmarminge merged thisb2259d3
juliusmarminge closed this
juliusmarminge removed labelstakeover:ready
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes