mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-09 17:29:12 +00:00
* fix(kosong): make OpenAI-compatible thinking work without reasoning_key
Reasoning field names (reasoning_content / reasoning_details / reasoning)
are protocol facts, not user preferences. Treating reasoning_key as a
required user-set field meant any path that didn't go through the catalog
— hand-written config.toml in particular — silently lost thinking content
and broke strict gateways like DeepSeek.
Demote reasoning_key to an internal protocol constant with an explicit
override:
- Inbound (stream + non-stream): scan reasoning_content,
reasoning_details, reasoning in order; first string value wins. An
explicit reasoning_key restricts the scan to that one field.
- Outbound: serialize ThinkPart back as reasoning_content by default.
An explicit reasoning_key writes to that field instead.
- reasoning_effort auto-injection no longer requires reasoning_key;
presence of ThinkPart in history is enough.
Catalog plumbing is unchanged — explicit values from the catalog still
win, the default just stops being undefined.
Manually verified end-to-end against the real DeepSeek API with a
hand-written config.toml that does not set reasoning_key: thinking
content renders, no 400, multi-turn conversations work.
* fix(kosong): normalize blank reasoning_key to unset
ModelAliasSchema accepts `reasoning_key = ""` (z.string().optional()).
A blank value used to disable the default field scan and route both
inbound reads and outbound writes through an empty property name.
Trim and treat empty as undefined at the provider boundary so the
default protocol behavior applies.
* fix(kosong): preserve caller-pinned reasoning_effort during auto-inject
When the history contains ThinkPart, generate() injects
reasoning_effort='medium' and then assigns it onto createParams,
which used to silently overwrite a value the caller set via
withGenerationKwargs({ reasoning_effort: 'high' }). Skip auto-inject
when an explicit reasoning_effort already lives in kwargs.
|
||
|---|---|---|
| .. | ||
| .vitepress | ||
| en | ||
| media | ||
| public | ||
| zh | ||
| .gitignore | ||
| .npmrc | ||
| AGENTS.md | ||
| index.md | ||
| package.json | ||
| pnpm-lock.yaml | ||