Skip to content

fix(tasks): a fresh attempt never reuses a branch an interrupted one left behind - #262

Merged
hoangsnowy merged 1 commit into
mainfrom
fix/fresh-attempt-branch
Oct 22, 2026
Merged

hoangsnowy merged 1 commit into
mainfrom
fix/fresh-attempt-branch

Conversation

@hoangsnowy

Copy link
Copy Markdown
Owner

Summary

VNChessAcademy #15 (game viewer) did all its work on the lab — build, 287/287 .NET + 74/74 Vitest, bundle 110 KB gzip — and couldn't push: issue-15-ai-fix already existed from an attempt a restart had cut short, so the push was non-fast-forward, and scoped autonomy rightly forbids force-push. The task ended "Couldn't finish".

The server now picks a fresh attempt's branch: the first of issue-N-ai-fix, -2 … -9 not on the remote (IPrCreationService.BranchExistsAsync, GitHub), passed as WorkRepo.NewBranch and used everywhere in the prompt. Follow-ups (Ask for changes / Fix checks) still continue on their PR's branch; when the check fails, the default name is kept.

Test plan

  • FreeBranchTests: default when free / next free when taken / default when uncheckable or no ticket number.
  • IssueWorkRevisionPromptTests: the server-picked branch is used in both prompt modes + the user message.
  • Full suite green locally.
  • Lab: Try again on Refactor/modular monolith #15 → pushes issue-15-ai-fix-2, opens a PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB

…left behind

On the lab, #15 (the game viewer) finished its work — build, 287 .NET and 74 Vitest tests green — and could not push:
issue-15-ai-fix already existed from an attempt a restart cut short, the push was rejected as non-fast-forward, and
the agent may not force-push. The server now picks the branch of a fresh attempt: the first of issue-N-ai-fix, -2 … -9
that is not on the remote (IPrCreationService.BranchExistsAsync), passed as WorkRepo.NewBranch and used throughout
the prompt. Follow-ups still continue on their pull request's branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
@hoangsnowy
hoangsnowy merged commit 23afa56 into main Oct 22, 2026
4 checks passed
@hoangsnowy
hoangsnowy deleted the fix/fresh-attempt-branch branch October 23, 2026 00:42
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