Skip to content

#783 Show the worktree checkout on the first Session Chat frame - #784

Merged
ivanfenenko merged 2 commits into
mainfrom
fix/783-session-chat-worktree-header
Oct 21, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
fix/783-session-chat-worktree-header

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Session Chat showed the project letter for a moment, then switched to the worktree icon, every time a worktree session was opened. It only found out the session was a worktree checkout after its own chain of requests, and ignored what Home had already loaded.
  • New WorktreeInventoryCache on iOS and Android: Home writes its added paths and worktree inventories into it, and Session Chat reads it synchronously when it opens, so the first frame is already final. The server fetch still runs as a refresh and only republishes when its answer differs. A failed refresh keeps the cached identity.
  • The identity logic moves into a small SessionChatProjectIdentity type on each platform. iOS no longer resets the identity to the letter when observation restarts.

Checks

  • Android: ./gradlew :app:testDebugUnitTest :app:assembleDebug passed, 2479 tests (1 skipped).
  • iOS: full unit target ran 2385 tests with one failure, ProjectionReconciliationTests.worldAndReconnectPair_yieldsOneGet. That suite is unrelated to this change and passed 8/8 when re-run alone.
  • Real app on both platforms against opencode v1 and v2, checked with frame-by-frame screen recordings: the worktree icon shows from the first frame, and a main-checkout session keeps its letter. Before/after frame strips are in the Session Chat header changes from branch to worktree after opening #783 comment.

Issue

Risks / Follow-ups

  • A cold open before Home has ever loaded its inventories (for example from a deep link) can still change once, after the fetch. A test covers it.
  • The main-checkout check was run on v2 only.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need.

ivanfenenko and others added 2 commits October 21, 2026 18:49
Session Chat seeded its top bar with the folder name and project letter and
only learned the session was a worktree checkout after its own inventory
fetch (added paths, current project, worktree list and v2 refresh), so the
subtitle switched from the letter to the worktree mark a moment after every
open.

Home now records its added paths and the worktree inventory each one loaded
in a shared WorktreeInventoryCache. Session Chat resolves its identity from
that cache synchronously when it is created, with the same badge predicate,
and keeps the fetch as a refresh: an agreeing answer changes nothing, and a
failed or unloaded inventory falls back to the last known one. Session Chat
records what it loads too, so a later open is immediate even without Home.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…droid

Same cause as on iOS: bind seeded the folder name and project letter, and
the worktree mark replaced it only after Session Chat's own inventory
fetch, about a second later on the emulator.

Home records its added paths and each worktree inventory in a singleton
WorktreeInventoryCache; Session Chat resolves its identity from it at bind
and keeps the fetch as a refresh that falls back to the last known
inventory when a load fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko marked this pull request as ready for review October 21, 2026 20:16
@ivanfenenko
ivanfenenko merged commit ba138ee into main Oct 21, 2026
@ivanfenenko
ivanfenenko deleted the fix/783-session-chat-worktree-header branch October 21, 2026 20:17
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.

Session Chat header changes from branch to worktree after opening

1 participant