Skip to content

fix: propagate cancellation and aborts in the in-memory transport - #29723

Merged
pawbana merged 1 commit into
mainfrom
pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6
Sep 28, 2026
Merged

pawbana merged 1 commit into
mainfrom
pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6

Conversation

@pawbana

@pawbana pawbana commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes cancellation and abort handling in the in-memory transport coderd uses to call AI Gateway in-process.

  • Closing the response body cancels the served request context without canceling the caller's context, allowing upstream work to terminate.
  • An exact http.ErrAbortHandler panic surfaces as io.ErrUnexpectedEOF or the cancellation cause on the response body, rather than being converted to a 500.
  • Normal completion remains a clean EOF and cancels the served context for cleanup. Cancellation errors preserve context.Cause.

The matching httpmw.Recover fix is tracked in AIGOV-683.

Generated by Coder Agents on behalf of @pawbana.

@linear-code

linear-code Bot commented Sep 22, 2026

Copy link
Copy Markdown

AIGOV-615

@pawbana pawbana removed their assignment Sep 22, 2026
@pawbana
pawbana added this pull request to stack #29736 September 22, 2026 16:14
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6 branch from 0d59fb8 to 1908428 Compare September 24, 2026 17:31
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@pawbana
pawbana removed this pull request from stack #29736 September 24, 2026 17:36
@pawbana
pawbana changed the base branch from pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-5 to pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-4 September 24, 2026 17:36
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6 branch from 1908428 to 2f060a1 Compare September 24, 2026 17:53
@pawbana pawbana changed the title fix: propagate in-process cancellation and HTTP stream aborts fix(coderd/aibridged): propagate cancellation and aborts in the in-memory transport Sep 24, 2026
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6 branch from 2f060a1 to 4e5b5d9 Compare September 24, 2026 20:13
@pawbana
pawbana requested a review from johnstcn September 24, 2026 20:14
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-4 branch from 90b24cd to 73f26e0 Compare September 28, 2026 11:04
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6 branch from 4e5b5d9 to 28bdcad Compare September 28, 2026 11:14
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-4 branch from 73f26e0 to c2aef4d Compare September 28, 2026 17:59
Base automatically changed from pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-4 to main September 28, 2026 18:16
@pawbana
pawbana marked this pull request as ready for review September 28, 2026 20:57
@pawbana pawbana changed the title fix(coderd/aibridged): propagate cancellation and aborts in the in-memory transport fix: propagate cancellation and aborts in the in-memory transport Sep 28, 2026
@pawbana
pawbana force-pushed the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6 branch from 28bdcad to 9bc299b Compare September 28, 2026 21:04
@pawbana
pawbana merged commit ce80607 into main Sep 28, 2026
53 of 55 checks passed
@pawbana
pawbana deleted the pawel/aigov-615-reverse-proxy-handler-with-recorder-lifecycle-and-key-6 branch September 28, 2026 21:24
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants