kimi-code/packages/kosong/test
Kai 25a655cf88
feat(agent-core): enable Preserved Thinking by default on the Anthropic provider (#1432)
* feat(agent-core): enable Preserved Thinking by default on the Anthropic provider

Default thinking.keep to "all" for the Anthropic provider (Claude and Kimi in Anthropic-compatible mode) while Thinking is on, via a context_management clear_thinking_20251015 edit, mirroring the Kimi default. Reuses [thinking] keep and KIMI_MODEL_THINKING_KEEP (env > config > default "all"); off-values disable it.

* feat(kosong): route Anthropic Preserved Thinking through the beta Messages API

Force the beta endpoint (client.beta.messages.create) when thinking.keep is enabled, since clear_thinking_20251015 is only honored there. Also prepend clear_thinking to any existing context-management edits (for example clear_tool_uses) instead of replacing them, keeping it first as Anthropic requires when combining edits.

* docs: clarify Anthropic beta endpoint and compaction keep behavior

Note in code comments and bilingual docs that enabling Anthropic Preserved Thinking routes requests to the beta Messages API (client.beta.messages.create), with keep=off as the escape hatch back to the standard endpoint. Correct the resolveThinkingKeep comment to reflect that compaction shares ConfigState.provider and intentionally carries the same keep.

* test(kosong): cover Anthropic beta endpoint (streaming and forced betaApi)

Add a streaming beta-endpoint capture and a test that withThinkingKeep forces the beta endpoint even when constructed with betaApi: false, pinning down the documented behavior.
2026-07-06 23:45:17 +08:00
..
e2e fix(gemini): fix Gemini tool calling and thought-signature round-trip (#1389) 2026-07-05 14:00:09 +08:00
fixtures refactor: resolve model capabilities via a static table lookup (#776) 2026-06-15 17:58:08 +08:00
providers fix(kosong): repair mismatched schema types from Xcode 26.5 MCP (#343) 2026-06-15 20:47:15 +08:00
anthropic-errors.test.ts fix(kosong): retry a dropped provider stream (terminated) on the Anthropic path (#1274) 2026-07-01 22:48:57 +08:00
anthropic.test.ts feat(agent-core): enable Preserved Thinking by default on the Anthropic provider (#1432) 2026-07-06 23:45:17 +08:00
capability-providers.test.ts refactor: resolve model capabilities via a static table lookup (#776) 2026-06-15 17:58:08 +08:00
capability.test.ts refactor: resolve model capabilities via a static table lookup (#776) 2026-06-15 17:58:08 +08:00
catalog.test.ts feat(agent-core): progressive tool disclosure via select_tools (#1369) 2026-07-06 15:51:08 +08:00
echo-provider.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
errors.test.ts fix(agent-core): harden tool_use/tool_result exchange integrity (#1340) 2026-07-03 14:26:57 +08:00
finish-reason.test.ts fix: prevent streaming tool argument CPU spikes (#29) 2026-05-25 19:49:11 +08:00
generate.test.ts feat(timing): split TTFT into api-server and client portions (#1228) 2026-06-30 19:15:02 +08:00
google-genai.test.ts fix(gemini): fix Gemini tool calling and thought-signature round-trip (#1389) 2026-07-05 14:00:09 +08:00
kimi-files.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
kimi.test.ts feat: add KIMI_MODEL_THINKING_EFFORT to force a thinking effort (#1275) 2026-07-01 21:20:27 +08:00
message.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
openai-common-errors.test.ts refactor!: overhaul thinking config and effort resolution (#1132) 2026-06-30 22:34:13 +08:00
openai-legacy.test.ts feat: cap completion tokens to remaining context window for chat-completions (#1131) 2026-06-26 19:12:04 +08:00
openai-responses.test.ts refactor!: overhaul thinking config and effort resolution (#1132) 2026-06-30 22:34:13 +08:00
provider.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
regression.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
scripted-echo-provider.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
select-tools.test.ts feat(agent-core): progressive tool disclosure via select_tools (#1369) 2026-07-06 15:51:08 +08:00
simple-toolset.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
step.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
stress.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
strict-role-alternation.test.ts feat(agent-core): rework compaction to keep only user prompts and summary (#1214) 2026-07-01 01:17:30 +08:00
tool-message-conversion.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
type-safety-negative.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
type-safety.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
typed-tool.test.ts feat: flatten tool call records (#25) 2026-05-25 23:02:25 +08:00
usage.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00