Skip to content

[codex] Handle empty model response choices - #67

Open
h0rv wants to merge 3 commits into
jxnl:mainfrom
h0rv:codex-fix-empty-openai-jsonschema-choices
Open

[codex] Handle empty model response choices#67
h0rv wants to merge 3 commits into
jxnl:mainfrom
h0rv:codex-fix-empty-openai-jsonschema-choices

Conversation

@h0rv

@h0rv h0rv commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Fixes #66.

Summary

  • Guard OpenAI JSON and JSONSchema response handling before reading Choices[0].
  • Skip empty OpenAI stream chunks instead of panicking on Choices[0].
  • Add matching guards for Anthropic JSONSchema content and schema ref parsing.
  • Add a focused OpenAI regression test for empty choices.

Validation

  • GOCACHE=/tmp/go-build-cache GOMODCACHE=/tmp/go-mod-cache go test ./...

@h0rv
h0rv marked this pull request as ready for review May 22, 2026 18:31
@h0rv

h0rv commented May 22, 2026

Copy link
Copy Markdown
Collaborator Author

@jxnl +1 plz?

@h0rv

h0rv commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

@jxnl would i get be able to get admin access to this repo again please - would make bumping deps + small bug fixes easier as the repo is mostly in maintenance state. Thanks!

@h0rv
h0rv requested a review from jxnl June 22, 2026 18:03
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.

Panic on empty array for JSONSchema

2 participants