Skip to content

Commit ebad487

Browse files
authored
feat(llm): better thinking mode control (#608)
Signed-off-by: Richard Chien <stdrc@outlook.com>
1 parent aee9124 commit ebad487

45 files changed

Lines changed: 446 additions & 268 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.kimi/prompts/gen-changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
根据当前分支相对于 main 分支的修改,在的 @CHANGELOG.md 文件中添加更新日志条目,遵循现有的格式和风格。
1+
根据当前分支相对于 main 分支的修改,在的根目录 CHANGELOG.md 或相应 package/sdk 等目录的 CHANGELOG.md 文件中添加更新日志条目,遵循现有的格式和风格。

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Only write entries that are worth mentioning to users.
1111

1212
## Unreleased
1313

14+
- Shell: Use `/model` to toggle thinking mode instead of Tab key
15+
- Config: Add `default_thinking` config option (auto-migrated from metadata)
16+
- LLM: Add `always_thinking` capability for models that always use thinking mode
17+
1418
## 0.76 (2026-01-12)
1519

1620
- Tool: Make `ReadFile` tool description reflect model capabilities for image/video support

docs/en/configuration/config-files.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The configuration file contains the following top-level configuration items:
2525
| Item | Type | Description |
2626
| --- | --- | --- |
2727
| `default_model` | `string` | Default model name, must be a model defined in `models` |
28+
| `default_thinking` | `boolean` | Whether to enable thinking mode by default (defaults to `false`) |
2829
| `providers` | `table` | API provider configuration |
2930
| `models` | `table` | Model configuration |
3031
| `loop_control` | `table` | Agent loop control parameters |
@@ -35,6 +36,7 @@ The configuration file contains the following top-level configuration items:
3536

3637
```toml
3738
default_model = "kimi-for-coding"
39+
default_thinking = false
3840

3941
[providers.kimi-for-coding]
4042
type = "kimi"

docs/en/configuration/env-vars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export KIMI_MODEL_MAX_CONTEXT_SIZE="262144"
5353

5454
### `KIMI_MODEL_CAPABILITIES`
5555

56-
Overrides the model's `capabilities` field in the configuration file. Multiple capabilities are comma-separated, supported values are `thinking`, `image_in`, and `video_in`.
56+
Overrides the model's `capabilities` field in the configuration file. Multiple capabilities are comma-separated, supported values are `thinking`, `always_thinking`, `image_in`, and `video_in`.
5757

5858
```sh
5959
export KIMI_MODEL_CAPABILITIES="thinking,image_in"

docs/en/configuration/providers.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ The `capabilities` field in model configuration declares the capabilities suppor
108108

109109
| Capability | Description |
110110
| --- | --- |
111-
| `thinking` | Supports thinking mode (deep reasoning) |
111+
| `thinking` | Supports thinking mode (deep reasoning), can be toggled |
112+
| `always_thinking` | Always uses thinking mode (cannot be disabled) |
112113
| `image_in` | Supports image input |
113114
| `video_in` | Supports video input |
114115

@@ -122,7 +123,11 @@ capabilities = ["thinking", "image_in"]
122123

123124
### `thinking`
124125

125-
When thinking mode is enabled, the model performs deeper reasoning before answering, suitable for complex problems. In shell mode, you can toggle thinking mode with the `Tab` key, or control it at startup with `--thinking` / `--no-thinking` flags.
126+
Declares that the model supports thinking mode. When enabled, the model performs deeper reasoning before answering, suitable for complex problems. In shell mode, you can use the `/model` command to switch models and thinking mode, or control it at startup with `--thinking` / `--no-thinking` flags.
127+
128+
### `always_thinking`
129+
130+
Indicates the model always uses thinking mode and cannot be disabled. For example, models with "thinking" in their name like `kimi-k2-thinking-turbo` typically have this capability. When using such models, the `/model` command won't prompt for thinking mode toggle.
126131

127132
### `image_in`
128133

docs/en/faq.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ If you need to change working directory:
3333
- **Use `--work-dir` flag**: Specify working directory at startup, like `kimi --work-dir /path/to/project`.
3434
- **Use absolute paths in commands**: Execute commands with absolute paths directly, like `ls /path/to/dir`.
3535

36-
### Thinking mode unavailable
37-
38-
When pressing `Tab` to toggle thinking mode, if you see "Thinking mode requires a model with thinking capability", it means the current model doesn't support thinking mode.
39-
40-
Solutions:
41-
42-
- **Switch to a supported model**: Use `/setup` to select a model that supports thinking (like `kimi-k2-thinking-turbo`).
43-
- **Check model capability configuration**: If you're sure the model supports thinking, you can force enable it with the environment variable `KIMI_MODEL_CAPABILITIES=thinking`.
44-
4536
### Image paste fails
4637

4738
When using `Ctrl-V` to paste an image, if you see "Current model does not support image input", it means the current model doesn't support image input.

docs/en/guides/interaction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ In shell mode, each command executes independently. Commands that change the env
2929

3030
Thinking mode allows the AI to think more deeply before responding, suitable for handling complex problems.
3131

32-
In agent mode, press `Tab` to toggle thinking mode on or off. The status bar at the bottom will show a notification after switching. You can also enable it at startup with the `--thinking` flag:
32+
You can use the `/model` command to switch models and thinking mode. After selecting a model, if the model supports thinking mode, the system will ask whether to enable it. You can also enable it at startup with the `--thinking` flag:
3333

3434
```sh
3535
kimi --thinking
3636
```
3737

3838
::: tip
39-
Thinking mode requires support from the current model.
39+
Thinking mode requires support from the current model. Some models (like `kimi-k2-thinking-turbo`) always use thinking mode and cannot be disabled.
4040
:::
4141

4242
## Multi-line input

docs/en/reference/keyboard.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Kimi CLI shell mode supports the following keyboard shortcuts.
77
| Shortcut | Function |
88
|----------|----------|
99
| `Ctrl-X` | Toggle agent/shell mode |
10-
| `Tab` | Toggle thinking mode |
1110
| `Ctrl-/` | Show help |
1211
| `Ctrl-J` | Insert newline |
1312
| `Alt-Enter` | Insert newline (same as `Ctrl-J`) |
@@ -25,20 +24,9 @@ Press `Ctrl-X` in the input box to switch between two modes:
2524
- **Shell mode**: Input is executed as local shell command
2625

2726
The prompt changes based on current mode:
28-
- Agent mode: `` or `💫` (thinking mode)
27+
- Agent mode: `` (normal) or `💫` (thinking mode)
2928
- Shell mode: `$`
3029

31-
### `Tab`: Toggle thinking mode
32-
33-
In agent mode, when the input box is empty or no completion menu is displayed, press `Tab` to toggle thinking mode.
34-
35-
- When thinking mode is enabled, the prompt changes to `💫`
36-
- A notification is displayed when switching
37-
38-
::: tip
39-
Thinking mode requires model support.
40-
:::
41-
4230
### `Ctrl-/`: Show help
4331

4432
Press `Ctrl-/` in the input box to quickly display help information, equivalent to entering the `/help` command.

docs/en/reference/slash-commands.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ After configuration, settings are automatically saved to `~/.kimi/config.toml` a
4343

4444
### `/model`
4545

46-
Switch the default model.
46+
Switch models and thinking mode.
4747

48-
This command first refreshes the available models list from the API platform. When called without arguments, displays an interactive selection interface; you can also specify a model name directly, e.g., `/model kimi-k2`.
48+
This command first refreshes the available models list from the API platform. When called without arguments, displays an interactive selection interface where you first select a model, then choose whether to enable thinking mode (if the model supports it).
4949

50-
After selecting a new model, Kimi CLI will automatically update the configuration file and reload.
50+
After selection, Kimi CLI will automatically update the configuration file and reload.
5151

5252
::: tip
5353
This command is only available when using the default configuration file. If a configuration was specified via `--config` or `--config-file`, this command cannot be used.

docs/en/release-notes/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This page documents the changes in each Kimi CLI release.
44

55
## Unreleased
66

7+
- Shell: Use `/model` to toggle thinking mode instead of Tab key
8+
- Config: Add `default_thinking` config option (auto-migrated from metadata)
9+
- LLM: Add `always_thinking` capability for models that always use thinking mode
10+
711
## 0.76 (2026-01-12)
812

913
- Tool: Make `ReadFile` tool description reflect model capabilities for image/video support

0 commit comments

Comments
 (0)