Repository navigation
fix(mecatui): handle model selection in worktrees better - #1567
Merged
Merged
Conversation
/models persisted its pick keyed by the literal workspace realpath, so every git worktree of one repo got its own independent entry — a worktree switch is no more a model-relevant event than a branch switch in a single checkout, which never changes the model. A workspace inside a git linked worktree now resolves its models.yaml key to the main checkout's root (read from git's on-disk worktree pointer files, no `git` subprocess), so a pick made in any worktree lands on the same entry as the others. An ordinary checkout keeps its own realpath key, unchanged, so existing entries aren't invalidated. Co-Authored-By: Claude Sonnet 5 <[email protected]>
kantord
marked this pull request as ready for review
September 15, 2026 13:36
samuv
reviewed
Sep 15, 2026
samuv
reviewed
Sep 15, 2026
…loss Two bugs samuv flagged on the worktree-identity unification: - A worktree of a BARE repository resolved to the parent of the bare repo's own directory, since a bare repo has no working-tree root. Worktrees of any two bare repos sharing a parent directory then collided onto one entry. Detect bareness from the repo's own "config" (git's own bare=true marker) and fall back to the worktree's own realpath when bare. - A workspace nested below a linked worktree's root collapsed onto the bare main checkout root, discarding its offset — while the identical nested path under the main checkout kept its own distinct entry. Rejoin the workspace's offset below the discovered worktree root onto the main root, so a nested launch directory keeps the same identity it would have under the main checkout directly. Co-Authored-By: Claude Sonnet 5 <[email protected]>
samuv's follow-up: bareTrueRE only matched the literal string "true",
so "core.bare = yes" (a valid git boolean-true spelling git itself
accepts) still collided worktrees of different bare repos onto one
entry.
Replace it with a conservative check: unify onto the common dir's
parent ONLY when config names an explicit false-equivalent value
("false"/"no"/"off"/"0"); every true-equivalent spelling, a missing
key, and any unrecognized value fail closed as bare. Covered by a new
isBareGitDir table test plus a "bare = yes" regression on top of the
existing bare-repo test.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Merged
2 tasks
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
/modelspersisted its pick keyed by the literal workspace realpath, so every git worktree of one repo got its own independent entry inmodels.yaml.models.yamlkey to the main checkout's root (read from git's on-disk worktree pointer files, nogitsubprocess). An ordinary checkout keeps its own realpath key, unchanged — existing entries for a main checkout are not invalidated.Test plan
task lint— 0 issuestask test— full suite green (-race)task docs:check— 0 broken linksFully or partially written by an AI agent.
🤖 Generated with Claude Code