Core: cancel moved runs, retry bookkeeping, progress cap, safer classification

- A run whose item leaves In Progress is killed, gets a [worker] cancel comment,
  frees its terminal slot and serialize group and keeps its thread id; if the
  kill fails the slot stays taken and the cancel is retried next tick.
- Transient retries are the same logical round: they do not count toward
  max_rounds_per_thread and do not trigger a max-rounds rebuild.
- New project setting max_progress_rounds (default 12): after that many
  consecutive [progress] rounds the item goes to Waiting (answerer) with a note.
- retry/rebuild markers are consumed only after the run launched, so a failed
  start no longer leaves an In Progress item that is never picked again; a
  rebuild is no longer reported as a retry.
- State is saved after every finished round and every launched run.
- Failure classification: transient patterns only look at the tail, and an
  exit-0 failure is logic (never retried) unless the tail shows a transient error.
- First-line tag: tolerate BOM and a leading code fence / rule line.
- Start comment notes when a handoff summary was attached.
This commit is contained in:
jj.wang
2026-10-21 07:13:18 +00:00
parent 00d42267e5
commit efbc5f6e27
7 changed files with 258 additions and 18 deletions
+7
View File
@@ -87,8 +87,12 @@ class FakeExecutor:
def __init__(self, resume=True):
self.resume = resume
self.started, self.killed, self.done = [], [], {}
self.fail_starts, self.fail_kills = 0, 0
def start(self, run):
if self.fail_starts:
self.fail_starts -= 1
raise RuntimeError("relay down")
self.started.append(run)
return {"run_dir": "/runs/" + run.run_id, "run_id": run.run_id, "thread_id": run.thread_id}
@@ -99,6 +103,9 @@ class FakeExecutor:
return self.done[handle["run_id"]]
def kill(self, handle):
if self.fail_kills:
self.fail_kills -= 1
raise RuntimeError("relay down")
self.killed.append(handle["run_id"])
def finish(self, message, exit_code=0, thread="th-1", tail=""):