Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/status-line-thinking-effort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Include the current thinking effort in custom status line command payloads.
1 change: 1 addition & 0 deletions apps/kimi-code/src/tui/components/chrome/footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export class FooterComponent implements Component {
const state = this.state;
return {
model: modelDisplayName(state),
thinkingEffort: state.thinkingEffort,
cwd: state.workDir,
gitBranch: this.gitCache.getStatus()?.branch ?? null,
permissionMode: state.permissionMode,
Expand Down
1 change: 1 addition & 0 deletions apps/kimi-code/src/tui/utils/status-line-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const STATUS_LINE_MAX_CAPTURE_BYTES = 65_536;

export interface StatusLinePayload {
model: string;
thinkingEffort: string;
cwd: string;
gitBranch: string | null;
permissionMode: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const baseState: AppState = {

const payload: StatusLinePayload = {
model: 'kimi-k2',
thinkingEffort: 'off',
cwd: '/tmp/project',
gitBranch: 'main',
permissionMode: 'manual',
Expand Down Expand Up @@ -140,6 +141,7 @@ describe('runStatusLineCommand', () => {
expect(line).not.toBeNull();
const parsed = JSON.parse(line!);
expect(parsed.model).toBe('kimi-k2');
expect(parsed.thinkingEffort).toBe('off');
expect(parsed.gitBranch).toBe('main');
expect(parsed.cwd).toBe('/tmp/project');
});
Expand Down Expand Up @@ -175,6 +177,21 @@ describe('runStatusLineCommand', () => {
});

describe('FooterComponent status_line command', () => {
it('passes the current thinking effort to the command', async () => {
const state: AppState = {
...baseState,
thinkingEffort: 'max',
statusLine: { items: null, command: 'cat' },
};
const footer = new FooterComponent(state);

footer.render(1000);
await new Promise((resolve) => setTimeout(resolve, 200));

const parsed = JSON.parse(plain(footer.render(1000)[0]!).trim());
expect(parsed.thinkingEffort).toBe('max');
});

it('swaps line 1 to the command output once it lands', async () => {
const state: AppState = {
...baseState,
Expand Down
2 changes: 1 addition & 1 deletion docs/en/configuration/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Alongside `config.toml`, the CLI keeps terminal-UI and client preferences in a c
| `[notifications].notification_condition` | `string` | `unfocused` | When to notify: `unfocused` (only when the terminal is not focused) or `always` |
| `[upgrade].auto_install` | `boolean` | `true` | Whether new versions are installed automatically |
| `[status_line].items` | `string[]` | `[]` | Built-in slots to show on the first footer line and their order: `mode`, `goal`, `model`, `tasks`, `cwd`, `git`, `tips`. Unset keeps the default layout; unknown ids are skipped with a warning |
| `[status_line].command` | `string` | `""` | Custom status line command. Its first stdout line replaces the first footer line, with a JSON snapshot (model, cwd, git branch, permission mode, plan mode, context usage, session id, version) passed on stdin. Runs are capped at 300ms and throttled to once per second; failures fall back to the built-in layout |
| `[status_line].command` | `string` | `""` | Custom status line command. Its first stdout line replaces the first footer line, with a JSON snapshot (model, `thinkingEffort`, cwd, git branch, permission mode, plan mode, context usage, session id, version) passed on stdin. Runs are capped at 300ms and throttled to once per second; failures fall back to the built-in layout |

```toml
# ~/.kimi-code/tui.toml
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/configuration/config-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ MCP server 的声明配置写在 `~/.kimi-code/mcp.json` 或项目内 `.kimi-cod
| `[notifications].notification_condition` | `string` | `unfocused` | 何时通知:`unfocused`(仅终端失去焦点时)或 `always`(总是) |
| `[upgrade].auto_install` | `boolean` | `true` | 是否自动安装新版本 |
| `[status_line].items` | `string[]` | `[]` | 底部状态栏第一行展示哪些内置槽位及其顺序:`mode`、`goal`、`model`、`tasks`、`cwd`、`git`、`tips`。缺省保持默认布局;未知 id 跳过并告警 |
| `[status_line].command` | `string` | `""` | 自定义状态栏命令。其 stdout 第一行替换状态栏第一行,stdin 会收到 JSON 快照(model、cwd、git 分支、permission 模式、plan 模式、上下文用量、session id、版本)。运行上限 300ms、每秒最多一次;失败时回退内置布局 |
| `[status_line].command` | `string` | `""` | 自定义状态栏命令。其 stdout 第一行替换状态栏第一行,stdin 会收到 JSON 快照(model、`thinkingEffort`、cwd、git 分支、permission 模式、plan 模式、上下文用量、session id、版本)。运行上限 300ms、每秒最多一次;失败时回退内置布局 |

```toml
# ~/.kimi-code/tui.toml
Expand Down