Skip to content

fix(runtime): honor Kimi K3 none effort - #6183

Merged
me2seeks merged 2 commits into
apache:mainfrom
me2seeks:fix/kimi-k3-effort-test-fixture-20261020
Oct 20, 2026
Merged

me2seeks merged 2 commits into
apache:mainfrom
me2seeks:fix/kimi-k3-effort-test-fixture-20261020

Conversation

@me2seeks

@me2seeks me2seeks commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Kimi Code's refreshed models.dev metadata now declares none for K3. Maka resolves that as off, but the Kimi Coding Plan request builder previously dropped off, leaving K3 at its default reasoning level. When the metadata declares none, send Kimi's explicit disabled-thinking wire for Anthropic Messages and reasoning_effort: none for OpenAI Chat. Keep the current behavior for catalog entries that do not declare none. The wire mapping follows the Kimi Code model configuration.

Verification

  • npm run build:test
  • node --test packages/runtime/dist/__tests__/model-factory-thinking.test.js — 55 passed
  • node --test packages/runtime-host/dist/__tests__/execution-model-composition.test.js — 43 passed, including prompt-suggestion cases with and without none metadata
  • Biome check on the three changed files and git diff --check

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented the runtime mapping and tests.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — when refreshed Kimi Code metadata declares none, the least-reasoning choice now disables thinking.
  • No

Generated-by: OpenAI Codex
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Oct 20, 2026
@me2seeks me2seeks mentioned this pull request Oct 20, 2026
4 of 6 tasks

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.

First review of 4e46ba3e (+60/-20, 3 files). No P0–P2 findings.

Root cause this fixes. The Host test prompt suggestions ask Kimi K3 for its lowest effort… started failing intermittently on many unrelated PRs from about 2026-10-20 01:55Z, with thinking left undefined. The test read the process-wide model metadata, and refreshed models.dev data now declares none for kimi-coding-plan/k3. Once none is present, thinkingVariantsForModel includes off, so leastReasoningThinkingLevel picks off. Before this PR the Kimi builder dropped off to {}, so K3 was left on its default reasoning. That is both why the test went red and a real behavior gap: with current upstream metadata, "off" and prompt suggestions did not actually disable K3 thinking.

Change.

  • model-factory.ts (kimi-coding-plan case): off now sends an explicit disabled wire when the metadata declares none — thinking: { type: 'disabled' } on Anthropic Messages, reasoningEffort: 'none' on the OpenAI-compatible route. Without none (bundled catalog), off still returns {} as before, and on/unset are unchanged.
  • The Host test now pins the refreshed shape with installRefreshedModelMetadata and resets it in t.after, matching the pattern in model-metadata-refresh.test.ts. So it no longer depends on what other code installed process-wide. It asserts disabled thinking, no effort, and the 128-token no-thinking budget.
  • A new runtime unit test covers both wires and leastReasoningThinkingLevel === 'off' under the refreshed shape. The existing bundled-catalog assertion (off → {}) is kept.

P3 (optional): the Host-level prompt-suggestion path for a catalog without none (previously asserted as adaptive thinking with effort: low, max_tokens 1024) no longer has a composition-level test; only the unit-level off → {} assertion remains. A second pinned case without none would keep that path covered.

CI. The first test run (39365300767) failed in "Run affected standard workspace tests" on Maka Pi TUI runner › serializes an idle /session switch behind a retraction started during its activity wait. This PR does not touch the TUI, so that looks like an unrelated timing-sensitive test; I re-ran the failed job. The Runtime Host step did not complete in that run, so the pinned Kimi case still needs to pass on this head before merge.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.

Incremental review of 4e46ba3e..b3c77402 (one test-only commit, no rebase). No P0–P2 findings; the earlier P3 is fixed.

The Host prompt-suggestion test is now a two-scenario table, each pinning its own refreshed kimi-coding-plan/k3 catalog shape and resetting it in t.after:

  • with none declared: thinking: { type: 'disabled' }, no effort anywhere in the body, max_tokens 128;
  • without none: thinking: { type: 'adaptive' }, "effort":"low", max_tokens 1024 — the behavior the original test asserted, so the no-none path is covered end to end again.

Most of the diff is re-indentation inside the loop; with whitespace ignored, only the scenario table and the parameterized assertions change. Nit (no action needed): the effort branch matches the literal "low" rather than scenario.effort, which is fine while there is only one such scenario.

Production code is unchanged from the previous review. CI test on this head was still pending when I checked.

@github-actions github-actions Bot added effort/M Under 500 readable lines and removed effort/S Under 100 readable lines labels Oct 20, 2026
@me2seeks
me2seeks merged commit a78901e into apache:main Oct 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants