Skip to content
Merged
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/friendly-prompt-login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Clarify the prompt-mode error when no model is configured by pointing users to the login flow.
4 changes: 3 additions & 1 deletion apps/kimi-code/src/cli/run-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ async function forcePromptPermission(
function requireConfiguredModel(...models: readonly (string | undefined)[]): string {
const model = configuredModel(...models);
if (model === undefined) {
throw new Error('No model configured. Set default_model in config.toml.');
throw new Error(
'No model configured. Run `kimi` and use /login to sign in, then retry; or set default_model in config.toml.',
);
}
return model;
}
Expand Down
4 changes: 3 additions & 1 deletion apps/kimi-code/test/cli/run-prompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,9 @@ describe('runPrompt', () => {
stdout: { write: vi.fn(() => true) },
stderr: { write: vi.fn(() => true) },
}),
).rejects.toThrow('No model configured. Set default_model in config.toml.');
).rejects.toThrow(
'No model configured. Run `kimi` and use /login to sign in, then retry; or set default_model in config.toml.',
);

expect(mocks.harnessClose).toHaveBeenCalled();
});
Expand Down
Loading