Repository navigation
#700 Mark worktree sessions on Home - #704
Merged
Merged
Conversation
Badge a Home letter when the session directory is a listed worktree other than the added path, and name that checkout in Session Chat.
Collaborator
Author
|
@cursor review |
ivanfenenko
marked this pull request as ready for review
October 16, 2026 20:54
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c674579. Configure here.
Refetch after refresh so a dropped worktree.updated cannot leave the pre-refresh list, and cancel a stale Session Chat refine before it publishes.
A worktree.updated during load can no longer apply the pre-refresh list after loadRefreshed. A cancelled Session Chat refine also stops before it publishes or rewrites checkout ids.
Keep worktree wiring and the main session-events import.
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
GET /api/worktree?projectID=, thenPOST /api/worktree/refresh, and refetches the list onworktree.updated. V1 probesGET /experimental/workspace; a 404 stops that probe until the next connect, and V2 does not call it.Checks
WorktreeMarkTest,WorkspaceDirectoryParserTest,DefaultWorktreeRepositoryTest,WorktreesApiTest, andCrossProjectSessionListSessionsTestpassed.WorktreeMarkTestspassed.OpenCode Mobiletest build succeeded.Issue
Risks / Follow-ups
{ data: [{ directory }] }). A live V1 server was not probed.Need help on this PR? Tag
@codesmithwith what you need.Note
Medium Risk
Touches Home session merging, live SSE refetch, and V1/V2 server protocol branching; incorrect inventory or merge logic could show wrong badges or duplicate/missing sessions.
Overview
Adds worktree inventory on Android and iOS so Home and Session Chat can tell when a session runs in a listed checkout rather than the added project path.
Data & sync: New
WorktreesApi/WorktreesAPIClientandDefaultWorktreeRepositoryload directories via V2 (GET /api/worktree,POST /api/worktree/refresh) or V1 (GET /experimental/workspacewith tolerant JSON parsing). V1 404 stops probing until reconnect. Home view models load inventories per added project, optionally merge sessions from other workspace directories (V1), and refetch onworktree.updatedSSE events (namedProjectIdon events).UI:
WorktreeMarkdrives a CallSplit badge on the project letter when the session directory is a loaded checkout (not the added path). Session Chat swaps the project letter for the worktree icon and checkout name (last path segment). Component galleries document the new states.DI / tests: Hilt and
AppContainerwire worktree + project repos; view models default to no-op repos/streams for tests. Unit tests cover API, repository protocol behavior, parsing, and badge rules.Reviewed by Cursor Bugbot for commit c674579. Bugbot is set up for automated code reviews on this repo. Configure here.