From cf83444a9d341ae362e65a9f995100c69176887c Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 5 Mar 2026 18:51:50 +0000 Subject: Rescue work from claudomator-work: question/answer, ratelimit, start-next-task Merges features developed in /site/doot.terst.org/claudomator-work (a stale clone) into the canonical repo: - executor: QuestionRegistry for human-in-the-loop answers, rate limit detection and exponential backoff retry (ratelimit.go, question.go) - executor/claude.go: process group isolation (SIGKILL orphans on cancel), os.Pipe for reliable stdout drain, backoff retry on rate limits - api/scripts.go: POST /api/scripts/start-next-task handler - api/server.go: startNextTaskScript field, answer-question route, BroadcastQuestion for WebSocket question events - web: Cancel/Restart buttons, question banner UI, log viewer, validate section, WebSocket auto-connect All tests pass. Co-Authored-By: Claude Sonnet 4.6 --- internal/executor/executor.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/executor/executor.go') diff --git a/internal/executor/executor.go b/internal/executor/executor.go index d25d3b4..51f468e 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -24,9 +24,10 @@ type Pool struct { store *storage.DB logger *slog.Logger - mu sync.Mutex - active int - resultCh chan *Result + mu sync.Mutex + active int + resultCh chan *Result + Questions *QuestionRegistry } // Result is emitted when a task execution completes. @@ -46,6 +47,7 @@ func NewPool(maxConcurrent int, runner Runner, store *storage.DB, logger *slog.L store: store, logger: logger, resultCh: make(chan *Result, maxConcurrent*2), + Questions: NewQuestionRegistry(), } } -- cgit v1.2.3