Skip to content

1.0.60

Choose a tag to compare

@morapelker morapelker released this 12 Mar 17:42
· 2690 commits to main since this release

What's Changed

Hide archive button for default worktrees (#127)

  • Prevent archiving default worktrees: The "Archive Worktree" button was previously shown for all worktrees with merged branches, including the default (primary) worktree. Archiving the default worktree is invalid and would break the project, so the button is now hidden for default worktrees.
  • GitPushPull.tsx: Added a isSelectedBranchDefaultWorktree memo that looks up whether the selected branch's worktree is the project default. The archive button in the cross-worktree merge panel is now conditionally hidden when the target is a default worktree.
  • Header.tsx: Added a !selectedWorktree?.is_default guard to the merged-PR archive button, preventing it from appearing when viewing the default worktree.

Prefix worktree directories with project name (#126)

  • Prefixes worktree directory names with the project name using the format <projectName>--<breedName> instead of just <breedName>. This applies to all three worktree creation paths: standard creation, forking (versioned branches), and PR checkout.
  • Updates the existing-directory scan to strip the <projectName>-- prefix before checking for breed name collisions, ensuring unique name selection continues to work correctly with the new naming scheme.

Why

When multiple projects share the same parent worktrees directory (~/.hive-worktrees/hive-electron/), worktree folders like golden-retriever give no indication of which project they belong to. Prefixing with the project name (e.g., my-project--golden-retriever) makes it immediately clear which project owns each worktree directory, improving discoverability and reducing confusion when browsing the filesystem.

Changes

All changes are in src/main/services/git-service.ts:

  1. createWorktree — Directory now created as <projectName>--<breedName>; filesystem scan strips prefix before uniqueness check.
  2. forkWorktree — Directory now created as <projectName>--<newBranchName>.
  3. checkoutPR — Directory now created as <projectName>--<breedName>; filesystem scan strips prefix before uniqueness check.

Add multi-provider usage tracking (Anthropic + OpenAI) (#124)

  • OpenAI usage backend: New openai-usage-service.ts in main process that reads Codex credentials from ~/.codex/auth.json or macOS Keychain, handles JWT token decoding/expiry/refresh with deduplication, and fetches usage data from the OpenAI WHAM endpoint with 401 retry logic
  • IPC & preload bridge: Added usage:fetchOpenai IPC channel and exposed window.usageOps.fetchOpenai() to the renderer
  • Dual-provider usage store: Rewrote useUsageStore to track Anthropic and OpenAI usage independently with separate state, debounce timers, and loading flags. Added fetchUsageForProvider(provider), setActiveProvider(provider), and backward-compatible fetchUsage()
  • Shared helpers: Exported resolveUsageProvider(session) (infers provider from agent_sdk, model_provider_id, or model_id) and normalizeUsage(provider, anthropicUsage, openaiUsage) (converts OpenAI data into the common UsageData shape)
  • Shared types: Added UsageProvider, OpenAIUsageData, and OpenAIUsageResult types in src/shared/types/usage.ts
  • Provider-aware UI: UsageIndicator now detects the active session's provider, shows the corresponding icon (Claude/OpenAI), uses normalizeUsage for unified display, has a dynamic tooltip title, and only renders Anthropic extra_usage credit info
  • Provider-aware global listener: useOpenCodeGlobalListener resolves the idle session's provider on completion and calls fetchUsageForProvider instead of the generic fetchUsage