Skip to content

Fix task routing: case mismatch prevented cloud provider upgrade (#371) - #404

Merged
joelteply merged 1 commit into
mainfrom
fix/routing-case-mismatch
Mar 25, 2026
Merged

joelteply merged 1 commit into
mainfrom
fix/routing-case-mismatch

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • getAvailableCloudProviders() stored provider names as PascalCase ("DeepSeek", "Anthropic") from the status API
  • CLOUD_PROVIDER_FALLBACK uses lowercase ("deepseek", "anthropic")
  • Set.has() is case-sensitive → no match → routing never upgraded local personas to cloud
  • Fix: .toLowerCase() when populating the set

This was the second bug preventing task-aware routing from working (first was hasTools=false in PR #401).

Test plan

  • TypeScript compilation clean
  • Deploy and verify 🔄 Task routing log appears for local personas

🤖 Generated with Claude Code

…#371)

getAvailableCloudProviders() stored PascalCase names ("DeepSeek", "Anthropic")
but CLOUD_PROVIDER_FALLBACK uses lowercase ("deepseek", "anthropic").
Set.has() is case-sensitive, so no provider ever matched.

Fix: lowercase when adding to the configured set.

Discovered via cognition logs: domain='analysis', hasTools=true (2 XML tools),
but routing never upgraded because availableProviders.has('deepseek') was false
when the set contained 'DeepSeek'.
Copilot AI review requested due to automatic review settings March 25, 2026 05:29
@joelteply
joelteply merged commit 0ef40e8 into main Mar 25, 2026
3 of 5 checks passed
@joelteply
joelteply deleted the fix/routing-case-mismatch branch March 25, 2026 05:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes task-aware routing’s cloud-provider upgrade check by normalizing configured provider names to lowercase so they match the router’s lowercase fallback IDs.

Changes:

  • Normalize AIProvidersStatus provider names with .toLowerCase() when building the configured cloud-provider set.

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

joelteply added a commit that referenced this pull request Aug 20, 2026
…ported on every target (CI E0432)

`#[cfg(target_os = "macos")]` binds to the NEXT item only. Inserting the new
`device_probe` re-export ABOVE `metal_monitor` in today's adapter refactor silently
moved the gate onto the base and left the macOS-only adapter exported everywhere:

  #[cfg(target_os = "macos")]
  pub use device_probe::{...};        // the PLATFORM-NEUTRAL base — wrongly gated
  pub use metal_monitor::{...};       // the macOS ADAPTER — wrongly ungated

Exactly inverted from the `mod` declarations two lines up (device_probe ungated,
metal_monitor macOS-gated), and exactly inverted from the point of the refactor: the
base is what every backend shares.

Compiled clean on this Mac. E0432 `unresolved import metal_monitor` on every other
host — which is BOTH red CI jobs from one cause: `cargo test --lib` (Linux) and
`cargo check windows-msvc`. I was ready to write the Windows job off as the #404
flake; it was this.

Caught only because CI builds a different target than I do. The local check that
would have caught it does not exist on a Mac (`--no-default-features` can't build
here, #422), so the honest guard is CI itself — which is the argument for not
merging red on a "probably the flake" hunch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants