Disable session resume UI for worktree chats#67
Merged
mcintyre94 merged 4 commits intomainfrom Mar 12, 2026
Merged
Conversation
Worktrees are always fresh so there's nothing to resume — suppress the SessionSuggestionsView entirely and skip the remote session fetch when worktreePath is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code reviewMissing unit test for modified view model logic (CLAUDE.md) CLAUDE.md requires: "Add new unit tests when adding or modifying logic (models, parsers, utilities, view models)"
A test verifying that Relevant code: wisp/Wisp/ViewModels/ChatViewModel.swift Lines 226 to 231 in 1b9c8ca |
Verifies that fetchRemoteSessions is a no-op for worktree chats: remoteSessions stays empty and isLoadingRemoteSessions stays false, confirming no network work is initiated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
worktreePath is nil on a new chat — the worktree is only created on the first message. The previous guard checked worktreePath != nil, so it missed the case where worktrees are enabled but not yet set up. Add usesWorktree computed property that returns true when worktreePath is set OR worktreePerChat is enabled, and use it in both fetchRemoteSessions and the ChatView visibility guard. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Checking UserDefaults["worktreePerChat"] was too aggressive — it hid the sessions UI on sprites without git, where worktree setup silently fails and sessions remain valid. Instead, query sibling SpriteChats for the same sprite: if any have worktreePath set, the sprite has git and new chats should suppress the resume UI. Also set spriteUsesWorktrees = true immediately when a worktree is first created, so subsequent new chats on the same sprite are handled correctly without relying on session reload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
fetchRemoteSessionsexits early whenworktreePathis set, avoiding a wasteful exec callworktreePathchanged fromprivatetoprivate(set)soChatViewcan read itTest plan
🤖 Generated with Claude Code