stage: retry pre-admission harness reach failures and widen repair deadline
Treat a failure to reach the harness before any prompt or tool call is admitted (connecting or creating the session) as a distinct retryable reach failure, so a transport blip at the first stage no longer ends a mutating run; keep post-admission readback/poll/agent failures retried only on an explicit read-only stage and never replay admitted tool work. Preserve the true cause when the context is already done (join ctx.Err with the typed transport error) and report a sanitized unknown provider error name/status instead of a blanket summary. Make the isolated format-repair deadline proportional to the stage timeout (floored, capped and clamped to remaining minus a margin) so a slow-but-repairable result is recovered without ever extending the stage deadline; the bounded ladder, value guard, deny-all formatter session, cumulative usage accounting and no-tool-replay rule are unchanged. Update docs/model-results.md, docs/pipeline-performance-review.md and the packaged skill references; add stage, opencode and server fixtures.
This commit is contained in:
+33
-12
@@ -82,10 +82,11 @@ Format recovery has a separate bounded budget, even with `retries=0`:
|
||||
2. If the local pass cannot repair it, make at most one fresh, deny-all, retained
|
||||
text-generation request with only the malformed response and precise parsing
|
||||
error. The original implementing/reviewing agent is never re-prompted. The
|
||||
formatter's deadline is derived from the payload size and the attempt's own
|
||||
remaining budget rather than a fixed short constant, so a large result is not
|
||||
guaranteed to time out; it stays within the stage deadline, is floored for
|
||||
ordinary payloads, and keeps the 32 KiB input/output bound.
|
||||
formatter's deadline is derived from the payload size, the stage timeout and
|
||||
the attempt's own remaining budget rather than a fixed short constant, so a
|
||||
large or slower result is not guaranteed to time out; it stays within the
|
||||
stage deadline (clamped to `remaining` minus a margin), is floored for ordinary
|
||||
payloads, and keeps the 32 KiB input/output bound.
|
||||
3. Accept only insertion of missing commas/colons or trailing closing delimiters,
|
||||
with at most 16 insertions. Every existing string, number, literal and
|
||||
structural delimiter must remain verbatim and in order. Validate the full
|
||||
@@ -106,8 +107,14 @@ rerun project edits, commands, or the entire stage to repair final formatting.
|
||||
Configured execution retries remain for retryable text-generation transport
|
||||
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. The
|
||||
A failure to reach the harness before any prompt or tool call is admitted
|
||||
(connecting, or creating the session) is a distinct reach failure: nothing was
|
||||
admitted, so it is retried within `retries` for any stage, mutating or not, with
|
||||
a fresh session and no replayed prompt or tool call. A post-admission readback,
|
||||
active-session poll or agent-execution failure is retried only on an explicit
|
||||
read-only stage. 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. The
|
||||
deterministic local pass and the fresh deny-all, tool-free formatter session never
|
||||
re-prompt or replay the admitted stage session, so a shell-enabled review stage
|
||||
gains malformed-result recovery without any replay of admitted work.
|
||||
@@ -121,11 +128,18 @@ and a recognized safe error category (such as session not found or service
|
||||
unavailable). Arbitrary stderr, provider messages and response bodies are not
|
||||
copied into the diagnostic. A failed V2 active-session poll (or native V1 `/wait`)
|
||||
is not evidence that the agent prompt failed to start, and does not trigger replay
|
||||
of stage work.
|
||||
of stage work. When the context expires while a request is still in flight, the
|
||||
error keeps both the sanitized transport detail (operation/status/exit) and
|
||||
`errors.Is(err, context.DeadlineExceeded)`, so a deadline that fired during a hung
|
||||
transport call is not replaced by a bare context error; a deadline measured at the
|
||||
attempt boundary with no transport in flight stays the stage overrun it is.
|
||||
Native `StructuredOutputError` is named directly, rather than reduced to a generic
|
||||
command failure. Native HTTP evidence records the actual HTTP operation/status;
|
||||
an `exit_code` of -1 there is explicitly marked as not a subprocess exit.
|
||||
Cleanup failures preserve the original generation error and active ownership.
|
||||
command failure, and an unrecognized provider execution-error name is reported as
|
||||
a bounded, sanitized identifier plus any 4xx/5xx status instead of a blanket
|
||||
summary (a name containing arbitrary bytes stays the generic message). Native HTTP
|
||||
evidence records the actual HTTP operation/status; an `exit_code` of -1 there is
|
||||
explicitly marked as not a subprocess exit. Cleanup failures preserve the original
|
||||
generation error and active ownership.
|
||||
|
||||
For existing native sessions with format-bearing messages, the HTTP readback
|
||||
workaround is read-only CLI `opencode export`. The exported session ID must match
|
||||
@@ -144,6 +158,11 @@ diagnostic:
|
||||
retry repeats work.
|
||||
- **HARNESS TRANSPORT** for request, V2 active-session poll and final-readback
|
||||
failures, including the sanitized `malformed or incomplete` readback message.
|
||||
A single classifier covers the two transport shapes: a pre-admission reach
|
||||
failure (connecting or creating the session) and a post-admission failure
|
||||
(readback/poll/agent execution). Both share the one `HARNESS TRANSPORT` label;
|
||||
only the pre-admission shape is retried on a mutating stage, because it replays
|
||||
nothing.
|
||||
|
||||
A structured-output validation failure is never reported as a harness transport
|
||||
failure, and vice versa. Neither label includes a provider response body, prompt,
|
||||
@@ -166,8 +185,10 @@ isolated formatter hit its own 30-second deadline. The malformed payload was
|
||||
retrieved read-only with `pipelines inspect 55 --json` and reproduced the exact
|
||||
byte offset 7837. It is an unescaped quote/colon inside a string value - an
|
||||
ambiguous case - so the deterministic pass correctly reports it unrecoverable
|
||||
rather than guessing, while the new derived deadline removes the fixed-deadline
|
||||
failure mode for larger payloads. These are source-level findings covered by mocked
|
||||
rather than guessing, while the stage-timeout-proportional derived deadline
|
||||
(floored, capped and clamped to the remaining attempt budget) removes the
|
||||
fixed-30-second-deadline failure mode for larger or slower payloads. These are
|
||||
source-level findings covered by mocked
|
||||
`internal/stage` fixtures. An updated checkout or installed skill is **not**
|
||||
evidence that a user's running server contains the fix; deploying/restarting is a
|
||||
separate authorized action.
|
||||
|
||||
@@ -428,3 +428,31 @@ blocked-class cause distribution and the transience of transport errors are
|
||||
hypotheses, not measurements. Raw captures are under
|
||||
`/Users/alan/.local/share/pipelines/data/artifacts/222/2/` and
|
||||
`/Users/alan/.local/share/pipelines/data/artifacts/222/4/` (outside the repo).
|
||||
|
||||
## 7. Transport and repair recovery (source-level, 2026-10-17)
|
||||
|
||||
Read-only pass over the §1 diagnostics after the harness-transport and
|
||||
format-repair change. No run was started, retried or cancelled; no server, ntfy,
|
||||
lane or device was restarted or redeployed; no provider inference was performed.
|
||||
Each shape is mapped to the code path that produces it. The per-run
|
||||
pre-admission vs post-admission and read-only vs mutating split was **not**
|
||||
re-inspected with `pipelines inspect`, so every per-run row is labelled *not
|
||||
verified* and the counts are not summed into a "recovered" total.
|
||||
|
||||
| failure shape (§1 class, quoted diagnostic) | run ids | code path | can recover | remains unrecoverable |
|
||||
|---|---|---|---|---|
|
||||
| execution error at readback (`OpenCode agent reported an execution error`) | 73,74,75,77,80,149,150,152,195,202 | post-admission `completedAgentResult` / `opencode.ExecutionError` | a stage that is explicit read-only may retry within `retries`(*not verified per run*) | a mutating/legacy stage never replays admitted work; a non-transient provider error stays terminal |
|
||||
| `context deadline exceeded` | 33,36,38,59,101,138 | attempt-boundary deadline, or a transport call that expired | a deadline during an in-flight request now keeps the transport cause and, when pre-admission, retries for any stage; a read-only stage retries a post-admission one | a genuine stage overrun on a mutating/legacy stage stays terminal; whether each run was a hung call or a real overrun is *not verified* |
|
||||
| readback failure (`final assistant readback had no completed result`) | 161 | post-admission `completedAgentResult` | explicit read-only stage may retry | mutating/legacy stage never replays |
|
||||
| native V1 `/wait` command failed (`CLI exit code 1`) | 4 | post-admission `openCodeError` on `/wait` | explicit read-only stage may retry | mutating/legacy stage never replays |
|
||||
| repair timeout (`isolated format repair failed … context deadline exceeded`) | 55,81,174,179,183,221 | `repairDeadline` (payload bytes + stage timeout, floored, capped, clamped to remaining − margin) | a slow-but-repairable payload now gets a longer bounded budget | run 55's payload is the ambiguous unescaped-quote/colon class (byte offset 7837) → unrecoverable; any payload past the 32 KiB bound stays unrecoverable |
|
||||
|
||||
Mapping notes: the execution-error and readback shapes are read back *after* the
|
||||
prompt was admitted, so they are post-admission transport failures and the
|
||||
no-tool-replay rule keeps them terminal on a mutating stage. The
|
||||
`session_transport_command_failed` shape (run 4) is the native V1 `/wait` call
|
||||
issued after the prompt, not a session-create reach failure. The repair-timeout
|
||||
shapes are `FINAL RESULT VALIDATION` (repair-stage), not transport. The new code
|
||||
also reports an unknown provider execution-error name as a bounded sanitized
|
||||
identifier plus any HTTP status, so future occurrences of runs 73–202 are more
|
||||
precisely diagnostic even when they are not retried.
|
||||
|
||||
Reference in New Issue
Block a user