feat(kimi): thinking level selection for remote sessions (#2349)

* feat(kimi): thinking level selection for remote sessions

Kimi Code's ACP session advertises the active model's thinking levels as
a thought_level config option (`thinking`: off/on or off plus declared
efforts). Expose it like Grok's effort: a session RPC + hub route for the
options, the composer effort picker, and per-turn
session/set_config_option in the remote launcher. The runner forwards
--effort so resumed sessions keep the selection.

* fix(kimi): keep thinking options in step with model switches

Kimi Code answers session/set_model with no config options and pushes
the new model's thought_level via config_option_update; capture it
(opt-in in the ACP backend, same hunk as #2348), re-baseline the
launcher's level after a switch, report 'switch pending' until the next
turn applies it, and have the web poll until discovery succeeds.

* fix(kimi): gate thinking discovery on the model the backend applied

Compare the model the next queued turn carries with the backend's model
instead of session state, so an older queued batch or a failed switch
keeps discovery pending; forward the saved effort on terminal resume.
This commit is contained in:
SSU-WEI HUANG
2026-11-10 08:11:17 +08:00
committed by GitHub
parent 2161a9ff96
commit 2d400a2abd
27 changed files with 267 additions and 26 deletions
+1 -1
View File
@@ -313,7 +313,7 @@ the prompt is loaded by DSH through its own `skill` tool and catalog.
- **Claude Code** (`hapi claude`) — local sessions wrap the native TUI, remote sessions drive the Claude Agent SDK. [Claude Code docs](https://docs.anthropic.com/en/docs/claude-code)
- **Codex** (`hapi codex`) — OpenAI's Codex CLI, with terminal/Web control and a dedicated `plan` mode. See [Codex usage and limits](./codex-shared-sessions.md) for resume, terminal-exit behavior, and launch options. [openai/codex](https://github.com/openai/codex)
- **GitHub Copilot** (`hapi copilot`) — Copilot CLI over ACP (`copilot --acp --stdio`). [GitHub Copilot](https://github.com/features/copilot)
- **Kimi** (`hapi kimi`) — Moonshot AI's Kimi CLI over ACP (`kimi acp`). [MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli)
- **Kimi** (`hapi kimi`) — Moonshot AI's Kimi CLI over ACP (`kimi acp`). Remote sessions can pick a thinking level in the composer when the active model offers one; HAPI applies it before the next turn through ACP `session/set_config_option`. [MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli)
- **OpenCode** (`hapi opencode`) — the open-source OpenCode agent over ACP (`opencode acp`). [opencode.ai](https://opencode.ai)
- **Antigravity** (`hapi agy`) — Google's Antigravity CLI (`agy`) over ACP
(`agy acp`, added in agy 1.5.0). HAPI checks `agy --version` when the