fix(desktop): show git worktrees as the main repository - #16
Merged
Conversation
- Label worktree sessions with the main repo folder, not the worktree path - Apply that name in the list, activity center, notifications, and notch
- Store projectName on AgentSession instead of deriving it live from the working directory - Reuse the stored name when a completed worktree path no longer has git metadata - Decode legacy sessions by falling back to the working directory
- Keep finished sessions in Activity Center for at most 7 days - Drop the retention picker and clamp older 30/90/365-day prefs - Prune on a timer so idle apps cannot keep expired sessions
- Replace the fixed 7-day Local History label with a 3- or 7-day picker - Apply the chosen retention immediately and prune older completed sessions
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
Agent sessions in a linked git worktree were labeled with the worktree folder (
t3code-…, Claude nested worktrees, and similar) instead of the main repository. Project names now resolve throughProjectIdentity: a.gitfile withgitdir:pluscommondir(or a/.git/worktrees/path) maps to the main checkout, including relative gitdirs and bare repos. Ordinary directories still use the folder name.That name is the single source for agent rows, detail, notch, activity center, notifications, and start-event task placeholders.
Verification
swift testswift test -c release./script/package_release.sh --adhoc./script/check_repository.shCovered in unit tests: linked worktrees, relative
gitdir, bare repos, Claude-style nested worktrees, and separate git dirs withoutcommondir. Smoke a live worktree session in the agent list, activity center, notch, and a notification to confirm the main repository name.Compatibility and risk
Display-only.
workingDirectoryon sessions and hook events is unchanged;projectNameis derived at read time by inspecting.giton disk. No persistence, protocol, signing, or migration changes. Resolution falls back to the folder name if the git metadata is missing or unreadable.Screenshots
Label-only change across agent list, detail, notch, activity center, and notifications. Attach before/after of a worktree session if available.