review: single-writer RunMulti state; support disabling the inspector timeout

main

Commit

dipree2mo ago

Three review notes:

  • timedOut publication (high, 4th flag on this area): make perAgentState single-writer instead of relying on the WaitGroup happens-before for cross-goroutine field writes. Per-agent goroutines now send a terminal marker over fanIn carrying waitErr/finishedAt/timedOut; the dispatch loop (one goroutine) performs every perAgentState write. No cross-goroutine field sharing remains, so the post-loop reads are safe by construction. 'go test -race' clean.

  • timeout disable (low): inspectorTimeout now distinguishes unset (0 -> default 10m), explicit positive, and negative (-> 0 == disabled). Run and RunMulti only wrap a deadline when timeout > 0. '--timeout 0' maps to the negative disable sentinel at the flag boundary so the RunConfig zero value still means 'use default'. Added TestInspectorTimeout.

  • modelComponentsMatch off-by-one (medium): false positive — at the max offset the following component is long's last element (exists), so the span is never a suffix; the suffix window is excluded by '<'. Clarified the comment and added a boundary test (next component is the last).

Entire-Checkpoint: 1a7f1bf3f1ec

Checkpoints

Checkout the hand off doc that I just added.

PiOpus 4.8
View session
Checkpoint 1