fix(agent): guard Codex output_text null-output access - #33428
fix(agent): guard Codex output_text null-output access#33428dominicvenox wants to merge 1 commit into
Conversation
|
Thanks for the patch and the clean test, but going to close this as effectively superseded by the wave that landed today. What the live flow actually does when
This PR wraps the two
So the patch is defensive-only — doesn't fix a real failure mode and doesn't introduce one. We'd rather not add the indirection (and rename the secondary failure from TypeError to RuntimeError) for zero behavioral gain. Background on the wave that already landed:
Empirically verified today against live Appreciate you taking the time to look at this — if you have a concrete repro where the line 1228 path still trips today, please re-open with the trace and I'll widen the fix there instead. |
Summary
Adds a defensive guard around
response.output_textaccess in the Codex Responses normalization path.Some SDK Response objects compute
output_textby iteratingresponse.output. If a provider returns a terminal response withoutput = None, that convenience property can raise:TypeError: 'NoneType' object is not iterableThis keeps the existing empty-output recovery behavior, but avoids letting the fallback
output_textcheck become a second crash site.Test
python -m pytest tests/agent/test_codex_responses_adapter.py -q