The model batches are isolated with a deadline, so a Kill or a hang ends them
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c63f348dc9
commit
b73a0fc2cb
6 files changed
+54
-9
No files matched your search
+12
-2
@@ -177,11 +177,21 @@ TASK: ModelTask[SummariseResult] = ModelTask(
|
||||
)
|
||||
|
||||
|
||||
@job(f"{TASK.kind}_batch", "Summarising a batch", resource="llm")
|
||||
# One call is bounded at AgentConfig.timeout (300s by default), and a batch
|
||||
# is one call, plus a few short ones when a refusal halves it down
|
||||
# (desk/modeltask.py `_narrow`). A batch of 10 still running after 15
|
||||
# minutes is stuck, not slow.
|
||||
@job(f"{TASK.kind}_batch", "Summarising a batch", resource="llm",
|
||||
isolate=True, timeout=900)
|
||||
def run_batch(config: Config, store: Store, *, context: RunContext = NULL,
|
||||
uids: list[str] | None = None) -> dict[str, Any]:
|
||||
"""One model call over one batch. Queued by the task's finder, or with
|
||||
one uid by the read page's Summarise button."""
|
||||
one uid by the read page's Summarise button.
|
||||
|
||||
Isolated for the same reason as `extract.run_batch`: a Kill only reaches
|
||||
`one` between calls, and a call that hangs — on either backend — is
|
||||
otherwise unkillable short of restarting the server.
|
||||
"""
|
||||
return modeltask.one(TASK, config, store, uids or [], context=context).model_dump()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user