Skip to content

Commit 3022681

Browse files
factorydroidechobt
authored andcommitted
fix(cortex-cli): show alternative workflow when removing built-in agent
Fixes bounty issue #1666 When a user tries to remove a built-in agent, the error message now suggests creating a custom copy using 'cortex agent create' or manually copying the agent to ~/.cortex/agents/ where it can be modified.
1 parent fe8449a commit 3022681

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cortex-cli/src/agent_cmd.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,13 @@ async fn run_remove(args: RemoveArgs) -> Result<()> {
11351135
.ok_or_else(|| anyhow::anyhow!("Agent '{}' not found", args.name))?;
11361136

11371137
if agent.native {
1138-
bail!("Cannot remove built-in agent '{}'", args.name);
1138+
bail!(
1139+
"Cannot remove built-in agent '{}'. \
1140+
Tip: You can create a custom version of this agent using \
1141+
'cortex agent create' with similar settings, or copy it to \
1142+
~/.cortex/agents/ and modify it there.",
1143+
args.name
1144+
);
11391145
}
11401146

11411147
let path = agent

0 commit comments

Comments
 (0)