Skip to content

fix(ai): surface bounded response errors before cancellation settles - #174238

Merged
steipete merged 1 commit into
mainfrom
deslop/z20-14-response-cancellation-20261015
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z20-14-response-cancellation-20261015

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bounded response-body reads could wait indefinitely after reaching their byte cap or idle deadline because they awaited the underlying stream's cancellation promise. The ChatGPT failed-response reader could likewise delay an already available API error while cancellation remained pending.

User Impact

Bounded response diagnostics and terminal API errors become available without waiting for upstream cleanup acknowledgement. No operator migration or configuration change is required.

Why This Change Was Made

Request cancellation immediately and observe its rejection without making the bounded read or terminal API error wait for cleanup acknowledgement. Preserve byte limits, UTF-8 decoding, reader lock release, once-only provider cancellation, error identity, and request/auth/protocol contracts.

Three regressions use real Response/ReadableStream instances with deliberately pending cancellation. Their fixtures settle and drain in finally. This is a genuine error-visibility fix, not deletion-quota credit: net production +1 line, net tests +79 lines (97 additions/17 deletions total).

Best-effort tradeoffs accepted

  • Read-only transport cancellation acknowledgement may outlive the diagnostic result. It does not authorize a write or affect durable state; cancellation is still requested immediately and rejection is observed. An indefinitely pending cleanup no longer hides the bounded result or original API error. This defect is demonstrated by the regressions, not claimed as a human production incident.

Evidence

  • Baseline: all three selected regressions fail for the intended missing immediate outcome, not a harness timeout (80.28s Vitest under shared host load).
  • Fixed: 12/12 tests pass across both changed owners and the existing byte guard (123.15s Vitest).
  • Anthropic caller: two selected bounded-body consumer regressions pass (82.92s Vitest; 61 existing nonselected cases filtered, no added skips).
  • Lint-suppression gate: 3/3 pass (72.31s Vitest).
  • Focused typecheck: pass for the four changed AI files and their imports using the canonical ESNext source config. An initial scratch config inherited an inappropriate ES2023 library and was corrected; a broad inherited-root invocation was stopped and is not counted as proof.
  • Independent isolated review: scoped-clean through P2; source verification passed. Format and whitespace checks passed. Production imports are unchanged, so no runtime dependency edge is added.
  • Broad gates are delegated to exact-head hosted PR CI; no live provider/device claim. No schema, config, dependency, public SDK, security, or Phase E changes.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 16, 2026 13:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T13:17:55.761868Z 892abcc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Exact reviewed head: 892abcc9343b615423a5f390dade603254b60e36.

Final paginated exact-head enumeration: 167 check runs, zero unfinished or cancelled checks. CI run 38906472587 and all three required status contexts are green. The only two historical failures are the individually attributed, superseded body-heading checks below; their exact-head replacement succeeded. Live head, MERGEABLE state, no outstanding reviews, clean signed source checkout, and native writer steipete were verified immediately before submission.

The coordinator's rule 10 authorizes a direct SHA-guarded squash after the native landing workflow repeatedly failed during infrastructure initialization (state-lease startup deadlines). No native retry or alternative worker was used for this landing. This changes the submission route only; review, exact-head CI, mergeability, and identity gates still apply.

Independent isolated review through P2 is clean, with final source verification. Focused proof: baseline three regressions fail for their intended missing immediate outcome; repaired owners and byte guards pass 12/12, selected Anthropic consumers pass 2/2, lint-suppression gate passes 3/3, targeted types pass. This genuine error-visibility fix adds one net production line and 79 test lines; it changes no public protocol, auth, SDK, persisted state, or Phase E behavior.

Earlier failed job Attribution and current proof
PR context and evidence, run 38906394092, job 116990928050 Authored body used non-template headings. Corrected the body without changing the code head; superseded by success on the same exact head in run 38906727008, job 116992038185.
PR context and evidence, run 38906472366, job 116991179711 Same heading failure before body correction; superseded by the same successful replacement. No manual CI rerun or code push was used.

@steipete
steipete merged commit 7cbbf3b into main Oct 16, 2026
174 of 176 checks passed
@steipete
steipete deleted the deslop/z20-14-response-cancellation-20261015 branch October 16, 2026 13:29
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit '3f14c05236f10ad9a833770ee5962d4dd6c22110': (74 commits)
  fix(update): compare each recovery manifest once during cleanup confirmation (#174249)
  perf(agents): release completed attempt transcript references (#174236)
  refactor(ui): bind board frames through Solid refs (#174180)
  fix: stop repetitive output from small models (#173844)
  fix(update): stop listing missing recovery originals as cleanup candidates (#174241)
  refactor(ui): remove transcript virtualizer controller registry (#174231)
  fix(ai): surface bounded response errors before cancellation settles (#174238)
  refactor(test): reuse descendant-death waits (#174240)
  refactor: consume existing channel and SDK type owners (#174010)
  refactor(ui): bind sidebar session classes directly (#174229)
  fix(logging): omit content from AI transport diagnostics (#174217)
  test(tooling,talk,sessions,infra,browser,github): remove low-value tests (batch d121) (#173137)
  fix(ci): drop orphaned exports and copy cli-invocation into the package harness
  refactor(ui): derive login drafts and share native input bindings (#174223)
  refactor(ui): own chat locale and clock lifetime in Solid (#174224)
  feat(build): support selected standalone plugins (#173794)
  refactor(ui): bind browser input through viewport refs (#174138)
  refactor(ui): simplify multi-select callback ownership (#174225)
  refactor: simplify settings input ownership (#174222)
  refactor(ui): pair popup and hovercard listener teardown (#174209)
  ...

# Conflicts:
#	scripts/plugin-sdk-surface-report.mts
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'ad851536ea160d43294fb35e3e3cb9a7011d3873': (74 commits)
  fix(update): compare each recovery manifest once during cleanup confirmation (#174249)
  perf(agents): release completed attempt transcript references (#174236)
  refactor(ui): bind board frames through Solid refs (#174180)
  fix: stop repetitive output from small models (#173844)
  fix(update): stop listing missing recovery originals as cleanup candidates (#174241)
  refactor(ui): remove transcript virtualizer controller registry (#174231)
  fix(ai): surface bounded response errors before cancellation settles (#174238)
  refactor(test): reuse descendant-death waits (#174240)
  refactor: consume existing channel and SDK type owners (#174010)
  refactor(ui): bind sidebar session classes directly (#174229)
  fix(logging): omit content from AI transport diagnostics (#174217)
  test(tooling,talk,sessions,infra,browser,github): remove low-value tests (batch d121) (#173137)
  fix(ci): drop orphaned exports and copy cli-invocation into the package harness
  refactor(ui): derive login drafts and share native input bindings (#174223)
  refactor(ui): own chat locale and clock lifetime in Solid (#174224)
  feat(build): support selected standalone plugins (#173794)
  refactor(ui): bind browser input through viewport refs (#174138)
  refactor(ui): simplify multi-select callback ownership (#174225)
  refactor: simplify settings input ownership (#174222)
  refactor(ui): pair popup and hovercard listener teardown (#174209)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'c99bc43bffb351d0e37d72b2f4aa89f7d4fd116b': (157 commits)
  fix(update): compare each recovery manifest once during cleanup confirmation (#174249)
  perf(agents): release completed attempt transcript references (#174236)
  refactor(ui): bind board frames through Solid refs (#174180)
  fix: stop repetitive output from small models (#173844)
  fix(update): stop listing missing recovery originals as cleanup candidates (#174241)
  refactor(ui): remove transcript virtualizer controller registry (#174231)
  fix(ai): surface bounded response errors before cancellation settles (#174238)
  refactor(test): reuse descendant-death waits (#174240)
  refactor: consume existing channel and SDK type owners (#174010)
  refactor(ui): bind sidebar session classes directly (#174229)
  fix(logging): omit content from AI transport diagnostics (#174217)
  test(tooling,talk,sessions,infra,browser,github): remove low-value tests (batch d121) (#173137)
  fix(ci): drop orphaned exports and copy cli-invocation into the package harness
  refactor(ui): derive login drafts and share native input bindings (#174223)
  refactor(ui): own chat locale and clock lifetime in Solid (#174224)
  feat(build): support selected standalone plugins (#173794)
  refactor(ui): bind browser input through viewport refs (#174138)
  refactor(ui): simplify multi-select callback ownership (#174225)
  refactor: simplify settings input ownership (#174222)
  refactor(ui): pair popup and hovercard listener teardown (#174209)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit 'ad851536ea160d43294fb35e3e3cb9a7011d3873': (157 commits)
  fix(update): compare each recovery manifest once during cleanup confirmation (#174249)
  perf(agents): release completed attempt transcript references (#174236)
  refactor(ui): bind board frames through Solid refs (#174180)
  fix: stop repetitive output from small models (#173844)
  fix(update): stop listing missing recovery originals as cleanup candidates (#174241)
  refactor(ui): remove transcript virtualizer controller registry (#174231)
  fix(ai): surface bounded response errors before cancellation settles (#174238)
  refactor(test): reuse descendant-death waits (#174240)
  refactor: consume existing channel and SDK type owners (#174010)
  refactor(ui): bind sidebar session classes directly (#174229)
  fix(logging): omit content from AI transport diagnostics (#174217)
  test(tooling,talk,sessions,infra,browser,github): remove low-value tests (batch d121) (#173137)
  fix(ci): drop orphaned exports and copy cli-invocation into the package harness
  refactor(ui): derive login drafts and share native input bindings (#174223)
  refactor(ui): own chat locale and clock lifetime in Solid (#174224)
  feat(build): support selected standalone plugins (#173794)
  refactor(ui): bind browser input through viewport refs (#174138)
  refactor(ui): simplify multi-select callback ownership (#174225)
  refactor: simplify settings input ownership (#174222)
  refactor(ui): pair popup and hovercard listener teardown (#174209)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…157148)

* feat: describe decision capabilities in model catalogs

Keep task, protocol, modalities, reasoning, grounding, probability semantics,
abstention and route billing distinct without changing chat Model types.

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix: apply shared plugin model policy to decisions

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* feat: support plugin-owned model credentials

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* feat(decisions): preserve richer answers with versioned data codecs

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* chore(sdk): record approved Decision V2 data allowance

Apply only the +14 exports / +6 callables for the existing decisions data contract. Peter Steinberger explicitly approved the complete +18/+6 stack allowance on 2026-09-26; the remaining four execution types belong to the dependent PR. No additional API or guard exception.

Co-authored-by: steipete <[email protected]>

* fix(models): retain decision facts on their declared routes

Merge current main and reconcile the original Decision capability metadata with the canonical catalog. Preserve facts for matching hosted routes, clear stale facts on route changes, and retain chat:false. Validated 50 focused tests, planner replay, types, lint, formatting, and full build.

* feat(decisions): enforce shared plugin model policy

Integrate current model metadata while preserving the original decision-policy ancestry. Apply the reviewed shared completion authorization port without changing its six-file patch.

Validated 112 focused tests, targeted typecheck/lint/format, and the strict plugin SDK smoke build.

Original PR: #156621

* fix(models): include inference metadata in extracted tooling

* chore(models): include metadata tooling closure repair

* commit '00d93bb011fd8ac55d72623d1bd9e5bbcdb7d301':
  fix(models): include inference metadata in extracted tooling

* feat(auth): integrate plugin-owned model credentials

Preserve contributor history while integrating physical credential ownership with the shared model policy. Plugin-owned routes bypass agent profile discovery and agent no-auth substitution; agent-owned routes retain explicit no-auth behavior.

Co-authored-by: steipete <[email protected]>

* fix(models): preserve decision policy on current main

* merge: integrate current model policy into plugin auth

Preserve both signed ancestry chains and current-main OAuth refresh, secret-owner, abort, and authentication bootstrap behavior. The plugin-owned authentication patch is unchanged.

* feat(decisions): integrate versioned data codecs on shared auth

Preserve the original contributor PR ancestry while applying the reviewed V2 data contract to the shared-policy and plugin-owned-auth stack. The fourteen-file feature delta matches the qualified candidate exactly, including the measured SDK budget expansion.

* fix(decisions): preserve explicit owner-agent selection

* merge: preserve decision owner selection in plugin auth

Integrate the reviewed explicit owner-agent selection repair while preserving the unchanged plugin-owned authentication patch and both ancestry chains.

* fix(decisions): carry owner-bound policy repair into data stack

Merge the repaired shared-auth parent while preserving the qualified fourteen-file V2 data delta. Frozen dependency inputs are unchanged; the incoming policy runtime and tests retain their independent qualification.

* merge: reconcile plugin auth with landed model policy

Preserve the original contributor and signed integration ancestry while basing the unchanged plugin-owned authentication patch on the landed shared model policy.

* chore(decisions): reconcile data stack with published auth ancestry

Merge the qualified shared-auth head while preserving the byte-identical fourteen-file V2 data patch. Dependency declarations and frozen lock/workspace inputs are unchanged; the existing physical install remains available to the native PR tooling owner.

* fix(auth): retain plugin credential authority through dispatch

* chore(decisions): integrate canonical auth authority fix

* fix(decisions): distinguish plain record validation

* test(auth): preserve health probe exports in lifecycle fixture

* chore(auth): integrate repaired main for credential lifecycle gates

* chore(decisions): integrate repaired auth authority

* chore(auth): integrate current main for landing

* chore(decisions): integrate current auth authority

* commit '3f14c05236f10ad9a833770ee5962d4dd6c22110': (74 commits)
  fix(update): compare each recovery manifest once during cleanup confirmation (#174249)
  perf(agents): release completed attempt transcript references (#174236)
  refactor(ui): bind board frames through Solid refs (#174180)
  fix: stop repetitive output from small models (#173844)
  fix(update): stop listing missing recovery originals as cleanup candidates (#174241)
  refactor(ui): remove transcript virtualizer controller registry (#174231)
  fix(ai): surface bounded response errors before cancellation settles (#174238)
  refactor(test): reuse descendant-death waits (#174240)
  refactor: consume existing channel and SDK type owners (#174010)
  refactor(ui): bind sidebar session classes directly (#174229)
  fix(logging): omit content from AI transport diagnostics (#174217)
  test(tooling,talk,sessions,infra,browser,github): remove low-value tests (batch d121) (#173137)
  fix(ci): drop orphaned exports and copy cli-invocation into the package harness
  refactor(ui): derive login drafts and share native input bindings (#174223)
  refactor(ui): own chat locale and clock lifetime in Solid (#174224)
  feat(build): support selected standalone plugins (#173794)
  refactor(ui): bind browser input through viewport refs (#174138)
  refactor(ui): simplify multi-select callback ownership (#174225)
  refactor: simplify settings input ownership (#174222)
  refactor(ui): pair popup and hovercard listener teardown (#174209)
  ...

# Conflicts:
#	scripts/plugin-sdk-surface-report.mts

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…penclaw#157148)

* feat: describe decision capabilities in model catalogs

Keep task, protocol, modalities, reasoning, grounding, probability semantics,
abstention and route billing distinct without changing chat Model types.

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix: apply shared plugin model policy to decisions

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* feat: support plugin-owned model credentials

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* feat(decisions): preserve richer answers with versioned data codecs

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* chore(sdk): record approved Decision V2 data allowance

Apply only the +14 exports / +6 callables for the existing decisions data contract. Peter Steinberger explicitly approved the complete +18/+6 stack allowance on 2026-09-26; the remaining four execution types belong to the dependent PR. No additional API or guard exception.

Co-authored-by: steipete <[email protected]>

* fix(models): retain decision facts on their declared routes

Merge current main and reconcile the original Decision capability metadata with the canonical catalog. Preserve facts for matching hosted routes, clear stale facts on route changes, and retain chat:false. Validated 50 focused tests, planner replay, types, lint, formatting, and full build.

* feat(decisions): enforce shared plugin model policy

Integrate current model metadata while preserving the original decision-policy ancestry. Apply the reviewed shared completion authorization port without changing its six-file patch.

Validated 112 focused tests, targeted typecheck/lint/format, and the strict plugin SDK smoke build.

Original PR: openclaw#156621

* fix(models): include inference metadata in extracted tooling

* chore(models): include metadata tooling closure repair

* commit '00d93bb011fd8ac55d72623d1bd9e5bbcdb7d301':
  fix(models): include inference metadata in extracted tooling

* feat(auth): integrate plugin-owned model credentials

Preserve contributor history while integrating physical credential ownership with the shared model policy. Plugin-owned routes bypass agent profile discovery and agent no-auth substitution; agent-owned routes retain explicit no-auth behavior.

Co-authored-by: steipete <[email protected]>

* fix(models): preserve decision policy on current main

* merge: integrate current model policy into plugin auth

Preserve both signed ancestry chains and current-main OAuth refresh, secret-owner, abort, and authentication bootstrap behavior. The plugin-owned authentication patch is unchanged.

* feat(decisions): integrate versioned data codecs on shared auth

Preserve the original contributor PR ancestry while applying the reviewed V2 data contract to the shared-policy and plugin-owned-auth stack. The fourteen-file feature delta matches the qualified candidate exactly, including the measured SDK budget expansion.

* fix(decisions): preserve explicit owner-agent selection

* merge: preserve decision owner selection in plugin auth

Integrate the reviewed explicit owner-agent selection repair while preserving the unchanged plugin-owned authentication patch and both ancestry chains.

* fix(decisions): carry owner-bound policy repair into data stack

Merge the repaired shared-auth parent while preserving the qualified fourteen-file V2 data delta. Frozen dependency inputs are unchanged; the incoming policy runtime and tests retain their independent qualification.

* merge: reconcile plugin auth with landed model policy

Preserve the original contributor and signed integration ancestry while basing the unchanged plugin-owned authentication patch on the landed shared model policy.

* chore(decisions): reconcile data stack with published auth ancestry

Merge the qualified shared-auth head while preserving the byte-identical fourteen-file V2 data patch. Dependency declarations and frozen lock/workspace inputs are unchanged; the existing physical install remains available to the native PR tooling owner.

* fix(auth): retain plugin credential authority through dispatch

* chore(decisions): integrate canonical auth authority fix

* fix(decisions): distinguish plain record validation

* test(auth): preserve health probe exports in lifecycle fixture

* chore(auth): integrate repaired main for credential lifecycle gates

* chore(decisions): integrate repaired auth authority

* chore(auth): integrate current main for landing

* chore(decisions): integrate current auth authority

* commit '3f14c05236f10ad9a833770ee5962d4dd6c22110': (74 commits)
  fix(update): compare each recovery manifest once during cleanup confirmation (openclaw#174249)
  perf(agents): release completed attempt transcript references (openclaw#174236)
  refactor(ui): bind board frames through Solid refs (openclaw#174180)
  fix: stop repetitive output from small models (openclaw#173844)
  fix(update): stop listing missing recovery originals as cleanup candidates (openclaw#174241)
  refactor(ui): remove transcript virtualizer controller registry (openclaw#174231)
  fix(ai): surface bounded response errors before cancellation settles (openclaw#174238)
  refactor(test): reuse descendant-death waits (openclaw#174240)
  refactor: consume existing channel and SDK type owners (openclaw#174010)
  refactor(ui): bind sidebar session classes directly (openclaw#174229)
  fix(logging): omit content from AI transport diagnostics (openclaw#174217)
  test(tooling,talk,sessions,infra,browser,github): remove low-value tests (batch d121) (openclaw#173137)
  fix(ci): drop orphaned exports and copy cli-invocation into the package harness
  refactor(ui): derive login drafts and share native input bindings (openclaw#174223)
  refactor(ui): own chat locale and clock lifetime in Solid (openclaw#174224)
  feat(build): support selected standalone plugins (openclaw#173794)
  refactor(ui): bind browser input through viewport refs (openclaw#174138)
  refactor(ui): simplify multi-select callback ownership (openclaw#174225)
  refactor: simplify settings input ownership (openclaw#174222)
  refactor(ui): pair popup and hovercard listener teardown (openclaw#174209)
  ...

# Conflicts:
#	scripts/plugin-sdk-surface-report.mts

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant