Skip to content

Codex auxiliary title generation crashes when final output is None #33368

@pavegrid-1

Description

@pavegrid-1

Summary

Hermes can log this warning during auxiliary title generation:

Auxiliary title generation failed: 'NoneType' object is not iterable

Cause

_CodexCompletionsAdapter.create() iterates final.output from the Codex Responses stream. Some final responses can have output set to None. In that case, getattr(final, "output", []) still returns None, and iterating it raises TypeError.

Expected behavior

Treat missing or None final output as an empty list, and continue using any streamed output that was already collected.

Local fix

Local commit 58444dd99 normalizes final is None and final.output is None, then adds regression tests covering streamed text with None final output and empty None final output.

Verification

venv/bin/python -m pytest tests/agent/test_auxiliary_client.py
174 passed, 1 warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecodexcomp/agentCore agent loop, run_agent.py, prompt builderduplicateThis issue or pull request already existstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions