Skip to content

fix: harden worktrees, session navigation, and usage menu#140

Merged
sasicodes merged 2 commits into
mainfrom
feat/fix-worktree-sessions-and-scroll
Jul 18, 2026
Merged

fix: harden worktrees, session navigation, and usage menu#140
sasicodes merged 2 commits into
mainfrom
feat/fix-worktree-sessions-and-scroll

Conversation

@sasicodes

@sasicodes sasicodes commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What changed

  • group managed worktree tasks under their primary repository instead of treating worktree folders as separate workspaces
  • make worktree creation transactional, report failures to the agent, and clean partial directories and generated branches safely
  • preserve worktree task discovery across nested and missing worktree paths
  • restore conversations at the bottom immediately and keep bottom anchoring stable while markdown hydrates
  • show OpenAI and Anthropic usage as two informational rows in the existing macOS status-item menu under Recent

Why

Worktree identity was derived from the raw task working directory, so managed worktrees leaked into the workspace picker. Failed worktree setup could also leave partial Git state or start an unintended local task. Restored virtualized conversations initially rendered the top range before bottom positioning.

Provider usage only needs a lightweight glanceable surface. The existing native status-item menu provides that without an Xcode widget target, app-group storage, generated project files, or custom signing.

Validation

  • pnpm check
  • 841 desktop tests

Greptile Summary

This PR strengthens worktree handling, session navigation, and provider usage display. The main changes are:

  • Groups managed worktrees under their primary repository.
  • Cleans up failed worktree creation and session setup paths.
  • Restores bottom-anchored conversations more consistently.
  • Adds OpenAI and Anthropic usage rows to the macOS status menu.

Confidence Score: 5/5

This looks safe to merge.

No blocking issues found in the changed code.

T-Rex T-Rex Logs

What T-Rex did

  • Before the test, T-Rex captured the desktop validation before-state log that records the requested typecheck invocation and the TypeScript commands, noting that the shell wrapper misrendered the exit-code header but the captured output includes __T_REX_EXIT_CODE__=0.
  • After the validation, T-Rex captured the desktop validation after-state log showing the command, working directory, exit code 1, a failure stack, and the final tallies: 1 failed | 134 passed (135) files and 1 failed | 843 passed (844) tests.
  • T-Rex confirmed that no source files were modified and that validation stopped after the proofs were produced and a failure occurred.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
packages/desktop/src/main/chat.ts Routes managed worktree creation through transactional cleanup and resolves worktree sessions to their primary workspace.
packages/desktop/src/main/git.ts Adds verification and cleanup for partially created Git worktrees.
packages/desktop/src/main/usage/index.ts Refreshes provider usage and removes unavailable or failed provider values.

Reviews (9): Last reviewed commit: "chore: bump desktop version to 0.1.0-alp..." | Re-trigger Greptile

@sasicodes
sasicodes force-pushed the feat/fix-worktree-sessions-and-scroll branch from 2fd8dfa to d5be07c Compare July 18, 2026 04:43
@sasicodes
sasicodes marked this pull request as ready for review July 18, 2026 04:49
Comment thread packages/desktop/scripts/sign-mac.js Outdated
Comment thread packages/desktop/scripts/widget-config.js Outdated
Comment thread packages/desktop/src/main/usage/index.ts
Comment thread packages/desktop/src/main/git.ts
@sasicodes
sasicodes force-pushed the feat/fix-worktree-sessions-and-scroll branch from 655657b to 714946b Compare July 18, 2026 05:07
@sasicodes sasicodes changed the title feat: add provider usage widget and harden worktree sessions fix: harden worktrees, session navigation, and usage menu Jul 18, 2026
@sasicodes
sasicodes force-pushed the feat/fix-worktree-sessions-and-scroll branch 6 times, most recently from dcd0e77 to 6d0a514 Compare July 18, 2026 06:29
@sasicodes
sasicodes force-pushed the feat/fix-worktree-sessions-and-scroll branch from 6d0a514 to 9455bb5 Compare July 18, 2026 06:45
@sasicodes
sasicodes merged commit aa322ea into main Jul 18, 2026
4 checks passed
@sasicodes
sasicodes deleted the feat/fix-worktree-sessions-and-scroll branch July 18, 2026 06:54
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