Skip to content

fix(native-chat): keep known sessions loading until flush - #11032

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-native-chat-first-flush
Jul 28, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-native-chat-first-flush

Conversation

@nwparker

@nwparker nwparker commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep a known provider session loading until its first transcript snapshot resolves
  • preserve the existing pre-session behavior where live hook work can render before a provider session id exists
  • cover both precedence paths in the live-session merge tests

ELI5

Orca knew the Claude chat existed before Claude wrote the first line of its transcript. During that short gap, Orca incorrectly showed “start a new chat.” It now shows “Loading conversation…” until the first transcript arrives.

Root cause

mergeNativeChatLiveSession let a live working hook override transcript loading for every session. When Claude had already reported a provider session id but had not flushed the JSONL transcript yet, the view received zero messages with working status and rendered the empty state.

Proof of fix

The focused Electron reproduction holds the first transcript flush. A known session now remains in the loading state with no false empty/error UI:

Known Claude session remains loading before its first transcript flush

After the delayed snapshot resolves, the same view hydrates with the conversation:

Claude conversation hydrates after the transcript snapshot resolves

  • Focused Vitest: 38/38 passed.
  • native-chat-first-flush-race.spec.ts: 1/1 passed with one Electron worker.

Proof of no regression

  • The pre-session live-working path remains explicitly tested, so hook-driven work can still render before a provider session id exists.
  • Tests cover both the known-session loading precedence and the pre-session live precedence.
  • electron-vite build --mode e2e, targeted oxlint, and git diff --check passed.
  • Current GitHub CI: 23/23 non-skipped checks passed, with no failures or pending checks.

CI evidence

This fixes the native-chat first-flush failure reproduced in Cut Release runs 30316035485 and 30314906938.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated native chat live-session precedence so known sessions remain in a loading state while transcript content is unresolved, even when live status is working. The loading guard now considers whether a session ID exists. The related test now supplies a session ID and expects a loading status for an empty transcript.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is substantive, but it omits required template sections like Screenshots, checklist Testing, AI Review Report, Security Audit, and Notes. Reformat the PR description to match the template and add the missing Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main native-chat loading-state fix.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit e4b113b into main Jul 28, 2026
23 checks passed
@nwparker
nwparker deleted the nwparker/fix-native-chat-first-flush branch July 28, 2026 02:05
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant