fix: send stream:true on Responses and parse Codex SSE - #6
Conversation
Codex OAuth backends reject unary Responses calls with HTTP 400 Stream must be set to true and return SSE instead of a JSON envelope.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: Warning Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice. Comment |
How this change flows1 changed behaviour across 10 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 46 further behaviours left out to keep the diagram readable. flowchart LR
n0["..._continuation_format_and_provider_options<br/>changed"]:::changed
n1["Result"]:::impacted
n2["parse_responses_response"]:::impacted
n3["translate_responses_request"]:::impacted
n4["ModelRequest"]:::impacted
n5["invoke_responses"]:::impacted
n6["translate_request"]:::impacted
n0 -->|calls| n3
n0 -->|tests| n3
n3 -->|uses| n1
n3 -->|uses| n4
n5 -->|uses| n1
n5 -->|calls| n2
n5 -->|calls| n3
n5 -->|uses| n4
n6 -->|uses| n1
n6 -->|uses| n4
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge. |
Summary
Codex OAuth chat against
/backend-api/codex/responsesreturns HTTP 400Stream must be set to trueand an SSE body. The Responses path was still sending a unary JSON call (streamomitted) and parsing the whole body as one object.This sets
stream: trueon Responses requests, aggregates Codex SSE (response.completedplusoutput_text.delta/output_text.donewhenoutputis empty), and uses the streaming HTTP timeout for that POST.Related issue
OpenHuman: Closes tinyhumansai/openhuman#5497 (the
Stream must be set to truefailure). Sibling symptoms in that issue (steering 404,.debPATH) are out of scope.Also related: tinyhumansai/openhuman#3201 (same Codex Responses constraint; store=false was already fixed).
API or behavior changes
OpenAiModelalways sendsstream: true.invokestill returns oneModelResponse; it now accepts either a JSON envelope or aggregated SSE.ChatModel::streamon Responses is still a folded unary call (same as before).Validation
Commands actually run, with their outcome:
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo build --all-targets --all-features(via clippy + test compile)cargo test --all-features(276 lib tests + 1 integration + doctests)Tests
response.completedwithoutput_textcompleted.outputfilled fromoutput_text.done"stream":true, then SSE →okstream: trueDocumentation
No public API docs: this is wire-shape behavior on an existing
with_responses_api_primarypath.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description