mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-08-02 13:04:50 +00:00
The Agent/AgentSwarm tool schemas always advertised a \`model\` choice parameter, so the secondary-model concept entered the prompt even with the experiment disabled. Gate the advertised JSON schema on the flag in both engines: off (the default) drops the parameter, on keeps it, and spawn-time resolution already falls back to the caller's model either way. Also scrub ambient KIMI_CODE_EXPERIMENTAL_* env vars in both packages' vitest setup so flag-dependent tool schemas in llm.tools_snapshot stay deterministic regardless of the developer shell.
13 lines
554 B
TypeScript
13 lines
554 B
TypeScript
/**
|
|
* Hermetic experimental-flag state for tests: scrub ambient
|
|
* `KIMI_CODE_EXPERIMENTAL_*` env vars inherited from the developer shell
|
|
* (e.g. a globally exported `KIMI_CODE_EXPERIMENTAL_FLAG=1`) so flag-driven
|
|
* behavior — including tool schemas embedded in `llm.tools_snapshot`
|
|
* snapshots — stays deterministic and matches CI. Tests opt into flags
|
|
* explicitly via `vi.stubEnv` or harness flag options.
|
|
*/
|
|
for (const key of Object.keys(process.env)) {
|
|
if (key.startsWith('KIMI_CODE_EXPERIMENTAL_')) {
|
|
delete process.env[key];
|
|
}
|
|
}
|