Repository navigation
agents: fix --issue next loop + harden the plugin - #9
Merged
Merged
Conversation
`mind agents start --issue <ref>` read the issue body but never claimed it, so the issue stayed in `ready-for-agent` (handoff: agent) and `agentQueue` kept returning it at the head — `--issue next` re-picked the same issue on every run, no matter how many times the agent ran. Claim the issue on launch (→ in-progress, with config.coordination.claimTtl) after the PATH check and before spawn, mirroring `mind issues next --claim`. A crash mid-run leaves it in-progress until the ttl lapses, then it returns to the queue. `--no-claim` keeps the old loose coupling; `--force` steals a live claim; `--dry-run` reports whether it would claim without spawning. The agent still never *closes* the issue — a human reviews and closes. Two spawnSync integration tests (fake `codex` on PATH, no model call) prove the claim advances the queue and that `--no-claim` leaves it claimable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up hardening of the agents plugin: - Fold the tracker only once per `--issue` run. `loadIssue` now returns the folded `cfg` alongside the issue, so the claim path reuses it instead of re-folding (which re-read every event file). - Personas can set `claim: false` in frontmatter — read-only personas (e.g. `guide`) then inspect an issue without claiming it. Added `isFalsey()` for lenient frontmatter booleans (false/no/0/off). - `mind agents list` now resolves each persona's effective backend and whether it's installed: the table flags `(not installed)` / `(unknown)` backends, and `--json` carries `backend`/`backendInstalled`/`backendKnown` per persona. - `onPath` splits on `path.delimiter` instead of a hardcoded `:` (cross-platform). - Corrected the stale backends header comment (codex prepends the persona; it does not use a config-file override). Tests: isFalsey unit, readPersonas carries `claim`, a `claim: false` persona doesn't claim, and `list --json` backend-health flags. 42/42 green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
--issue next advances--issue next loop + harden the plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Running the coding agent repeatedly kept landing on the same issue:
mind agents start coder --issue nextalways re-picked the head of the queue.Root cause —
--issue <ref>read the issue body but never claimed it, so the issue stayedready-for-agent(handoff: agent) andagentQueuereturned it at the head every run. The intended loop (mind issues next --claim) transitions the pick toin-progress, which removes it from the queue — the launcher skipped that.Fix: claim on launch
Claim the issue on launch (→
in-progress, withconfig.coordination.claimTtl), after the PATH check and before spawn — reusingassertClaimable+appendEvent. The next--issue nextthen advances.in-progressuntil the ttl lapses, then it returns to the queue (⏱stale mark) — no work lost.--no-claimkeeps the old read-only coupling;--forcesteals a live claim;--dry-runreports whether it would claim without spawning.Plus: hardening / improvements
--issuerun —loadIssuereturns the foldedcfg, so the claim path no longer re-folds (re-reading every event file).claim: falsein frontmatter (e.g.guide) inspects an issue without claiming it. Added lenientisFalsey()for frontmatter booleans.mind agents listbackend health: the table flags(not installed)/(unknown)backends, and--jsoncarriesbackend/backendInstalled/backendKnownper persona.onPathsplits onpath.delimiter(cross-platform) instead of a hardcoded:.Tests
spawnSyncintegration tests (fakecodexonPATH, no model call): claim advances the queue,--no-claimandclaim: falseleave it claimable, andlist --jsonreports backend health. PlusisFalsey+readPersonasunits. 42/42 green.🤖 Generated with Claude Code