Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ enum Commands {
/// Target a specific session by ID (or prefix). Use 'relay sessions' to list.
#[arg(long)]
session: Option<String>,

/// Disable chain fallback when using --to (don't try other agents on failure)
#[arg(long)]
no_chain: bool,
},

/// List available Claude Code sessions
Expand Down Expand Up @@ -212,7 +216,7 @@ fn main() -> Result<()> {
// ═══════════════════════════════════════════════════════════════
// HANDOFF
// ═══════════════════════════════════════════════════════════════
Commands::Handoff { to, deadline, dry_run, force, turns, include, clipboard, template, session } => {
Commands::Handoff { to, deadline, dry_run, force, turns, include, clipboard, template, session, no_chain } => {
if !cli.json {
tui::print_banner();
}
Expand Down Expand Up @@ -432,7 +436,7 @@ fn main() -> Result<()> {
let sp = tui::step(3, 3, &format!("Launching {}...", target_name));

let result = if to.is_some() {
agents::handoff_to_named(&config, &target_name, &handoff_text, &project_dir.to_string_lossy())
agents::handoff_to_named(&config, &target_name, &handoff_text, &project_dir.to_string_lossy(), !no_chain)
} else {
agents::handoff_to_first_available(&config, &handoff_text, &project_dir.to_string_lossy())
}?;
Expand Down
2 changes: 1 addition & 1 deletion core/src/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn replay_handoff(
}

let result = if let Some(name) = agent_name {
crate::agents::handoff_to_named(config, name, &handoff_text, &project_dir)?
crate::agents::handoff_to_named(config, name, &handoff_text, &project_dir, true)?
} else {
crate::agents::handoff_to_first_available(config, &handoff_text, &project_dir)?
};
Expand Down
4 changes: 2 additions & 2 deletions core/tests/agents_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn handoff_to_unavailable_fails_gracefully() {
},
agents: Default::default(),
};
let result = agents::handoff_to_named(&config, "openai", "test", "/tmp").unwrap();
let result = agents::handoff_to_named(&config, "openai", "test", "/tmp", false).unwrap();
assert!(!result.success);
assert!(result.message.contains("not available"));
}
Expand All @@ -67,7 +67,7 @@ fn handoff_to_unknown_agent_fails() {
general: Default::default(),
agents: Default::default(),
};
let result = agents::handoff_to_named(&config, "doesnotexist", "test", "/tmp").unwrap();
let result = agents::handoff_to_named(&config, "doesnotexist", "test", "/tmp", false).unwrap();
assert!(!result.success);
assert!(result.message.contains("Unknown agent"));
}
Loading