Repository navigation
Conversation
Gemini 4 supports only LOW/MEDIUM/HIGH thinking levels and always thinks; sending MINIMAL for effort=off makes every request fail with a 400. Degrade 'off' to LOW (thoughts still hidden) for gemini-4 models in both the agent-core-v2 requester and the legacy kosong provider, keeping MINIMAL for Gemini 3. Co-authored-by: 7Hanrui <[email protected]>
🦋 Changeset detectedLatest commit: 7bc8445 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82ecd70eba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-authored-by: 7Hanrui <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 218674f985
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
LOW with suppressed thoughts is the Gemini 4 encoding of 'off', so map it back to 'off' in the thinkingEffort getter instead of reporting 'low'. Co-authored-by: 7Hanrui <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ca6de7704
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…mini-4 Only Gemini 4 encodes 'off' as LOW with suppressed thoughts, so gate the reverse mapping on the model; a caller-supplied LOW/includeThoughts=false on other models keeps reporting 'low'. Co-authored-by: 7Hanrui <[email protected]>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c225911b79
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Gemini 4 encodes 'off' as LOW with suppressed thoughts, which is indistinguishable from an explicit LOW/includeThoughts=false kwarg, so no reverse mapping can serve both callers. Nothing in the repo reads this getter to persist or display effort, so keep the derive-from-kwargs semantics; for Gemini 4's 'off', 'low' is the honest report of what runs. Co-authored-by: 7Hanrui <[email protected]>
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Gemini 4 supports only LOW/MEDIUM/HIGH thinking levels and always thinks, so requesting effort 'off' now fails fast with a clear thinking-config error (matching the always-reasons rejection other protocols already use) instead of sending an invalid MINIMAL level or silently degrading to LOW. Co-authored-by: 7Hanrui <[email protected]>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…MoonshotAI#4230) Ported from MoonshotAI/kimi-code 2.3.0 (b260326). Adaptation: kept this fork's extra `#/llm/protocol/format` import in the google-genai format module and widened the neighbouring `#/llm/thinking` import to carry `ThinkingConfigError`.
Requirement or Bug
#4207 的遗留缺口:#4208 已把
gemini-4加入 thinkingLevel 白名单,但effort=off分支仍下发thinkingLevel: 'MINIMAL'。官方文档(模型页与 thinking 指南)写明gemini-4-argon的思考档位只支持 low / medium / high(默认 medium)且思考永远开启、无法关闭——MINIMAL 对 Gemini 4 是非法档位,请求会被上游以 400 拒绝(与 #4207 的 budget 报错同类同因)。设计决策(维护者拍板):不做静默降级,gemini-4 + off 直接报错,与仓内 anthropic 等协议的 always-reasons 拒绝语义一致。
Bug Reproduction Steps
配置
google-genai类型 provider 与gemini-4-*模型,思考强度设为 off(模型配置default_effort = "off"或运行中切到 off),发任意请求 → 上游 400。Root Cause
level 分支把 off 硬编码为
MINIMAL;该值对 Gemini 3 可用,对 Gemini 4 不存在。本 PR 在编码层对 gemini-4 + off 抛出明确的 thinking-config 错误(ThinkingConfigError('thinking-cannot-disable')/ kosongChatProviderError),报错文案与 anthropic 协议的同类拒绝同款。Code Changes
packages/agent-core-v2/src/human/llm/requester/bases/google-genai/format.ts:gemini-4 +off抛ThinkingConfigError('thinking-cannot-disable')(走llm.failed.syntax/ code=thinking_config,与 anthropic 协议行为一致);gemini-3 的 off→MINIMAL 保持不变。packages/kosong/src/providers/google-genai.ts:withThinking同步同款拒绝(ChatProviderError),分支注释更新;getter 与 main 完全一致(净零变更)。llm.failed.syntax(codethinking_config、含 'always reasons'、无llm.sent)断言,与 anthropic 同款用例形态,gemini-3 off→MINIMAL 用例保留。@moonshot-ai/kimi-code)。Behavior Changes and Affected Users
google-genai协议下gemini-4-*模型effort=offMINIMAL,上游 400(错误文案为上游返回的英文 400)gemini-3-*、gemini-2.5-*等其余模型的全部 effort 档覆盖情况:两侧引擎各有断言报错形态的新增用例;gemini-3 的 off→MINIMAL 行为由既有套件与新增用例 pin 住。
另注(本 PR 不处理):官方文档显示
gemini-3-pro-preview同样只列 low/high 两档,现行对 3-pro 的 medium→MEDIUM、off→MINIMAL 与文档不完全一致,暂无用户报告,建议另开 issue 评估。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.