Skip to content

fix(providers): emit explicit disabled thinking when required#228

Draft
GodfatherPacino wants to merge 1 commit into
iOfficeAI:mainfrom
GodfatherPacino:codex/emit-disabled-anthropic-thinking
Draft

fix(providers): emit explicit disabled thinking when required#228
GodfatherPacino wants to merge 1 commit into
iOfficeAI:mainfrom
GodfatherPacino:codex/emit-disabled-anthropic-thinking

Conversation

@GodfatherPacino

Copy link
Copy Markdown

Summary

  • add an emit_disabled_thinking provider compatibility option
  • emit thinking: { "type": "disabled" } on the Anthropic wire path when the option is enabled
  • preserve the existing omission behavior by default for providers where omission already disables thinking
  • document the option for Anthropic-compatible gateways

Problem

Some Anthropic-compatible gateways, including GLM-5.2 deployments, enable thinking by default. The runtime state could be switched to disabled, but the Anthropic request projector omitted the thinking field for ThinkingConfig::Disabled. The gateway therefore continued returning thinking content.

GLM documents that disabling thinking requires an explicit thinking.type = disabled request. The Anthropic Messages schema also defines a disabled thinking configuration, while some provider/model combinations still rely on omission or do not support disabling. A compatibility flag keeps that distinction configuration-driven.

Verification

  • cargo fmt --all
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p aion-config compat_test (28 passed)
  • cargo test -p aion-providers projector_test (27 passed)
  • full repository just push gate, including nextest and cargo-hakari verification

References

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