fix(cli): respect --skills-dir in interactive mode (#1457)

The interactive shell entry point dropped opts.skillsDirs when building the harness, so --skills-dir only took effect in prompt mode. Forward it so the flag works in the TUI as documented.
This commit is contained in:
liruifengv 2026-07-07 13:02:57 +08:00 committed by GitHub
parent 6916240ae3
commit 260a80793a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---
Respect the --skills-dir flag in interactive mode.

View file

@ -62,6 +62,7 @@ export async function runShell(
const harness = createKimiHarness({
homeDir: telemetryBootstrap.homeDir,
identity: createKimiCodeHostIdentity(version),
skillDirs: opts.skillsDirs,
telemetry: telemetryClient,
onOAuthRefresh: (outcome) => {
if (outcome.success) {

View file

@ -241,6 +241,34 @@ describe('runShell', () => {
});
});
it('forwards skillsDirs from CLI options to the harness', async () => {
mocks.loadTuiConfig.mockResolvedValue({
theme: 'dark',
editorCommand: null,
notifications: { enabled: true, condition: 'unfocused' },
});
mocks.tuiStart.mockResolvedValue(undefined);
await runShell(
{
session: undefined,
continue: false,
yolo: false,
auto: false,
plan: false,
model: undefined,
outputFormat: undefined,
prompt: undefined,
skillsDirs: ['/skills'],
},
'1.2.3-test',
);
expect(mocks.kimiHarnessConstructor).toHaveBeenCalledWith(
expect.objectContaining({ skillDirs: ['/skills'] }),
);
});
it('tracks first launch when device id creation reports first launch', async () => {
mocks.loadTuiConfig.mockResolvedValue({
theme: 'dark',