Repository navigation
refactor(agents): share incomplete-turn visibility classification - #135374
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Follow up on #134980 by computing attempt visibility and silent-reply eligibility once, removing duplicated empty-turn predicates and a one-call terminal-error wrapper. Align the failover docs with the consolidated transient retry owner from #134281. Production delta: -71 lines; no behavior or configuration change.
4455c8f to
26bff7d
Compare
|
@clawsweeper re-review Please complete review of current head This is the separate -71 production-line cleanup following already-merged #134980. The PR body contains the live isolated-gateway proof: one structured refusal request, no fallback, bounded guidance after chat.history reload; HTTP 500 retries once and succeeds; both outcomes persisted in SQLite. No config, schema, protocol, dependency, or product-policy changes. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Native landing is blocked by the required completed ClawSweeper review, not by CI or the patch. Head Three review-generation attempts failed with The PR remains open and prepared. No gate was bypassed. Resume native merge after the review service produces a completed review and its findings/Rank-up moves are addressed. The original refusal regression is already fixed by #134980; this is its separate -71-line cleanup follow-up. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 1:57 PM ET / 17:57 UTC. ClawSweeper reviewWhat this changesThis PR centralizes incomplete assistant-turn visibility classification for recovery paths, inlines a one-use terminal-error helper, and corrects the model-failover documentation. Merge readinessKeep this maintainer-owned PR open: its behavior-preserving consolidation is not on fetched current main, and the examined predicates are equivalent to the removed branches. Priority: P3 Review scores
Verification
How this fits togetherThe embedded agent runner classifies provider output before choosing a retry, intentional silence, continuation, or visible terminal result. Gateway-facing completion and history then consume that terminal decision. flowchart LR
A[Provider response] --> B[Current attempt evidence]
B --> C[Visibility classifier]
C --> D[Retry or silence decision]
D --> E[Terminal resolution]
E --> F[Gateway history and reply]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -71, Docs 0. Total -71 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the single canonical visibility classification with the existing focused recovery coverage and the corrected retry-owner documentation. Do we have a high-confidence way to reproduce the issue? Not applicable as a cleanup PR; existing focused tests and the supplied isolated Gateway trace cover the preserved recovery behavior. Is this the best way to solve the issue? Yes. Computing the shared non-visible condition once preserves both former predicates while removing their opportunity to drift. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a040b0363656. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…enclaw#135374) Follow up on openclaw#134980 by computing attempt visibility and silent-reply eligibility once, removing duplicated empty-turn predicates and a one-call terminal-error wrapper. Align the failover docs with the consolidated transient retry owner from openclaw#134281. Production delta: -71 lines; no behavior or configuration change.
Related: #134980, #134968, #134281
What Problem This Solves
The terminal-refusal repair in #134980 now prevents repeated full-context requests. Its surrounding empty-turn recovery code still computed the same current-attempt visibility and silent-reply eligibility through overlapping predicates, making it easier for those paths to drift apart during later changes.
This is the separate cleanup follow-up to that repair. Thanks to @Marvinthebored for the original report and fix, and @obviyus for completing the gateway-visible refusal repair and landing it.
Why This Change Was Made
Compute the current assistant, visible text, reasoning-only state, and silent-reply eligibility together in the existing classifier. Empty-response recovery is the same eligibility with reasoning-only turns excluded. Remove the duplicate predicates, unused projected fields, and one-use terminal-error wrapper. Current-attempt provenance remains unchanged; historical assistant messages are not reintroduced.
Also align the model-failover documentation with the already-merged retry-controller consolidation in #134281. No configuration, persistence, protocol, dependency, retry budget, or product policy changes.
User Impact
No runtime behavior change intended. Hard refusals remain terminal and visible; transient server failures retain normal retry behavior. The docs no longer promise the retired outer ten-attempt overload loop.
Evidence
83e75f5e310123a393e91d66f86f95be4117e4b2: structured-refusal retry regression failed withexpected false, received true. Restored the candidate immediately afterward.mermaidduring core-test typechecking. The full build and first CI run both hit the protocol declaration failure fixed by fix: restore protocol declaration builds #135360. Rebased onto that landed repair; exact-head CI passed (run 33536344740). The supportedqaRuntimebuild passed.chat.send→agent.wait→chat.historyturns verify refusal versus transient HTTP 500. Read-only inspection of the isolated SQLite transcript confirms both terminal records. Owned gateway stopped and temporary state removed.4455c8f29a6de273f22966982050078882ff88dd; the four-file patch is unchanged by the mechanical rebase to26bff7dd1c2b5418dc3f2dc17b0feb1c5752fd04for the declaration-build repair. Source-gateway startup attempts timed out before provider requests; the compiled-runtime proof did not need relaxed retry assertions.Sanitized live-proof transcript:
ClawSweeper status: both review-start placeholders were removed and no completed review or
Rank-up moves:survived. Native prepare passed, but native merge requires a completed ClawSweeper review and correctly refused to land. Requested@clawsweeper re-reviewof the unchanged green head; no gate is bypassed.Observations outside this refactor
/v1/responsesalso made one request and no fallback, but returned its existing generic500 / api_error / internal errorfor a resolved failed agent run.openresponses-http.ts:757and its terminal-failure tests deliberately suppress provider details. A typed safe refusal response would need a separate error-disclosure contract decision; this PR preserves the existing contract.The agent run failed before producing a reply.placeholder before its successful final answer. This comes from the existing error-history projection, not the classification refactor. A separate history/presentation follow-up should decide how recovered attempts appear; no failed run was silently dropped here.The original fix is already merged as
ead8ce050963ae717419a7977a6e7b240ba8b56c; linked issue #134968 is already closed. This PR does not duplicate or reland it.