feat: first-class reasoning/thinking + tool translation for GLM-5.x, Kimi-K2.6/2.7-code, DeepSeek-V4, grok-4.5#5
Draft
jatmn wants to merge 1 commit into
Draft
Conversation
…Kimi-K2.6/2.7-code, DeepSeek-V4, grok-4.5 - Add missing grok-4.5 catalog entry (500k context, reasoning_effort with none->low mapping, web search, image modality). - Fix DeepSeek-v4-flash context window (256k -> 1M) and enable preserve_reasoning_content_history for DeepSeek-v4-flash/-pro so tool-use turns replay reasoning_content (provider 400s otherwise); forward reasoning_effort alongside thinking.type. - Forward reasoning_effort for GLM-5.x so GLM-5.2 honors its native effort control (GLM-5/5.1 ignore it harmlessly). - Port reasoning_effort_none_value capability into config schema + request morph so models that cannot disable reasoning map none to a valid level. - Verify Kimi-K2.6/-2.7-code are already correct (thinking.type=enabled, thinking.keep=all, history preserved, sampling overrides dropped). - Update model-family-catalogs.md and README coverage tables; add/extend tests. All providers only expose OpenAI /chat/completions with function tools, so "first class special tool calls" = correct custom->function coercion plus faithful reconstruction, already implemented; this makes reasoning/thinking, context, and history translation complete for the listed models. Validated: cargo fmt --check, cargo test --locked (126 passed), cargo build --locked, git diff --check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings first-class translation coverage to the listed models in Codex Warp's model-family catalogs. All four providers (Z.ai, Moonshot, DeepSeek, xAI) expose only OpenAI
/chat/completionswithfunctiontools — no Responses endpoint and no nativecustomtool type — so "first class special tool calls" means correctcustom→functioncoercion plus faithful reconstruction (already implemented), and the gaps were in reasoning/thinking shaping, reasoning-history round-tripping, and context windows.reasoning_effortsupport withnone→lowmapping (grok-4.5 cannot disable reasoning), web search, image modality.preserve_reasoning_content_historyso tool-use turns replayreasoning_content(provider returns 400 otherwise); now forwardsreasoning_effortalongsidethinking.type.reasoning_effortso GLM-5.2 honors its native effort control (GLM-5/5.1 ignore it, harmless).thinking.type=enabled,thinking.keep=all, history preserved for code variants, sampling overrides dropped) — no change.Rust change
Ported the
reasoning_effort_none_valuecapability into this branch (self-contained, no dependency on other branches): added the field toTransformConfig/TransformConfigPatchschema, wired it throughTransformConfigPatch::apply_to, and addedapply_reasoning_effort_none_valueintransform_morph.rs(called fromresponses_to_chat). This lets models that cannot disable reasoning mapnoneto a valid level.Docs / tests
docs/model-family-catalogs.mdandREADME.mdcoverage tables (grok-4.5 added; DeepSeek 1M + history note; GLM-5.2 effort note).first_class_reasoning_and_tool_translation_for_target_modelstest; updated the existing DeepSeek context assertion to 1M.Validation
cargo fmt --checkcleancargo test --locked— 126 passed, 0 failedcargo build --lockedsucceeds (one pre-existing unrelateddead_codewarning already onmain)git diff --checkcleanNotes / follow-ups
none→lowbehavior; xAI's own docs conflict on whethernonehard-errors, so the mapping is a safeguard.reasoning_effortvalid values arehigh/max(low/medium are mapped up by the provider); forwarding the Codex level works as-is.🤖 Generated with opencode