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.
|
||||
|
||||
Reference in New Issue
Block a user