Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): show working state while provider sessions start #23590

Mergedonly21mil(GitHub profile, opens in a new tab)merged 10 commits intomain fromrefs/pull/23590/headmerged by juliusmarminge View on GitHub

only21mil(GitHub profile, opens in a new tab)commented

Problem

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:

  1. vp run dev, open the pairing URL, add any git project and pick a Codex model.
  2. Send a message and reload the page while the provider is still starting (I held codex app-server with a wrapper).
  3. 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).

Web, reload during startup (left main e93f2a5181, right 315c530fa3)

Linux desktop, same steps (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 contains deriveTimelineWorking; 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 planComposerTurn cases 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 (expected queue, received steer).

Web, follow-up sent during the held start (main e93f2a5181).

Web, follow-up sent during the held start (main e93f2a5181)

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

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

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

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

Web, after release (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

    2. Approvability

      Verdict: Approved at 1e52c15

      Macroscope'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).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      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_commits setting.

      • Last reviewed commit: 315c530fa3c61ddeed45f24a8644060f16194802
      • Latest commit, not reviewed: 66772ba5cbef84ba5f8d3afc8e853f856dda57e8

      Use the following commands to manage reviews:

      • @coderabbitai resume to resume automatic reviews.
      • @coderabbitai review to 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 deriveTimelineWorking for 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.ts
      deriveTimelineWorking now centralizes the working-state check from phase, send-busy state, compaction state, and runless-work start time. ChatView uses the helper. Tests cover preparing, starting, and queued sessions, and they check ready and failed cases.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: Minimal · previous review 315c5

      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: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Description checkPassedThe 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

      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.ts
      • apps/web/src/components/ChatView.logic.ts
      • apps/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.

    4. Note

      Written by gpt-6.1-sol on behalf of Maria

      thanks @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 pushed 257942a6506fbec18e55098086e7bcbc78a639e3 to 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:changed passed 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:

      main after reload during held provider startup

      after on this head:

      fixed timeline activity with editable composer and send enabled

      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.

      startup follow-up survives reload and both replies complete

      both replies complete and timeline working row clears

    5. juliusmarminge added labelsbugfix

    6. juliusmarminge added labelspr:gate-failed

    7. Note

      Written by gpt-6.1-sol on behalf of Maria

      Verified 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 i in both checkouts and one background vp run dev at 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-chrome on this linux boat vm. created the project pointing to the real /home/user/t3code git repo, threads, and real codex gpt-6.1-sol turns 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-OK and QUEUE-CHECK-OK arrive through the client. the queue empties and the working row clears.
      • neighboring behavior: Stop generation during held startup produces Run interrupted before provider start and clears the row. another message in that thread produces RECOVERY-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 0

      same project, prompt, viewport (1440x1000), and light theme. before on main:

      main after reload has sidebar activity but no timeline working row

      after on the exact pr head:

      pr after reload preserves the timeline working row

      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.

      real codex startup queue reload and completion

      both real replies complete and the working row clears

      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 budget check fails because mcpToolListJsonBytes is 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.

    8. 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.json matches main exactly, and AgentContextBudget.test.ts passes.

      The conflict came from #26238, which deleted the unused isConnecting state and rewrote the isWorking line this PR replaces. We kept deriveTimelineWorking(...). It is main's new expression plus phase === "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 (deriveTimelineWorking and main's restorePlanFollowUpComposer). 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
    9. 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-23590 branch, so we haven't pushed to this branch. It's ready if you want it.

      • Commit: 30fe4dddc5d755852e3b5c46c764091fda35cee1, one merge commit with main 0a9abddaee on top of this PR's head 232777be14. No rebase, and every existing commit stays as it is.
      • Fork branch: r13/a184-show-the-working-state-while-a-provider--offer on 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 restorePlanFollowUpComposer and its tests. The only conflicting hunk was the test file's import list. The merge keeps deriveTimelineWorking and drops the removed import. ChatView.tsx and ChatView.logic.ts merged cleanly, and the diff against main is still the same three files, +69/-2. Main still leaves the connecting phase out of isWorking, 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):

      Reload during provider startup: main has no timeline working row, this merge keeps it

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

      Follow-up queued while startup is held

      Startup failure clears the working row

      What it can't clear: the pr:gate-failed label, 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.

    10. 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.

    11. tanstack-source added labelsbug

    12. Note

      🤖 Opus 5.5 replying on behalf of Victor.

      @maria-rcks you verified 257942a650. This branch is now at f0363dafac, 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 was ChatView.tsx against #24138: I kept its compaction and steering lines as they are and kept isWorking = deriveTimelineWorking(...).

    13. 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.

    14. juliusmarminge added labelstakeover:in-progress

    15. 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.

      BeforeAfter
      ac180919a666772ba5cb
      Before: working row missing after reloadAfter: working row and Starting preserved after reload
      Before recordingAfter startup/reload recording excerpt

      Scenario source

      After: completed turn, working state and Stop generation cleared

      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.
    16. juliusmarminge added labelstakeover:ready

    17. juliusmarminge removed labelstakeover:in-progress

    18. juliusmarminge merged thisb2259d3

    19. juliusmarminge closed this

    20. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.