CLI --after <id> replays a resolved need instead of waiting for the next one

Open
#305 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
54/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github, rust

Research direction

Start by locating the CLI handling for --after and the code that creates or returns needs; compare how the threads need is handled after resolution with the current human review hold. Trace the reproduction using the two example PRs or equivalent need transitions. Done means the command returns only a newer need and does not replay the resolved need id.

Written by the indexing model from the issue text.

Description

Observed

mergeloop agent-labs-dev/nebula#12024 --after 8d59c6d6ba92823c exits at once with needs: threads ("1 review comment is unresolved"), and its then repeats the same --after 8d59c6d6ba92823c. The same happens for #12224 with --after 7c3df3885f1a4535.

At that moment nothing is unresolved:

  • GitHub: #12024 has 1 review thread, 0 unresolved; #12224 has 3, 0 unresolved.
  • mergeloop call pull_status for both: queue.state: held, hold.reason: review_required ("waiting for a required review").

Running the same command without --after returns the current need correctly: needs: human, "waiting for a required review", with a new id 5e3bc4e930b614d6.

Expected

--after <id> returns only a need newer than <id>. When the need <id> has already been answered (here, its threads resolved and the PR moved to a review hold), it should return the current need, not replay <id>.

Impact

A follower re-armed with the documented then command exits immediately and tells the agent to work threads that no longer exist. Following the brief means looping on a stale need; a background follower never waits on the human hold.

Reproduction

  1. Get a needs: threads need for a PR and note its id.
  2. Resolve the threads (no push), so the PR moves to another hold such as a required code owner review.
  3. Run the then command, mergeloop <repo>#<n> --after <id>: it returns the same threads need and id at once.

CLI from cli-latest, run 2026-11-09 around 12:20 UTC.

Dominant language
Rust
Stars
6
Forks
0
Avg merge
4h 17m
Merged PRs (30d)
132

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from agent-labs-dev/mergeloop

All issues in agent-labs-dev/mergeloop

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.