Public: anyone can read this; the crew can change it.

An agent's own comment must never start its next run: the direction issue looped 27 times tonight #402

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

The loop is closed in four places. The full `bun test` run timed out in the sandbox, so I ran only the crew, autonomy, board, asks and map tests, plus the new loop test. They pass, and I haven't seen the rest of the suite.

shipped production is serving it deploy 2fa0c24

opened this

The loop is closed in four places. The full bun test run timed out in the sandbox, so I ran only the crew, autonomy, board, asks and map tests, plus the new loop test. They pass, and I haven't seen the rest of the suite.

Cause. route() in src/crew/dispatch.ts already ignored agent comments, so the declined run's own comment was not what started the next run. The loop was planIfThin in src/crew/autonomy.ts. Once 20 minutes had passed since the last planning run, it cleared the direction issue's assignment and gave it to the planner again. The planner declined, and that repeated every 20 minutes.

Changes

  • Decline reasons: a declined run no longer comments on the issue or pull (src/crew/runner.ts). The reason stays in the run's summary, and the run has its usual usage-ledger line as failed. I rewrote the crew.test.ts test that expected the comment.
  • Direction hand-off: when a planning run on the direction issue ends, settleAgentRun clears the assignment. planIfThin also won't re-ask a planner whose last run declined until a person comments on the issue.
  • Circuit breaker (src/crew/breaker.ts): three consecutive failed runs on an issue within an hour, with no person's comment since, trip it.

- queueAgentRun then refuses to queue, clears the assignee, and posts one "Parked by the crew: …" note, which shows as parked on the map. - planIfThin honours the breaker too. - A person's comment on the issue releases it.

  • Needs you: a parked issue appears in the asks list as a new parked kind, with a "Tell them" button (src/web/studio/asks.ts).
  • Tests: test/crew-loop.test.ts replays the sequence. After a declined planning run, the direction is released and not re-asked until a person speaks. Five agent comments on an assigned issue add no run. Three failures trip the breaker and a person's word releases it.

Not done

  • Agent-comment filter: it already existed, so the agent-comment test guards it rather than failing without my change. The breaker and decline tests do fail without it.
  • Person re-assigning: the breaker can't tell a person's assignment from the autonomy driver's, because the driver assigns as the person who turned autonomy on. Only a comment frees a parked issue.
  • Board usage: I added nothing new. Each looped run already has a failed ledger line, and I didn't touch the board's usage rendering.

Try it: bun test test/crew-loop.test.ts.

🤖 Generated with Claude Code

Closes #383

commented

The failed check is fixed and pushed. It was a type error: the new parked ask kind was missing from the feed's urgency table in src/feed/items.ts. I added it, ranked just above paused. I also made a parked ask link to /issues/N instead of /changes/N, since it is about an issue.

tsc --noEmit is clean. The feed, feed-page, asks and loop tests pass. I did not run the full check command, so the other test files in it have not been run since this fix.

The pull's description is unchanged: it's the one from my earlier message about the circuit breaker, the missing decline comments, and the direction being released after a planning run.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs