Skip to content

fix(cli): protect built-in TUI agent modes#84

Closed
BunsDev wants to merge 1 commit into
mainfrom
pr-36-tui-agent-modes
Closed

fix(cli): protect built-in TUI agent modes#84
BunsDev wants to merge 1 commit into
mainfrom
pr-36-tui-agent-modes

Conversation

@BunsDev

@BunsDev BunsDev commented Jun 15, 2026

Copy link
Copy Markdown
Member

Protect built-in TUI agent modes from being overridden or shadowed.

Originally a local review patch. Opened as draft PR for review.

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Error Error Jun 15, 2026 6:41am

@BunsDev BunsDev marked this pull request as ready for review June 15, 2026 07:56
Copilot AI review requested due to automatic review settings June 15, 2026 07:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the CLI TUI agent-mode switcher so the reserved built-in modes (build, plan, explore) always resolve to the built-in agent definitions, preventing repository settings.json agents from shadowing those security-significant modes.

Changes:

  • Added resolve_tui_agent_mode() to give built-in TUI modes precedence over project-defined agents with the same name.
  • Updated the interactive TUI agent-mode change handler to use the new resolver.
  • Added unit tests to ensure reserved modes ignore project overrides while non-reserved modes still resolve project agents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1278 to +1284
if let Some(def) = claurst_core::default_agents().get(mode) {
return Some(def.clone());
}

let mut all_agents = claurst_core::coven_shared::default_agents_with_familiars();
all_agents.extend(config_agents.clone());
all_agents.get(mode).cloned()
@BunsDev BunsDev requested a review from Copilot June 15, 2026 08:12
@BunsDev BunsDev closed this Jun 15, 2026
@BunsDev BunsDev deleted the pr-36-tui-agent-modes branch June 15, 2026 08:27
@BunsDev BunsDev review requested due to automatic review settings June 15, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants