Skip to content

fix(desktop): show git worktrees as the main repository - #16

Merged
Aforno merged 4 commits into
mainfrom
t3code/fix-worktree-project-identity
Aug 28, 2026
Merged

fix(desktop): show git worktrees as the main repository#16
Aforno merged 4 commits into
mainfrom
t3code/fix-worktree-project-identity

Conversation

@Aforno

@Aforno Aforno commented Aug 28, 2026

Copy link
Copy Markdown
Owner

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 through ProjectIdentity: a .git file with gitdir: plus commondir (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 test
  • swift test -c release
  • ./script/package_release.sh --adhoc
  • ./script/check_repository.sh
  • Packaged-app UI/runtime smoke test, when applicable

Covered in unit tests: linked worktrees, relative gitdir, bare repos, Claude-style nested worktrees, and separate git dirs without commondir. 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. workingDirectory on sessions and hook events is unchanged; projectName is derived at read time by inspecting .git on 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.

- Label worktree sessions with the main repo folder, not the worktree path
- Apply that name in the list, activity center, notifications, and notch
Copilot AI lite review requested due to automatic review settings August 28, 2026 18:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Aforno added 3 commits August 28, 2026 19:29
- 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
@Aforno
Aforno merged commit 9813485 into main Aug 28, 2026
2 checks passed
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.

2 participants