8000 fix(core): a thread branch avoids a tag or pseudo-ref by aorumbayev · Pull Request #172 · kagan-sh/kagan · GitHub
[go: up one dir, main page]

Skip to content

fix(core): a thread branch avoids a tag or pseudo-ref - #172

Merged
aorumbayev merged 11 commits into
mainfrom
fix/unique-branch-any-ref
Nov 30, 2026
Merged

aorumbayev merged 11 commits into
mainfrom
fix/unique-branch-any-ref

Conversation

@aorumbayev
@aorumbayev aorumbayev commented Nov 30, 2026 •
Copy link
Copy Markdown
Member

What

A new thread whose title matches a name git already answers to somewhere else — a tag, or the .git/opencode file the OpenCode CLI leaves — now starts on <name>-2 instead of failing with "refname is ambiguous".

Why

Starting an OpenCode thread died before the worktree existed, in both Terminal and Chat.

How

A name counts as free only when git rev-parse --verify finds nothing for it; checking branch names alone missed the pseudo-ref.

Notes

No issue to close; the report of the failure is this branch.

Test plan

  • New core test writes .git/opencode, starts a thread titled opencode, and expects branch opencode-2; it fails on the old code (verified) and passes with the fix.
  • cargo fmt --check, clippy with -D warnings, and all 689 kg-core tests.

@aorumbayev
Copy link
Copy Markdown
Member Author

Note on the branch history: the fatal-path fix (2111fe85) was committed before its regression test, which arrived in ca71f89e. The branch is pushed, and the repo forbids rewriting a pushed branch, so the squash into main carries the fix and the test together in one commit. The pseudo-ref fix carries its test in the same commit.

@aorumbayev aorumbayev changed the title fix(core): a new thread starts when its branch name is a tag or a git pseudo-ref fix(core): a thread branch avoids a tag or pseudo-ref Nov 30, 2026
@aorumbayev
aorumbayev merged commit a5ba341 into main Nov 30, 2026
20 checks passed
@aorumbayev
aorumbayev deleted the fix/unique-branch-any-ref 71DF branch November 30, 2026 22:00
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

0