chat.params: heuristic family aliases override model-declared variants (glm low→high, grok xhigh clamped)

Author: xiongyangCreated Sep 16, 2026Updated Sep 16, 2026

Environment

  • oh-my-openagent 5.0.0-beta.67 (opencode plugin, oh-my-openagent@beta)
  • Providers: builtin zhipuai-coding-plan (glm-5.3 / glm-5.3-flash), opencode-go (grok-4.6), deepseek

Summary

resolveField() in packages/model-core/src/model-settings-compatibility.ts checks family aliases before model metadata. When a heuristic family defines an alias for the requested tier, the alias fires even if the model's own declared variants include that tier:

  • glm family: reasoningEfforts: ["high", "max"] + reasoningEffortAliases: { low: "high", medium: "high" } → requesting low for glm-5.3 (declared variants: low/high/max) is silently rewritten to high
  • grok family: variants/reasoningEfforts: ["low", "medium", "high"] (no xhigh) → requesting xhigh for grok-4.6 (declared low/medium/high/xhigh) gets clamped/degraded

Code path: createChatParamsHandler (chat.params hook) → resolveCompatibleModelSettingsresolveField(normalized, family?.reasoningEfforts, familyKnown, metadataReasoningEfforts, family?.reasoningEffortAliases) — the alias branch returns before the metadataOverride.includes(normalized) check is ever reached.

Reproduction

A/B via opencode CLI — same model, same prompt, only variable is whether the plugin is loaded:

Command reasoning tokens
opencode run --pure -m zhipuai-coding-plan/glm-5.3 --variant low "37*93...只输出数字" 0
opencode run -m zhipuai-coding-plan/glm-5.3 --variant low "37*93...只输出数字" (omo active) 25–28

Pure-run ladder for calibration (no plugin): glm-5.3 low=0 / max=36 on a trivial prompt; low=52 / high=95 on a harder one; grok-4.6 low=151 / xhigh=202.

Agent dispatch through omo.jsonc (variant field) shows the same divergence:

  • agent configured grok-4.6 @ xhigh16 reasoning tokens (far below grok's low baseline of 151); session DB confirms grok-4.6 actually served the request, so it is not a fallback-model artifact
  • agent configured glm-5.3 @ low emits the same reasoning volume as one configured max
  • every plugin-active run lands in a narrow 10–32 reasoning-token band regardless of configured tier — runtime effort appears decoupled from configuration

Expected behavior

Model-declared capabilities (provider registry / bundled snapshot) should take precedence over heuristic family aliases. An alias should only apply when the requested tier is unsupported by both metadata and family caps.

This also matches the documented architecture ("the bundled model capability snapshot is the single source of truth for model feature detection") — heuristic alias precedence currently contradicts it.

Impact

  • Cost/speed-optimized low-tier agents are silently upgraded to high: more thinking tokens, slower responses
  • xhigh configurations on grok are silently degraded
  • The config is fully conformant to the provider's declared variants, yet runtime behavior diverges — very hard to debug from the user side

Source: code-yeongyu/oh-my-openagent