Skip to content

Commit a566a2a

Browse files
authored
fixes slash command not reflecting changes in agent (#2247)
* fixes slash command not reflecting changes in agent * fixes tests
1 parent ed89f7e commit a566a2a

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

crates/chat-cli/src/cli/chat/prompt.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,21 @@ pub const COMMANDS: &[&str] = &[
5353
"/tools reset",
5454
"/mcp",
5555
"/model",
56-
"/profile",
57-
"/profile help",
58-
"/profile list",
59-
"/profile create",
60-
"/profile delete",
61-
"/profile rename",
62-
"/profile set",
56+
"/agent",
57+
"/agent help",
58+
"/agent list",
59+
"/agent create",
60+
"/agent delete",
61+
"/agent rename",
62+
"/agent set",
6363
"/prompts",
6464
"/context",
6565
"/context help",
6666
"/context show",
6767
"/context show --expand",
6868
"/context add",
69-
"/context add --global",
7069
"/context rm",
71-
"/context rm --global",
7270
"/context clear",
73-
"/context clear --global",
7471
"/hooks",
7572
"/hooks help",
7673
"/hooks add",

crates/chat-cli/src/cli/chat/skim_integration.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ pub fn select_command(_os: &Os, context_manager: &ContextManager, tools: &[Strin
264264
* command */
265265
}
266266
},
267-
Some(cmd @ CommandType::Profile(_)) if cmd.needs_profile_selection() => {
267+
Some(cmd @ CommandType::Agent(_)) if cmd.needs_agent_selection() => {
268268
// For profile operations that need a profile name, show profile selector
269269
// As part of the agent implementation, we are disabling the ability to
270270
// switch profile after a session has started.
271271
// TODO: perhaps revive this after we have a decision on profile switching
272272
Ok(Some(selected_command.clone()))
273273
},
274-
Some(CommandType::Profile(_)) => {
274+
Some(CommandType::Agent(_)) => {
275275
// For other profile operations (like create), just return the command
276276
Ok(Some(selected_command.clone()))
277277
},
@@ -290,12 +290,12 @@ enum CommandType {
290290
ContextAdd(String),
291291
ContextRemove(String),
292292
Tools(&'static str),
293-
Profile(&'static str),
293+
Agent(&'static str),
294294
}
295295

296296
impl CommandType {
297-
fn needs_profile_selection(&self) -> bool {
298-
matches!(self, CommandType::Profile("set" | "delete" | "rename"))
297+
fn needs_agent_selection(&self) -> bool {
298+
matches!(self, CommandType::Agent("set" | "delete" | "rename"))
299299
}
300300

301301
fn from_str(cmd: &str) -> Option<CommandType> {
@@ -307,10 +307,10 @@ impl CommandType {
307307
match cmd {
308308
"/tools trust" => Some(CommandType::Tools("trust")),
309309
"/tools untrust" => Some(CommandType::Tools("untrust")),
310-
"/profile set" => Some(CommandType::Profile("set")),
311-
"/profile delete" => Some(CommandType::Profile("delete")),
312-
"/profile rename" => Some(CommandType::Profile("rename")),
313-
"/profile create" => Some(CommandType::Profile("create")),
310+
"/agent set" => Some(CommandType::Agent("set")),
311+
"/agent delete" => Some(CommandType::Agent("delete")),
312+
"/agent rename" => Some(CommandType::Agent("rename")),
313+
"/agent create" => Some(CommandType::Agent("create")),
314314
_ => None,
315315
}
316316
}
@@ -333,15 +333,13 @@ mod tests {
333333
// List of hardcoded commands used in select_command
334334
let hardcoded_commands = vec![
335335
"/context add",
336-
"/context add --global",
337336
"/context rm",
338-
"/context rm --global",
339337
"/tools trust",
340338
"/tools untrust",
341-
"/profile set",
342-
"/profile delete",
343-
"/profile rename",
344-
"/profile create",
339+
"/agent set",
340+
"/agent delete",
341+
"/agent rename",
342+
"/agent create",
345343
];
346344

347345
// Check that each hardcoded command is in the COMMANDS array

0 commit comments

Comments
 (0)