Answer the first round: resume the worker with the records' answer to its question, read docs/decisions.md alone, scope --help's promise

This commit is contained in:
2026-10-03 00:35:40 +02:00
parent 6d5d19bd69
commit 6340e5a993
11 changed files with 100 additions and 54 deletions
+5 -5
View File
@@ -52,9 +52,9 @@ def stopped(cycle: Cycle, stop: Stop, why: str) -> Stop:
def step(cycle: Cycle, state: Active) -> Event | Stop:
match state:
case Working():
return work(cycle)
case Judging(transcript_path):
case Working(answer):
return work(cycle, answer)
case Judging(transcript_path, _):
return rule(cycle, transcript_path)
case Interrupting(transcript_path, question):
return ask(cycle, transcript_path, question)
@@ -64,9 +64,9 @@ def step(cycle: Cycle, state: Active) -> Event | Stop:
typing.assert_never(state)
def work(cycle: Cycle) -> WorkerRan | Stop:
def work(cycle: Cycle, answer: str | None) -> WorkerRan | Stop:
# session_open runs inside the lambda: a failed attempt may have opened the session.
if stop := retried("worker", lambda: run_worker(cycle.root, worker_args(cycle.task, cycle.session, cycle.models.worker, session_open(cycle.session)), cycle.effects), cycle.effects):
if stop := retried("worker", lambda: run_worker(cycle.root, worker_args(cycle.task, cycle.session, cycle.models.worker, session_open(cycle.session), answer), cycle.effects), cycle.effects):
return stop
path = transcript_file(cycle.session)
return WorkerRan(path) if path is not None else Stop(1, f"claude left no transcript for session {cycle.session.id}")