Skip to content

fix: Prevent undefined result in reasoning budget assertions#523

Merged
FL4TLiN3 merged 2 commits intomainfrom
fix/reasoning-budget-undefined
Feb 15, 2026
Merged

fix: Prevent undefined result in reasoning budget assertions#523
FL4TLiN3 merged 2 commits intomainfrom
fix/reasoning-budget-undefined

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Fix x.thinking && x.thinking.length > 0 returning undefined instead of false when thinking is undefined
  • Use (x.thinking?.length ?? 0) > 0 to always return a boolean
  • Fixes 8 occurrences in reasoning-budget.test.ts

Context

CI run #22034924147 failed because expect(undefined).toBe(true) in OpenAI "should produce more reasoning tokens with higher budget".

🤖 Generated with Claude Code

FL4TLiN3 and others added 2 commits February 15, 2026 11:39
`x.thinking && x.thinking.length > 0` returns `undefined` (not `false`)
when `thinking` is undefined, causing `expect(undefined).toBe(true)` to
fail. Use optional chaining with nullish coalescing instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 merged commit f59ac5e into main Feb 15, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 deleted the fix/reasoning-budget-undefined branch February 25, 2026 13:36
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