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
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ default-members = [
resolver = "2"

[workspace.package]
version = "0.1.733"
version = "0.1.734"
edition = "2024"
rust-version = "1.88"
license = "Apache-2.0"
Expand Down
9 changes: 6 additions & 3 deletions crates/cli-sub-agent/src/run_cmd_attempt_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ use crate::pipeline;

pub(crate) fn allow_cross_tool_failover(
strategy: ToolSelectionStrategy,
resolved_tier_name: Option<&str>,
force_ignore_tier_setting: bool,
_resolved_tier_name: Option<&str>,
_force_ignore_tier_setting: bool,
Comment on lines +10 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The parameters _resolved_tier_name and _force_ignore_tier_setting are now unused in the function body. Since this is a pub(crate) function, it would be cleaner to remove these parameters from the signature and update the call sites, rather than just prefixing them with underscores. This improves the internal API clarity and reduces technical debt.

no_failover: bool,
) -> bool {
if no_failover {
return false;
}

// Explicit `--tool` (from CLI or skill agent_config) is the user's hard
// selection: never silently fall over to a different tool, even when a
// tier is also specified (#1440). Tier still drives model selection for
// the chosen tool via `resolve_requested_tool_from_tier`.
!matches!(strategy, ToolSelectionStrategy::Explicit(_))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This change prevents any failover when an explicit tool is selected, even if a --tier is provided. While this correctly addresses the issue of switching to a different tool (cross-tool failover), it also disables intra-tool failover (switching between different models of the same tool within a tier).

If a user specifies both --tool and --tier, they might still expect the system to try other models from that tier that match the selected tool if the first attempt hits a rate limit. By returning false here, the failover logic in the caller is likely bypassed entirely. Consider if the logic should be refined to allow failover but restrict it to the requested tool during the scheduling phase, rather than disabling it completely.

|| (!force_ignore_tier_setting && resolved_tier_name.is_some())
}

pub(crate) fn resolve_attempt_initial_response_timeout_seconds(
Expand Down
12 changes: 7 additions & 5 deletions crates/cli-sub-agent/src/run_cmd_attempt_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,15 @@ fn explicit_tool_no_failover_blocks_cross_tool_failover() {
));
}

// Regression #1440: explicit `--tool` blocks cross-tool failover even with `--tier`.
#[test]
fn explicit_tool_in_tier_keeps_cross_tool_failover_available() {
assert!(allow_cross_tool_failover(
ToolSelectionStrategy::Explicit(ToolName::Codex),
Some("tier-3-complex"),
false,
fn explicit_tool_in_tier_blocks_cross_tool_failover() {
let strategy = ToolSelectionStrategy::Explicit(ToolName::ClaudeCode);
assert!(!allow_cross_tool_failover(
strategy,
Some("t4"),
false,
false
));
}

Expand Down
Loading