Skip to content

Fix GPT-5 chat failures by stripping unsupported sampling params#539

Open
hershkop wants to merge 1 commit into
Ironclad:mainfrom
hershkop:fix/gpt5-reasoning-model-params
Open

Fix GPT-5 chat failures by stripping unsupported sampling params#539
hershkop wants to merge 1 commit into
Ironclad:mainfrom
hershkop:fix/gpt5-reasoning-model-params

Conversation

@hershkop

@hershkop hershkop commented May 1, 2026

Copy link
Copy Markdown

Summary

  • Strip unsupported sampling parameters (top_p, frequency_penalty, presence_penalty, stop, n) for reasoning models (o1, o3, o4, gpt-5) in the isReasoningModel branch of ChatNodeBase.ts
  • Fix gpt-5-mini cost typo: 0.25 - 6 (evaluates to -5.75) → 0.25e-6

Context

GPT-5 chat requests fail when a graph carries non-default sampling parameters from non-reasoning models. The OpenAI API rejects these with errors like "Unsupported parameter: 'stop' is not supported with this model". The existing isReasoningModel branch already correctly uses max_completion_tokens instead of max_tokens and omits temperature, but does not clear the other unsupported parameters.

Fixes #531

Test plan

  • yarn build — TypeScript compiles successfully
  • yarn test — all 63 existing tests pass
  • yarn lint — 0 errors (4 pre-existing warnings)
  • Validated against real OpenAI API: GPT-5 rejects requests with sampling params (400), succeeds without them (200)

🤖 Generated with Claude Code

…reasoning models

  Reasoning models (o1, o3, o4, gpt-5) reject frequency_penalty, presence_penalty,
  top_p, stop, and n. Clear these in the isReasoningModel branch so they aren't sent
  to the API. Also fix gpt-5-mini cost typo (0.25 - 6 → 0.25e-6).

  Fixes Ironclad#531
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.

[Bug]: OpenAI gpt-5 models no response

1 participant