Skip to content

feat(router): log affected route hints when provider warmup fails#463

Merged
yacosta738 merged 3 commits into
mainfrom
copilot/define-operator-ux-documentation
Apr 9, 2026
Merged

feat(router): log affected route hints when provider warmup fails#463
yacosta738 merged 3 commits into
mainfrom
copilot/define-operator-ux-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

The docs promised "runtime warning names the failed provider and the affected route hints" but RouterProvider::warmup() only logged the provider name — leaving operators unable to correlate a warmup failure to which hint:* selectors would stop working.

Changes

clients/agent-runtime/src/providers/router.rs

  • Added provider_hints: HashMap<usize, Vec<String>> field built once at construction — a reverse map of provider index → sorted hint names. Avoids per-failure allocation and makes the index↔hints relationship explicit.
  • warmup() now emits affected_hints in the warning event:
tracing::warn!(
    provider = name,
    affected_hints = affected_hints,  // e.g. "code, reasoning"
    "Warmup failed; routes using this provider may not be available: {e}"
);
  • Two new regression tests:
    • warmup_logs_affected_route_hints_on_failure — asserts provider name + all wired hint names appear in the warning.
    • warmup_reports_no_affected_hints_when_provider_has_no_routes — asserts "none" is reported when no routes reference the failing provider.

Related Issues

Closes the operator-facing diagnostics gap described in the model routing UX issue.


Summary

RouterProvider::warmup now logs which route hints (hint:code, hint:reasoning, …) are impacted when a non-primary provider fails to initialise, matching the behaviour documented in the operator guide and troubleshooting table.


Tested Information

All 19 router unit tests pass, including the 2 new regression tests. 26 doctor tests and 7 classifier tests unchanged and passing. Clippy -D warnings clean.


Documentation Impact

  • No docs update required because: the operator guide (guides/model-routing.md) already described this warning behaviour — this change makes the runtime match the documented contract.
  • I verified the documentation matches the current behavior.

Breaking Changes

None. Additive field on an internal struct; no public API changed.


Checklist

  • I have checked that there isn't already a PR solving the same problem.
  • I have read the Contributing Guidelines.
  • I ensured my code follows the project's style guidelines.
  • I have added or updated tests that prove my fix is effective or that my feature works.
  • I have updated the documentation, or I explained above why no documentation update is needed.
  • I verified the documentation matches the current behavior.
  • I have documented any breaking changes in the Breaking Changes section.
  • I have linked the related issue (if any).

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 8, 2026

Deploying corvus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 123703d
Status: ✅  Deploy successful!
Preview URL: https://7a81f0d9.corvus-42x.pages.dev
Branch Preview URL: https://copilot-define-operator-ux-d.corvus-42x.pages.dev

View logs

Copilot AI changed the title [WIP] Define operator UX and documentation for model routing and query classification feat(router): log affected route hints when provider warmup fails Apr 8, 2026
Copilot AI requested a review from yacosta738 April 8, 2026 22:48
@yacosta738 yacosta738 marked this pull request as ready for review April 9, 2026 05:03
@yacosta738 yacosta738 merged commit fa05f57 into main Apr 9, 2026
13 of 17 checks passed
@yacosta738 yacosta738 deleted the copilot/define-operator-ux-documentation branch April 9, 2026 05:20
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

@dallay-bot dallay-bot Bot mentioned this pull request May 6, 2026
This was referenced May 10, 2026
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.

Define operator UX and documentation for model routing and query classification

2 participants