Skip to content

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

Description

@ZhangWanqiang

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions