Skip to content

fix(providers): observe unexpected proxy response closes - #2347

Merged
justinhelmer merged 1 commit into
mainfrom
plan/at-current-main-9f4d0f4c-ab5030/u1
Sep 28, 2026
Merged

justinhelmer merged 1 commit into
mainfrom
plan/at-current-main-9f4d0f4c-ab5030/u1

Conversation

@coreplane-switchboard

Copy link
Copy Markdown
Contributor

Requested by justin · Thread

Adds one safe, one-shot diagnostic when a model-proxy response closes before it finishes. This exposes the local cancellation boundary without guessing the root closer or changing provider behavior.

P0 #2340 proved unfinished proxy-response closes but not their root cause. This bounded diagnostic precedes and intentionally does not absorb PR #2345; both touch the same spec and need merge reconciliation.

Rendered by the plan runner from the coding run's submitted description; the run ended before it could open the pull request itself.

@coreplane-switchboard coreplane-switchboard Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: The diagnostic behavior is covered, but it contradicts the spec's existing one-log-line-per-call guarantee.

Warning

Changes requested · head 113b433 · 1 finding: 1 minor

Severity Finding Where
minor F1 Spec contradiction — model-proxy.md item 7: unexpected closes now emit an extra per-call log line docs/reference/specs/model-proxy.md:17
Full review

F1 — Item 7 still guarantees one log line per model-proxy call, but an unexpected close now emits the new diagnostic before the existing completion or stream-error line. Update item 7 to explicitly describe the bounded diagnostic exception so the behavioral spec and new criterion agree.

@coreplane-switchboard coreplane-switchboard Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: Spec contradiction is resolved; unexpected-close diagnostics still permit a throwing getter to escape the response-close listener.

Warning

Changes requested · head 3505a6e · 1 finding: 1 minor

Severity Finding Where
minor F2 Guard transport-state getters inside the close diagnostic src/channels/modelProxy.ts:1192
Full review

F2 (minor, medium confidence): The close listener reads res.errored and req.errored outside a guard. If either getter throws, the exception escapes the close event handler; a diagnostic intended only to observe a disconnect can then disrupt the HTTP process. Catch failures while collecting diagnostic fields and emit a bounded fallback without raw error text.

The prior F1 spec contradiction is resolved at this head: model-proxy item 7 now permits the bounded unexpected-close diagnostic.

Co-Authored-By: coreplane-switchboard[bot] <318072483+coreplane-switchboard[bot]@users.noreply.github.com>
@justinhelmer
justinhelmer force-pushed the plan/at-current-main-9f4d0f4c-ab5030/u1 branch from 3505a6e to fa32d9a Compare September 28, 2026 20:09

@coreplane-switchboard coreplane-switchboard Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: Response-close diagnostics safely handle throwing transport getters and emit only bounded fields; regression and spec agree.

Note

Approved · head fa32d9a · no findings

Full review

No findings at fa32d9a. The response-close diagnostic contains throwing transport getters without leaking raw error text, and the regression test and model-proxy spec match the behavior.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: coreplane-switchboard[bot] reviewed this PR and posted an LGTM verdict (see its review). This repository opted in through its REVIEW_BOT_LOGIN and REVIEW_BOT_ID variables.

@justinhelmer
justinhelmer merged commit 7096251 into main Sep 28, 2026
30 checks passed
@justinhelmer
justinhelmer deleted the plan/at-current-main-9f4d0f4c-ab5030/u1 branch September 28, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant