MoonshotAI / MoonshotAI/kimi-code

fix: --agent and --agent-file are ignored by the interactive CLI (v0.43.1)

Open
#3,857 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

0.43.1

Which open platform/subscription were you using?

Kimi Code (kimi.com/code)

Which model were you using?

No response

What platform is your computer?

Ubuntu

What issue are you seeing?

Custom agents selected via --agent / --agent-file are silently ignored when starting the interactive CLI.

 On 0.43.1, `kimi --agent reviewer` (with `reviewer.md` in the user agent directory, or via `--agent-file <path>`) starts a session bound to the default agent profile — the custom system prompt never takes effect. For        

example, an agent file whose prompt says to always answer "REVIEWER-MODE" never produces it.

 No error or warning is shown: the flags parse fine (invalid combos like `--agent` + `--session` are still rejected), the session is simply bound to the wrong profile.                                                          
                                                                                                                                                                                                                                 
 Print mode is unaffected: `kimi -p --agent reviewer` binds the requested profile correctly.
What steps can reproduce the bug?
     1. Create `~/.kimi-code/agents/reviewer.md`:                                                                                                                                                                                    
                                                                                                                                                                                                                                     
        ```markdown                                                                                                                                                                                                                  
        ---                                                                                                                                                                                                                          
        name: reviewer                                                                                                                                                                                                               
        description: Reviews code changes                                                                                                                                                                                            
        ---                                                                                                                                                                                                                          
                                                                                                                                                                                                                                     
        You are a code reviewer. Always answer with "REVIEWER-MODE".                                                                                                                                                                 
  1. Run kimi --agent reviewer (or kimi --agent-file ~/.kimi-code/agents/reviewer.md).
  2. Send any prompt, e.g. "hi".
  3. Observe the reply is not in reviewer mode / the bound profile is the default one.
                                                                                                                                                                                                                                  
  **What is the expected behavior?**                                                                                                                                                                                              
                                                                                                                                                                                                                                  
  ```markdown                                                                                                                                                                                                                     
  The new session should be bound to the `reviewer` profile, and the custom system prompt should take effect from the first turn.                                                                                                 
What is the expected behavior?

No response

Additional information

A fix PR is already open: #3855

Contribution
  • I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the interactive command with kimi --agent reviewer and kimi --agent-file, then compare it with the working kimi -p --agent reviewer path. Review the CLI agent-selection entry points and PR #3855; done means the selected profile and custom system prompt apply from the first interactive turn without breaking invalid-flag validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.