Repository navigation
fix(native-chat): stop flashing "still starting" on every chat launch - #23666
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (16)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe status feed now includes provider-child generation and fence metadata in session summaries. The renderer reads a child key with generation as the primary value and fence as the fallback. A delayed-status controller and React hook now manage status display. The native chat startup notice appears after the startup phase remains active for five seconds. Tests cover child replacement, readiness, phase restarts, session changes, minimum visibility, and disposal. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The reported restart should receive a fresh notice delay on the inspected path. No actionable merge-blocking risk remains after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new child identity appears to affect when a startup notice is shown, not who can send messages or control a session. No new security exposure was established, but behavior across every client and reconnect state is not fully evidenced. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Delayed status primitive — new
src/renderer/src/lib/delayed-status.ts(createDelayedStatus) andsrc/renderer/src/hooks/use-delayed-status.ts: a keyed status that is shown only aftershowDelayMs, held for at leastminVisibleMs, and dropped immediately when the key changes. - Startup notice —
NativeChatStructuredSessionStatus.tsxrenders the "still starting" copy from the delayed value (5 s grace) instead of the rawstartingphase; message holding still reads the real phase atNativeChatStructuredSession.tsx:43, so delivery is unchanged. - Tests — new
delayed-status.test.ts(show delay, min-visible hold, key switch, dispose) plus a rewrittenNativeChatStructuredSessionStatus.test.tsxcovering a quiet normal startup, a slow startup, grace-period restart on relaunch/session switch, and ready/unknown phases.
Traced the timer state machine and the hook's React lifecycle behavior against the documented invariants; both hold for this consumer, and the new tests assert exact boundaries rather than loose ones. pnpm exec vitest run --config config/vitest.config.ts passes for both changed test files, and the changed-code quality gate reports 0 new findings.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Review paused after finding a user-visible startup notice bug. If a slow start has displayed the notice and the agent restarts in the same conversation during the 400 ms minimum display period, the notice carries into the new start instead of waiting the promised five seconds. The pane is keyed by session ID, so the status component remains mounted; the delayed-status state keeps the same key and shown value across the restart ( No fix or new commit was pushed. The remaining review and Electron validation were stopped under the requested stop-on-unexpected-behavior rule. The PR is not ready for a clean review verdict until the restart behavior is corrected and validated. |
Every structured chat passes through a short startup phase, and the pane showed "<agent> is still starting…" for all of it, so a normal launch flashed the notice for a fraction of a second. The notice now goes through a keyed delayed status: it appears only once startup outlasts a grace period, stays up for a minimum time once shown, and resets per session.
3a63b47 to
4c78082
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior pullfrog review (3a63b47 → 4c78082), which threads a provider-child identity through the host status summary so the startup notice resets per child.
- Child identity on the wire —
AgentSessionStatusSummarygains an optionalhostExecutionChild: { generation: string | null; fence: number }; the host feed publishes it withhostExecutionPhase, folds it intosummariesEqual, and strips it (with the other host-execution fields) onrevokeLive. Being a new optional field on an existing status frame, mixed-version peers ignore it safely. - Renderer hook generalized —
useStructuredAgentSessionHostExecutionreplacesuseStructuredAgentSessionHostExecutionPhase, returning{ phase, childKey }(generation, else fence);NativeChatStructuredSessionpasseschildKeythrough asstartupChildKey. Message holding still reads the real phase. - Notice keyed by child —
NativeChatStructuredSessionStatuskeysuseDelayedStatusonJSON.stringify([sessionId, typeof childKey, childKey]), so a replacement child restarts the full 5 s grace period even when the phase staysstarting. - Delayed-status restart edge —
createDelayedStatusnow restarts the show delay when a shown status clears and returns during its minimum-visible hold, so an observed host-side restart (an older host with no child identity) re-arms instead of staying shown. - Tests — new main feed child-identity test, rewritten bridge and component tests (per-child reset, fence fallback), and an added
delayed-statusclear-and-return case.
I traced the timer state machine (key change, clear/return, min-visible hold, dispose), the feed's identity equality and revocation plumbing, and the hook's external-store reads; all hold for this consumer, and the new tests assert exact boundaries. The changed renderer and main test files pass locally (vitest run --config config/vitest.config.ts; 73 tests across 8 files).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
| if (value !== null) { | ||
| if (value !== shown) { | ||
| show(value) | ||
| } |
There was a problem hiding this comment.
Replacement statuses skip the delay
When one status is visible, changing directly to a different non-null value calls show(value) immediately. For example, after A has appeared, a brief B will appear even if it clears before showDelayMs. This breaks the utility’s promise that short-lived statuses never appear, so other consumers can still see the flash this helper is meant to prevent.
|
Final status: merged as The unexpected QA answer was traced to a separate Claude agent sending a cross-session message into the QA Claude process after that chat had already answered the test prompt with The final patch was independently reviewed, the final readiness check found no material blocker, and every applicable CI check passed, including all eight test shards, typecheck, cross-version wire compatibility, static analysis, and packaging. The branch also merged cleanly with current main. Electron QA on the final revision showed a normal structured Claude launch without the startup notice; the PR body retains full-window slow-start visual evidence from before the child-identity follow-up. A live same-session replacement replay on the final revision was not obtained; focused tests cover its phase and child-identity timing. The Grok worker could not perform QA because Grok Build required credits, so Electron validation used the available CDP workflow directly. |
|
The problem in #23666 was a brief, distracting “Claude is starting” message during normal starts. The merged change delays that notice for five seconds, then shows it only while the same provider child is still starting. A replacement child gets its own delay, so an old timer or notice does not leak into the new start. Post-merge Claude Opus review (standard context, high effort, two matching subagents) and final readiness review found no P0–P2 issue caused by this PR. The host owns child identity and lifecycle fencing; the renderer only delays presentation. The optional child identity in the status feed is needed because a same-session child can be replaced without an intermediate empty state. No change to the merged PR was warranted. Full hidden Electron QA on the M4Air exercised the exact merged source: normal startup showed no notice; a nine-second startup showed it at about five seconds and cleared it on ready; a same-session child restart received a fresh delay; pending and visible notices from the old child did not carry over; another chat never showed the slow chat’s notice. Six related test files (65 tests) passed. Evidence: normal start, slow-start notice, new child’s notice, cross-session isolation, and slow-start recording. Twenty screenshots and the recording are attached to this PR. At QA time, adjacent #23682 had left a stale Codex import, so the exact merged source needed an out-of-tree build alias; the QA worktree stayed unchanged. This was separate from #23666. Since then, #23801 removed the stale import and #23808 restored child-turn settlement for a non-retried error when no turn completion arrives. Both are merged; #23808 passed its CI checks. Follow-up #23794 was superseded by those changes and closed without merging. Deferred P3 observations: reconnecting or first opening an already-starting chat can restart the five-second display delay; replacing a child can end the 400 ms minimum visible period early; generic timing-helper edge cases and a full attach-path integration test remain. One initial QA attempt on the historical merged commit also showed an empty first response row after a message was sent while the first turn was running. That separate queued-message behavior was changed later on main, but this exact attempt was not replayed there, so its current behavior is unverified. Windows, Linux, and SSH rendered UI were not exercised in this pass. |


ELI5
When you open a new structured chat, the agent (for example Claude) needs a moment to start. During that moment the chat showed "Claude is still starting. Messages wait until it is ready; close this chat to give up on it." Because every chat goes through that moment, the sentence flashed on screen for about half a second on every normal launch. Now it only appears when startup is genuinely slow.
What Changed
Before. The chat pane showed the startup notice whenever the host reported the agent's process as
starting. A healthy launch sits in that state briefly, so the notice appeared and vanished on every new chat.After. A normal launch shows nothing. If the agent is still starting after 5 seconds, the notice appears and explains why messages are waiting. Once shown, it stays at least 400 ms, so it cannot blink if startup finishes just after the delay. Switching to another chat drops it at once, and a relaunch waits the full delay again.
Mechanism. A keyed delayed status turns the real startup phase into the notice the view shows. The execution host already identifies each provider child by generation and fence; its status summary now carries that identity as an optional field. The view keys its delay by conversation and child generation (fence when no generation exists), so replacing a child resets the full delay even if the phase stays
starting. A phase transition also resets the delay when an older host omits child identity. Status ownership loss clears the identity. Message holding still reads the real phase, so delivery is unchanged.Why
The notice is useful when startup is slow or stuck, since there is no longer a startup deadline, but noise when startup is normal. A general delayed status fixes the flash in both directions: it ignores short states and keeps a shown state from blinking off right away. It is also reusable for other short-lived statuses, rather than being a one-off timer in this component.
Alternatives considered:
The 5 second show delay is deliberately longer than the few-hundred-millisecond delays suited to brief sync blips. Normal starts in the measured runs lasted roughly 0.3–0.4 seconds, so a shorter threshold could still flash.
Linked Issue
N/A. This was reported directly by a maintainer.
Visual Proof
Tested in a dev build on a second Mac. A test wrapper around the
claudecommand delayed its startup by a chosen number of seconds. Each capture is the full window, taken while a new Claude chat was still starting.The notice also pushes the empty state up by about 12 px, so the flash was a layout jump as well as text.
Testing
Manual testing: a macOS dev build with a fresh profile. Before = this branch with its production files reverted to
main; after = this branch. A page observer recorded every moment the notice appeared or disappeared.src/renderer/src/lib/delayed-status.test.tscovers: a short status is never shown, a status is shown after the delay, the minimum visible time holds, a new key drops the status at once, and nothing shows after dispose.NativeChatStructuredSessionStatus.test.tsxcovers a normal and slow startup, session switch, rapid restart during the minimum display period, and a replacement child whose intermediate phase is not rendered. Status-feed tests cover child identity publication, ownership clearing, and stable subscriptions. The quiet-startup and relaunch tests fail against the previous component.AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
The status summary gains one optional, non-persisted child identity field; older clients ignore it. An older host cannot identify a replacement child if it publishes two starts as one uninterrupted
startingphase, though observed phase transitions still reset the delay. The notice is desktop-only and the timing behavior is platform-independent.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)