Commit Graph
3 Commits
Author SHA1 Message Date
Theo BrowneandClaude Fable 5 2ff63fb2b7 Address round-2 review feedback
- Ignore review-thread activity whose latest comment is the viewer's own
  reply, breaking the self-triggered wake cycle
- Retry boot reconciliation on the first successful poll instead of
  swallowing a failed shell snapshot at startup
- Remove the registration when archive teardown dispatch fails so
  archived threads are never polled or woken again
- Stamp wake claims with the turn command's createdAt so provider
  turn-start failures (which echo that timestamp) match the release
  condition; a fresh post-dispatch timestamp could never match

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 19:39:42 -07:00
Theo BrowneandClaude Fable 5 e5ea2c65d2 Address review feedback from Bugbot and Macroscope
- Stop prepareMcpSession ending the active monitor on session start
  (session recycles no longer kill their own babysit)
- Fail closed at the wake send boundary: a failed fresh PR fetch discards
  the wake instead of falling back to the stale poll state
- Correlate provider.turn.start.failed releases by dispatch time and
  rewind wakeCount alongside the cursor
- Monotonic generation allocator; generation-conditional
  updateCursor/incrementWake/remove so stale polls can't mutate a
  newer monitor
- Dispatch thread.monitor.end before removing the registration in
  session teardown; end monitors on thread.archived
- Preserve wakeCount on idempotent monitor.start replay (breaker can't
  be reset)
- Key check-run cursors by head SHA + name + run id; detect
  resolved→unresolved thread reopens
- Human changes-requested reviews now block readiness
- Thread monitoringStartedAt from the registration so pre-existing
  unresolved threads don't block readiness forever
- Use the PR's base ref in the wake prompt instead of hard-coded main
- Boot reconcile: threads projecting "monitoring" with no registration
  are ended as session-ended

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 19:39:42 -07:00
Theo BrowneandClaude Fable 5 63e07db893 Add PR monitoring: server-driven babysit mode for agent threads
Threads can now formally monitor a PR after creating it. The agent calls a
new monitor_start MCP tool; a dedicated PullRequestMonitor service polls
GitHub every 30s, diffs review comments / reviews / check runs against a
per-thread cursor, and wakes the thread with a self-contained prompt when
there is something to address. The server — never the agent — declares the
PR ready from head-SHA-anchored GitHub state.

- GitHub monitor snapshot fetch (reviews, threads, check runs, mergeability)
  with pure cursor-diff and readiness modules
- thread.monitor.start/update/end domain events through decider/projector,
  monitor state on the thread shell, migration 034 (monitor_json)
- Wake dispatch protocol: claim → fresh terminal revalidation at the send
  boundary → dispatch → cursor ack only after accepted start; user turns
  always win and rewind in-flight wake cursors so events re-diff; 10-wake
  circuit breaker ends as needs-attention
- Monitoring holds the thread unsettled; user settle ends the monitor;
  session teardown ends it as session-ended
- UI: steady cyan Monitoring pill (never masks approval/input/failed),
  blockers sub-line, header MonitorStrip with Stop, emerald Ready-to-merge
  state with confirm dialog; clients can only end a monitor as "stopped"

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 19:39:42 -07:00