Skip to content

fix: reasoning_content AttributeError on non-reasoning models#338

Merged
MaxEriksson2000 merged 1 commit intodevelopfrom
fix/reasoning-content-attribute-error
Apr 10, 2026
Merged

fix: reasoning_content AttributeError on non-reasoning models#338
MaxEriksson2000 merged 1 commit intodevelopfrom
fix/reasoning-content-attribute-error

Conversation

@MaxEriksson2000
Copy link
Copy Markdown
Collaborator

Summary

  • The pyright strict hardening in chore: enable global pyright strict mode #325 replaced hasattr(msg, "reasoning_content") with direct attribute access msg.reasoning_content
  • The runtime Message object from the OpenAI SDK doesn't have this attribute on non-reasoning models, causing AttributeError and failing all app runs
  • Fix: use getattr(msg, "reasoning_content", None) for safe access

The pyright strict hardening in #325 replaced hasattr() checks with
direct attribute access, but the runtime Message object from the
OpenAI SDK does not have reasoning_content on non-reasoning models,
causing AttributeError and failing all app runs.
@MaxEriksson2000 MaxEriksson2000 merged commit 7472151 into develop Apr 10, 2026
7 checks passed
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.

1 participant