Make agent-stage retries safe and retain timeout failure evidence
Fix four stage failure-handling and observability defects (A2, A3, A6, A9).
- A2: add safeToReplay(def) as the single definition of retryable post-admission
work - only an explicit tools block that selects neither edit nor shell. The
agent/pi WorkStarted guards now break only when the stage is not safe to
replay, so read-only stages genuinely retry a post-admission timeout while
mutating and legacy-bundle stages still never replay admitted work.
- A6: re-emit a malformed final result on an explicit read-only stage up to the
retry budget, preserving format_repairs evidence; mutating stages keep the
immediate return and their session.
- A3: timed-out stages retain usable evidence. waitForSessionIdle records one
bounded sanitized OperationEvidence on deadline; the agent deferred cleanup
does a bounded best-effort latest-assistant readback and settles knowable V2
usage; RetainSession adds a retained_session pointer to failed step
transcripts so the session is visible beneath the BoundTranscript threshold.
- A9: a stage outcome routed to #failure now yields a non-empty run diagnostic
("stage <name> returned outcome <outcome>") while preferring an existing step
diagnostic.
Adds focused stage and server tests for retry safety, malformed-result
re-emission, timeout evidence retention and run-level diagnostics; updates the
packaged skill references and docs/cli.md, docs/model-results.md.
This commit is contained in:
+6
-3
@@ -396,9 +396,12 @@ Usage is polled during execution and read again afterward; an in-flight request
|
||||
may exceed a limit before usage arrives. These are not provider-side hard caps.
|
||||
|
||||
Automatic retries cover retryable transport failures and per-attempt timeouts.
|
||||
They do not replay admitted tool work, invalid results, or budget failures.
|
||||
Cleanup must be confirmed before another attempt. Existing explicit `retries=0`
|
||||
settings remain unchanged. The old 30-minute run deadline no longer truncates
|
||||
An explicit read-only stage (a tools block listing neither `edit` nor `shell`)
|
||||
may also retry a post-admission deadline or transport failure and re-emit a
|
||||
malformed final result up to `retries`; a stage whose tools include `edit`/`shell`
|
||||
or that has no tools block never replays admitted tool work or invalid results.
|
||||
Budget failures always stop. Cleanup must be confirmed before another attempt.
|
||||
Existing explicit `retries=0` settings remain unchanged. The old 30-minute run deadline no longer truncates
|
||||
stage timeouts; the 30-step and five-visits-per-stage limits still apply.
|
||||
Native ntfy stages also accept `timeout` (default `1h`), but never automatically
|
||||
retry potentially delivered notifications and do not accept model budgets.
|
||||
|
||||
@@ -47,7 +47,10 @@ Format recovery has a separate bounded budget, even with `retries=0`:
|
||||
If recovery fails, report the original precise error and repair failure; never
|
||||
rerun project edits, commands, or the entire stage to repair final formatting.
|
||||
Configured execution retries remain for retryable text-generation transport
|
||||
errors; audited tool-enabled execution is never automatically replayed.
|
||||
errors; an explicit read-only stage may additionally re-emit a malformed final
|
||||
result and retry a post-admission deadline or transport failure up to `retries`.
|
||||
A stage whose tools include `edit`/`shell`, or that has no tools block (the legacy
|
||||
read/glob/grep/edit/shell bundle), never has admitted tool work replayed.
|
||||
Repair records include the original/candidate response, parsing diagnostic,
|
||||
method and acceptance flag in the bounded transcript preview. `pipelines
|
||||
inspect <run-id> --json` and the TUI evidence section expose these records.
|
||||
@@ -86,7 +89,9 @@ failure, and vice versa. Neither label includes a provider response body, prompt
|
||||
credential or arbitrary model content. Duplicate nested fields are rejected by
|
||||
strict parsing rather than merged or last-wins, and only a lossless insertion of
|
||||
missing commas/colons or trailing closers is repaired, so an unknown evidence or
|
||||
verdict value can never become `success` and admitted tool work is never replayed.
|
||||
verdict value can never become `success`, and admitted tool work on a mutating or
|
||||
legacy-bundle stage is never replayed (only an explicit read-only stage may
|
||||
re-emit a malformed result within `retries`).
|
||||
|
||||
Confirmed ordinary-endpoint failures (2026-10-11): an all-history readback returned
|
||||
exactly 262144 bytes of incomplete JSON (`invalid agent messages`); a reviewer
|
||||
|
||||
Reference in New Issue
Block a user