Skip to content

fix(ai): preserve stream transport failures - #41779

Open
opencode-agent[bot] wants to merge 3 commits into
v2from
stream-errors
Open

fix(ai): preserve stream transport failures#41779
opencode-agent[bot] wants to merge 3 commits into
v2from
stream-errors

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an executor-owned typed byte-stream adapter without changing the public RequestExecutor.Interface
  • decode native transport failure metadata once at the HTTP I/O boundary and preserve nested native codes and messages
  • classify transport failures with stable transport and operation domain fields plus an open-ended native code
  • preserve the request actually sent through middleware and keep request diagnostics redacted
  • keep HTTP transports focused on framing an already typed stream
  • let the existing V2 runner retry transport failures when no model output has started, while retaining the existing no-replay behavior after partial output

Verification

  • bun typecheck (packages/ai)
  • bun typecheck (packages/core)
  • bun test test/executor.test.ts
  • bun test test/provider/openai-chat.test.ts --test-name-pattern "surfaces transport errors"
  • bun test test/provider/openai-responses.test.ts --test-name-pattern "streams OpenAI Responses over WebSocket|fails immediately when WebSocket is already closed"
  • bun test test/aisdk.test.ts test/session-error.test.ts test/session-execution.test.ts test/session-runner.test.ts
  • full monorepo typecheck from the pre-push hook

Requested by: @rekram1-node (Aiden Cline via Slack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant