summaryrefslogtreecommitdiff
path: root/web/style.css
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-06 00:07:18 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-06 00:07:18 +0000
commit7466b1751c4126735769a3304e1db80dab166a9e (patch)
treec5d0fe9d1018e62e3857480d471a0f6f8ebee104 /web/style.css
parenta33211d0ad07f5aaf2d8bb51ba18e6790a153bb4 (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 'web/style.css')
-rw-r--r--web/style.css44
1 files changed, 44 insertions, 0 deletions
diff --git a/web/style.css b/web/style.css
index 1478b36..91466ee 100644
--- a/web/style.css
+++ b/web/style.css
@@ -8,6 +8,7 @@
--state-timed-out: #c084fc;
--state-cancelled: #9ca3af;
--state-budget-exceeded: #fb923c;
+ --state-blocked: #818cf8;
--bg: #0f172a;
--surface: #1e293b;
@@ -181,6 +182,7 @@ main {
.state-badge[data-state="TIMED_OUT"] { background: var(--state-timed-out); }
.state-badge[data-state="CANCELLED"] { background: var(--state-cancelled); }
.state-badge[data-state="BUDGET_EXCEEDED"] { background: var(--state-budget-exceeded); }
+.state-badge[data-state="BLOCKED"] { background: var(--state-blocked); }
/* Task meta */
.task-meta {
@@ -294,6 +296,48 @@ main {
cursor: not-allowed;
}
+.task-question-text {
+ font-size: 0.82rem;
+ color: var(--text);
+ margin: 0 0 0.5rem 0;
+ line-height: 1.4;
+ width: 100%;
+}
+
+.task-answer-row {
+ display: flex;
+ gap: 0.375rem;
+ width: 100%;
+}
+
+.task-answer-input {
+ flex: 1;
+ font-size: 0.8rem;
+ padding: 0.3em 0.6em;
+ border-radius: 0.375rem;
+ border: 1px solid var(--border);
+ background: var(--bg);
+ color: var(--text);
+}
+
+.btn-answer {
+ font-size: 0.8rem;
+ font-weight: 600;
+ padding: 0.35em 0.85em;
+ border-radius: 0.375rem;
+ border: none;
+ cursor: pointer;
+ background: var(--state-blocked);
+ color: #0f172a;
+ transition: opacity 0.15s;
+ margin-right: 0.375rem;
+}
+
+.btn-answer:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
.task-error {
font-size: 0.78rem;
color: var(--state-failed);