diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-06 00:07:18 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-06 00:07:18 +0000 |
| commit | 7466b1751c4126735769a3304e1db80dab166a9e (patch) | |
| tree | c5d0fe9d1018e62e3857480d471a0f6f8ebee104 /scripts | |
| parent | a33211d0ad07f5aaf2d8bb51ba18e6790a153bb4 (diff) | |
feat: blocked task state for agent questions via session resume
When an agent needs user input it writes a question to
$CLAUDOMATOR_QUESTION_FILE and exits. The runner detects the file and
returns BlockedError; the pool transitions the task to BLOCKED and
stores the question JSON on the task record.
The user answers via POST /api/tasks/{id}/answer. The server looks up
the claude session_id from the most recent execution and submits a
resume execution (claude --resume <session-id> "<answer>"), freeing the
executor slot entirely while waiting.
Changes:
- task: add StateBlocked, transitions RUNNING→BLOCKED, BLOCKED→QUEUED
- storage: add session_id to executions, question_json to tasks;
add GetLatestExecution and UpdateTaskQuestion methods
- executor: BlockedError type; ClaudeRunner pre-assigns --session-id,
sets CLAUDOMATOR_QUESTION_FILE env var, detects question file on exit;
buildArgs handles --resume mode; Pool.SubmitResume for resume path
- api: handleAnswerQuestion rewritten to create resume execution
- preamble: add question protocol instructions for agents
- web: BLOCKED state badge (indigo), question text + option buttons or
free-text input with Submit on the task card footer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/deploy | 6 | ||||
| -rwxr-xr-x | scripts/start-next-task | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/scripts/deploy b/scripts/deploy index 4722dab..0b8e162 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -18,6 +18,12 @@ export GOPATH="${SITE_DIR}/cache/gopath" mkdir -p "${GOCACHE}" "${GOPATH}" go build -o "${BIN_DIR}/claudomator" ./cmd/claudomator/ +echo "==> Copying scripts..." +mkdir -p "${SITE_DIR}/scripts" +cp "${REPO_DIR}/scripts/"* "${SITE_DIR}/scripts/" +chown -R www-data:www-data "${SITE_DIR}/scripts" +chmod +x "${SITE_DIR}/scripts/"* + echo "==> Fixing permissions..." chown www-data:www-data "${BIN_DIR}/claudomator" chmod +x "${BIN_DIR}/claudomator" diff --git a/scripts/start-next-task b/scripts/start-next-task index 1e45eb3..da019b6 100755 --- a/scripts/start-next-task +++ b/scripts/start-next-task @@ -12,4 +12,4 @@ if [[ -z "$task_id" ]]; then exit 0 fi -echo claudomator start "$task_id" +claudomator start "$task_id" |
