fix(providers): observe unexpected proxy response closes - #2347
Conversation
There was a problem hiding this comment.
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.
113b433 to
3505a6e
Compare
There was a problem hiding this comment.
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>
3505a6e to
fa32d9a
Compare
There was a problem hiding this comment.
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.
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.