CLI exits 0 with no brief when next_need reports a refused token
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, rust
- Domain
- backend-api-design, cli
Research direction
Read the CLI path that handles next_need errors and compare it with the server-side token refusal path, which the issue says exits 2. Reproduce with an expired App token followed by a fresh token; confirm that a refused token exits non-zero with the documented message and that exit 0 produces a JSON brief.
Written by the indexing model from the issue text.
Description
Observed
mergeloop agent-labs-dev/nebula-mobile#2205 --after 481936a10fe9cfb3 (CLI mergeloop 0.1.0, run through the ~/bin/mergeloop shim that mints a merge-loop App installation token into MERGELOOP_TOKEN) exited 0 with no brief after a wait of more than an hour, on 2026-12-01:
mergeloop: agent-labs-dev/nebula-mobile#2205: Nothing new since `481936a10fe9cfb3`; waiting
mergeloop: https://mergeloop.ai does not take the GitHub token: check MERGELOOP_TOKEN or `gh auth status`
mergeloop shim: App token rejected (expired after a long wait); minted a new one, rerunning (1/20)
mergeloop: agent-labs-dev/nebula-mobile#2205: Nothing new since `481936a10fe9cfb3`; waiting
mergeloop: next_need: GitHub does not take this token.
exit 0
The first failure is the one-hour App token expiring (exit 2, handled by the shim). The second is new: with a freshly minted token, next_need reported a refused token and the CLI exited 0, the same code as "a brief was printed", without printing a brief. A caller that treats exit 0 as "work the brief" has nothing to work, and the PR is left unwatched.
Reproduction
Run mergeloop <repo#N> --after <id> on a PR held for a human review long enough (over an hour) for an App installation token in MERGELOOP_TOKEN to expire; let the wrapper re-mint and rerun.
Verified vs suspected
- Verified: exit 0 with
next_need: GitHub does not take this token.and no JSON brief, right after a rerun with a newly minted token. - Suspected: the CLI maps a token refusal from
next_needto a normal return instead of the exit 2 it uses for the server's token refusal; why the fresh token was refused (a cached old token, or a GitHub propagation delay for a just-minted installation token) is not established.
Expected
A refused token exits non-zero with the same documented sentence as the server-side refusal, so wrappers can re-mint; exit 0 only with a brief.
Related: #366 (same message after a rate-limit wait, exit 2). Duplicates checked: searched for "does not take this token", "next_need token", "exit 0"; none found.
- Dominant language
- Rust
- Stars
- 6
- Forks
- 0
- Avg merge
- 4h 17m
- Merged PRs (30d)
- 132
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agent-labs-dev/mergeloop
-
Batch PRs drop members' labels, so label-gated checks fail every batchPossibly taken @cjber claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
agent-labs-dev/mergeloop#372 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
agent-labs-dev/mergeloop#371 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
agent-labs-dev/mergeloop#370 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
agent-labs-dev/mergeloop#369 · 1 comment ·
Maintainers usually reply within 1 day
-
Queue ejects a PR for a resolver timeout on a rebase git replays cleanlyPossibly taken @cjber claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 49/100
agent-labs-dev/mergeloop#367 · 1 comment ·
Maintainers usually reply within 1 day
All issues in agent-labs-dev/mergeloop
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 64/100
storytold/designcraft#3477 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
area:plugins kind:bug priority:p3 ready
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
quarto-dev/q2#1446 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
MartinPTielemans/ilo#4637 ·