Skip to content

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
mainfrom
feat/first-class-model-support
Draft

feat: first-class reasoning/thinking + tool translation for GLM-5.x, Kimi-K2.6/2.7-code, DeepSeek-V4, grok-4.5#5
jatmn wants to merge 1 commit into
mainfrom
feat/first-class-model-support

Conversation

@jatmn

@jatmn jatmn commented Jul 12, 2026

Copy link
Copy Markdown
Owner

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/completions with function tools — no Responses endpoint and no native custom tool type — so "first class special tool calls" means correct customfunction coercion plus faithful reconstruction (already implemented), and the gaps were in reasoning/thinking shaping, reasoning-history round-tripping, and context windows.

  • grok-4.5 (was entirely missing): added catalog entry — 500k context, reasoning_effort support with nonelow mapping (grok-4.5 cannot disable reasoning), web search, image modality.
  • DeepSeek-v4-flash / -pro: fixed context window (256k → 1M, both are 1M per DeepSeek docs); enabled preserve_reasoning_content_history so tool-use turns replay reasoning_content (provider returns 400 otherwise); now forwards reasoning_effort alongside thinking.type.
  • GLM-5.x: broad transform now forwards reasoning_effort so GLM-5.2 honors its native effort control (GLM-5/5.1 ignore it, harmless).
  • Kimi-K2.6 / K2.7-code: verified already correct (thinking.type=enabled, thinking.keep=all, history preserved for code variants, sampling overrides dropped) — no change.

Rust change

Ported the reasoning_effort_none_value capability into this branch (self-contained, no dependency on other branches): added the field to TransformConfig/TransformConfigPatch schema, wired it through TransformConfigPatch::apply_to, and added apply_reasoning_effort_none_value in transform_morph.rs (called from responses_to_chat). This lets models that cannot disable reasoning map none to a valid level.

Docs / tests

  • Updated docs/model-family-catalogs.md and README.md coverage tables (grok-4.5 added; DeepSeek 1M + history note; GLM-5.2 effort note).
  • Added first_class_reasoning_and_tool_translation_for_target_models test; updated the existing DeepSeek context assertion to 1M.

Validation

  • cargo fmt --check clean
  • cargo test --locked — 126 passed, 0 failed
  • cargo build --locked succeeds (one pre-existing unrelated dead_code warning already on main)
  • git diff --check clean

Notes / follow-ups

  • Optional live smoke test against real API keys for grok-4.5 nonelow behavior; xAI's own docs conflict on whether none hard-errors, so the mapping is a safeguard.
  • DeepSeek V4 reasoning_effort valid values are high/max (low/medium are mapped up by the provider); forwarding the Codex level works as-is.

🤖 Generated with opencode

…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.
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