Two real gaps in the Kimi adapter surfaced while verifying it live (in a separate .venv-kimi, since it can't co-install with claude-agent-sdk — see #29). Both are deferred until the MCP conflict in #29 resolves, because Kimi can't be exercised in CI or alongside the other providers until then.
Gap 1 — LLMNotSet against a fresh setup (blocks all live use)
KimiSession._ensure_sdk_session passes config=None to Session.create and relies on the SDK's env-var augmentation (KIMI_API_KEY / KIMI_BASE_URL / KIMI_MODEL_NAME). But that augmentation only mutates a pre-existing "kimi"-type provider; a default ~/.kimi/config.toml is empty (providers = {}, models = {}), so there's nothing to augment → kosong … LLMNotSet: LLM not set. The in-code comment at kimi.py:1332-1338 already flags this as deferred ("a future iteration may route through Config properly").
Proven fix (spiked live — it reaches the Moonshot API): build a kimi_cli.config.Config from the adapter's resolved api_key / base_url / model and pass it as config= to Session.create:
from kimi_cli.config import Config, LLMProvider, LLMModel
from pydantic import SecretStr
cfg = Config(
default_model=model_id,
models={model_id: LLMModel(provider="moonshot", model=model_id,
max_context_size=256_000, capabilities={"thinking"})},
providers={"moonshot": LLMProvider(type="kimi", base_url=base_url, api_key=SecretStr(api_key))},
)
sess = await Session.create(work_dir=…, config=cfg, model=model_id, yolo=…, thinking=…)
With this, LLMNotSet disappears and the request reaches Moonshot (verified: it then returned a 429 account-balance error — i.e. auth + config + request path all work).
Gap 2 — structured output declared but not wired
KimiSession._gate_and_coerce_prompt (kimi.py:1304-1314) rejects schema= with NotImplementedError, yet the runtime declares STRUCTURED_OUTPUT_JSON_SCHEMA = True (a conformance requirement). Intended approach (per the module docstring): a forced submit_result tool mirroring CopilotRuntime. Constraint discovered: Kimi's Session.create() exposes only agent_file + mcp_configs (no in-process tools=, no tool_choice), so it must run a FastMCP submit_result server + force the call via system prompt + capture the args off the wire stream — and that forcing behavior needs a live spike to validate (no tool_choice).
Status
Two real gaps in the Kimi adapter surfaced while verifying it live (in a separate
.venv-kimi, since it can't co-install withclaude-agent-sdk— see #29). Both are deferred until the MCP conflict in #29 resolves, because Kimi can't be exercised in CI or alongside the other providers until then.Gap 1 —
LLMNotSetagainst a fresh setup (blocks all live use)KimiSession._ensure_sdk_sessionpassesconfig=NonetoSession.createand relies on the SDK's env-var augmentation (KIMI_API_KEY/KIMI_BASE_URL/KIMI_MODEL_NAME). But that augmentation only mutates a pre-existing "kimi"-type provider; a default~/.kimi/config.tomlis empty (providers = {},models = {}), so there's nothing to augment →kosong … LLMNotSet: LLM not set. The in-code comment atkimi.py:1332-1338already flags this as deferred ("a future iteration may route through Config properly").Proven fix (spiked live — it reaches the Moonshot API): build a
kimi_cli.config.Configfrom the adapter's resolved api_key / base_url / model and pass it asconfig=toSession.create:With this,
LLMNotSetdisappears and the request reaches Moonshot (verified: it then returned a 429 account-balance error — i.e. auth + config + request path all work).Gap 2 — structured output declared but not wired
KimiSession._gate_and_coerce_prompt(kimi.py:1304-1314) rejectsschema=withNotImplementedError, yet the runtime declaresSTRUCTURED_OUTPUT_JSON_SCHEMA = True(a conformance requirement). Intended approach (per the module docstring): a forcedsubmit_resulttool mirroringCopilotRuntime. Constraint discovered: Kimi'sSession.create()exposes onlyagent_file+mcp_configs(no in-processtools=, notool_choice), so it must run a FastMCPsubmit_resultserver + force the call via system prompt + capture the args off the wire stream — and that forcing behavior needs a live spike to validate (notool_choice).Status
KimiRuntime.execute()runtime stub is fixed in fix(kimi): wire KimiRuntime.execute() to delegate to a session #35 (the session layer already worked at the code level).