Skip to content

[fix] handle OpenAI thinking parameter compatibility - #40

Open
ice789ice wants to merge 1 commit into
Forget-C:mainfrom
ice789ice:fix/openai-thinking-compat
Open

ice789ice wants to merge 1 commit into
Forget-C:mainfrom
ice789ice:fix/openai-thinking-compat

Conversation

@ice789ice

Copy link
Copy Markdown

Summary

Fix OpenAI compatibility when Jellyfish builds a text model with thinking=False.

The current implementation sends:

extra_body["enable_thinking"] = False

to all providers. The official OpenAI API rejects this parameter with 400 Unknown parameter: 'enable_thinking'.

This change maps thinking=False to reasoning_effort="none" for the OpenAI provider, while preserving the existing enable_thinking=False behavior for other providers.

Changes

  • update sync LLM runtime handling
  • update async LLM resolver handling
  • update resolver unit test expectations for OpenAI

Verification

  • reproduced with official OpenAI API using gpt-5.6-sol
  • storyboard extraction succeeds after the change
  • asset/dialogue extraction succeeds after the change
  • tests/test_llm_resolver.py: 8 passed

Fixes #38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2c5f0351f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

provider_key = resolve_provider_key_from_name(provider.name)

if provider_key == "openai":
kwargs.setdefault("reasoning_effort", "none")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Override configured reasoning effort when disabling thinking

When an OpenAI model's configurable model.params already contains reasoning_effort such as "high", setdefault preserves that value, so all thinking=False callers—including script division, extraction, and frame-prompt generation—continue to use reasoning rather than disabling it. This branch should force "none", as the non-OpenAI branch already forces its toggle, and the mirrored sync implementation should be changed consistently.

Useful? React with 👍 / 👎.

Comment on lines 181 to +182
if not thinking:
extra_body = dict(kwargs.get("extra_body") or {})
extra_body["enable_thinking"] = False
kwargs["extra_body"] = extra_body
provider_key = resolve_provider_key_from_name(provider.name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the changed LLM compatibility logic

This adds non-obvious, provider-specific parameter behavior to _build_chat_openai_model, but the function still has no documentation explaining what it constructs or why this compatibility branch exists; the changed sync constructor is likewise undocumented. Add synchronized function documentation for both builders so the required provider behavior and its rationale remain maintainable.

AGENTS.md reference: AGENTS.md:L11-L14

Useful? React with 👍 / 👎.

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 models fail when thinking=False due to unsupported enable_thinking parameter

1 participant