Skip to content

fix: improve missing stream completion diagnostics - #5457

Merged
jbeckwith-oai merged 1 commit into
mainfrom
fix/stream-completion-diagnostics
Oct 30, 2026
Merged

jbeckwith-oai merged 1 commit into
mainfrom
fix/stream-completion-diagnostics

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Collaborator

Summary

When a model stream ends without response.completed, the runner currently raises a generic error that provides no request correlation information. Include the observed request ID, response ID, event count, and last event type in that error so reports can be investigated without logging prompts or model output.

Preserves the ModelBehaviorError class, original message prefix, failure location, and retry behavior. An entirely empty stream reports unavailable IDs because no response events reached the runner. This is a diagnostic improvement, not a fix for the underlying stream interruption.

Test plan

  • Added real SSE parser/runner coverage using httpx2.MockTransport for partial and empty streams, absent request IDs, payload exclusion, no additional retries, and completed/failed/incomplete terminal behavior.
  • 233 focused tests and 107 serial tests passed.
  • Formatting, lint, Mypy, and Pyright passed.
  • Full parallel suite: 12,235 passed, 32 skipped, 69 failed. The identical 69 failing tests also fail on the unchanged base: 62 MCP redaction tests match user in the local /home/dev-user checkout path, and seven sandbox tests expect local snapshots but receive no-op snapshots in this environment. No unrelated fixes are included.
  • Independent implementation review and two consecutive adversarial review rounds completed without blocking findings.

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass (local baseline failures documented above)
  • I've run independent code review before submitting this PR

@jbeckwith-oai
jbeckwith-oai requested review from a team, rm-openai and seratch as code owners October 30, 2026 17:01
@chatgpt-codex-connector

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

Copy link
Copy Markdown

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-30T17:02:59.998355Z 3911321 PR opened
🔒 Security Review ✅ Completed 2026-10-30T17:04:01.299769Z 3911321 PR opened
ℹ️ 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.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full change at 3911321. No substantive correctness or maintainability findings.

The diagnostics use the existing stream events and request-ID propagation. They preserve the exception type and prefix, failure timing, retries, and explicit terminal handling. Empty streams still fail and report unavailable IDs. The added message includes correlation metadata without copying prompts or model output.

The regression tests exercise the real SSE parser and public runner, including partial and empty streams, missing request IDs, cleanup, and completed/failed/incomplete events. Hosted CI at this head reports 23 successful checks and two skipped checks. This was a source-only review with an independent source pass; I did not execute candidate code or tests. The local baseline failures described in the PR remain author-reported.

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit e355d69 Oct 30, 2026
27 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the fix/stream-completion-diagnostics branch October 30, 2026 20:25
@openai-sdks openai-sdks Bot mentioned this pull request Oct 30, 2026
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.

3 participants