Skip to content

fix(claude): fetch and resolve stale branches before spawn-quest triages - #3405

Merged
kixelated merged 1 commit into
mainfrom
claude/spawn-quest-fetch-stale
Sep 4, 2026
Merged

fix(claude): fetch and resolve stale branches before spawn-quest triages#3405
kixelated merged 1 commit into
mainfrom
claude/spawn-quest-fetch-stale

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

What

Follow-up to #3403, which merged before these two review findings were addressed. Both are in the skill's triage half rather than its spawning half.

git fetch origin ran too late. It was documented in the Spawning section, which comes after the claim scan. The remote branch is the coordination mechanism, so a stale remote-tracking ref means offering the user a quest another agent already holds, and the spawned agent finds out only when its claim push is rejected. That wastes the user's selection and an agent slot. The fetch now comes before the scan.

A stale branch was something to mention, not something to resolve. The skill said to say when a branch is stale so it could be reused or deleted, then never told anyone to do it. Left in place, the agent's instruction to cut the same branch fresh and push without force fails as non-fast-forward, and the agent reports that as a lost claim race that never happened. A stale local branch blocks branch creation even earlier. The skill now says to inspect the tip and either reuse the work or delete the ref, and only when it is confirmed stale, not checked out, and carrying no unmerged commits; anything else is treated as claimed and leaves the pool.

The second rule is what start-quest already does, so this brings the two skills into agreement rather than inventing a policy. It is also not hypothetical in this repository: there are six stale quest/m1/perf/* branches right now, and a /spawn-quest m1 run that offered one of them would have produced exactly the false race report described above.

Checks

just fix and just check both exit 0. The diff is one Markdown file under .claude/, so the dispatch correctly reports js: no JS changes; skipping and runs no Rust, Python, or quest validation.

🤖 Generated with Claude Code

(Written by Claude Opus 5)

Two more review findings, both in the triage half rather than the
spawning half.

git fetch origin was documented in the Spawning section, which runs
after the claim scan. The remote branch is the coordination mechanism,
so a stale remote-tracking ref means offering a quest another agent
already holds, and the spawned agent discovers it only when its push is
rejected. Moved the fetch ahead of the scan.

A stale branch was something to mention, with no instruction to resolve
it. Left in place it makes the agent's claim push fail as
non-fast-forward, which the agent then reports as a lost claim race
that never happened, and a local stale branch blocks branch creation
outright. The skill now says to inspect the tip and either reuse the
work or delete the ref, and only when it is confirmed stale, not
checked out, and carries no unmerged commits. Anything else is treated
as claimed. This matches what start-quest already does, and it is not
hypothetical here: six stale quest/m1/perf/* branches exist right now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 9136cd4e-6130-4c12-bf78-4b18dfd1563b

📥 Commits

Reviewing files that changed from the base of the PR and between 3827f0b and 2558290.

📒 Files selected for processing (1)
  • .claude/skills/spawn-quest/SKILL.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T23:34:33.214352Z 2558290 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated
kixelated enabled auto-merge (squash) September 4, 2026 23:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25582909b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +22 to +24
never happened. Inspect its tip: reuse the work, or delete the ref only when it
is confirmed stale, is not checked out, and has no unmerged commits. Otherwise
treat the quest as claimed and take it out of the pool.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow stale placeholder branches to be reclaimed

When an agent abandons a quest before opening a PR, its required UUID placeholder commit is itself an unmerged commit, so the branch can never satisfy this deletion condition. The fallback then treats the stale branch as claimed and removes the quest from the pool indefinitely, while the vague “reuse the work” path conflicts with the later instruction to cut a fresh branch from the base. Explicitly allow a confirmed placeholder-only branch to be deleted or specify how the spawned agent should resume it. (Written by GPT-5.6 Sol)

Useful? React with 👍 / 👎.

@kixelated
kixelated merged commit 9b90ea5 into main Sep 4, 2026
2 checks passed
@kixelated
kixelated deleted the claude/spawn-quest-fetch-stale branch September 4, 2026 23:34
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