feat: productize model routing with operator docs, config validation, and formal spec#452
Conversation
- Add formal routing behavior spec at openspec/specs/model-routing/spec.md - Archive completed productize-model-routing SDD change - Add next-stage-routing-capabilities exploration (DALLAY-174) Refs: DALLAY-173, DALLAY-174, DALLAY-175
- Add EN guide at guides/model-routing.md - Add ES guide at es/guides/model-routing.md - Add guide to docs sidebar in astro.config.mjs - Add lightweight docs content tests Closes #269
…ements - Add check_classification_integrity doctor checks: orphaned hints, zero rules, zero routes, never-matching rules - Improve unknown-hint fallback warning with hint name and model - Improve failed-provider warning with affected route hints - Add targeted tests for all new checks and warning paths - Add default-model fallback tests for disabled/no-match classification Refs: DALLAY-173
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds operator-facing model-routing and query-classification docs (EN/ES), warning-only doctor validation for classification↔route integrity, enhanced structured tracing warnings in router/provider init, test helpers for capturing tracing events, and multiple unit/integration tests; all changes are additive and focused on docs/tests/diagnostics. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Suggested labels
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Contributor ReportUser: @yacosta738
Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-04-07 to 2026-04-07 |
There was a problem hiding this comment.
Actionable comments posted: 9
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/agent-runtime/src/doctor/mod.rs`:
- Around line 289-297: The integrity check currently skips rules with empty
hints; change the condition so an empty hint is reported as a diagnostic:
replace the guard "if !rule.hint.is_empty() &&
!route_hints.contains(&rule.hint.as_str())" with logic that triggers when the
hint is empty or when it doesn't match route_hints (e.g., "if
rule.hint.is_empty() || !route_hints.contains(&rule.hint.as_str())"), and adjust
the DiagItem::warn message (in the same block) to handle the empty-hint case so
it clearly reports an empty or orphaned classification hint.
In `@clients/agent-runtime/src/providers/mod.rs`:
- Around line 993-1074: The tracing-capture harness (CaptureLayer,
CapturedTracingEvent, TracingFieldRecorder, capture_tracing_events and related
impls) is duplicated and should be extracted to a shared test support module:
create a new test-only module (e.g., tests/support/tracing_capture or a
crate::test_utils::tracing_capture) containing those types and functions, make
them pub (or pub(crate) for test use), remove the duplicate definitions from
providers/mod.rs and clients/agent-runtime/src/providers/router.rs, and update
both places to import and call the shared symbols (CaptureLayer,
CapturedTracingEvent, TracingFieldRecorder, capture_tracing_events). After
moving, run cargo test and fix any visibility or path imports.
In `@clients/web/apps/docs/src/content/docs/es/guides/model-routing.md`:
- Around line 211-214: Update the invalid Anthropic model ID in the
[[model_routes]] block by replacing model = "claude-sonnet-4-20250514" with the
correct model name model = "claude-sonnet-4-6" (update this in both the English
and Spanish docs where the [[model_routes]] section appears).
In `@openspec/changes/archive/2026-04-07-productize-model-routing/design.md`:
- Around line 103-104: Replace brittle line-number references with
function/method names: change the first entry to reference the tracing::warn!
inside RouterProvider::resolve (so it reads "Enhance existing tracing::warn! in
RouterProvider::resolve to include the fallback model name") and change the
second entry to reference the provider initialization routine (e.g.,
ProviderManager::initialize or init_provider) so it reads "Add route-impact
warning in ProviderManager::initialize when a non-primary routed provider fails
init" — this makes the design note resilient to line shifts while still pointing
to RouterProvider::resolve and the provider init function.
- Around line 66-89: The fenced diagram block in design.md lacks a language
identifier which can cause inconsistent rendering; update the triple-backtick
fence that wraps the ASCII data flow diagram (the block starting with "User
Message" and containing classify(config, message) and
RouterProvider.resolve(model)) to include a language tag (e.g., ```text) so the
diagram renders consistently across markdown processors.
In `@openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md`:
- Line 1: The first line uses a second-level heading "## Exploration: Productize
Model Routing and Query Classification" but should be a top-level heading to
satisfy MD041; update that exact heading string to use a single leading "#"
(i.e., change "## Exploration: ..." to "# Exploration: ...") so the document
starts with a top-level heading and maintains consistent archive structure.
In
`@openspec/changes/archive/2026-04-07-productize-model-routing/verify-report.md`:
- Line 1: Change the top-level heading from H2 to H1 by replacing "##
Verification Report" with "# Verification Report"; ensure fenced code blocks at
the locations corresponding to lines 23, 28, 33, and 42 are each surrounded by a
blank line before and after the ``` fences (add or remove adjacent content so
there's an empty line above the opening ``` and below the closing ```); and add
a final trailing newline at the end of the file so the file ends with a newline.
In `@openspec/specs/model-routing/spec.md`:
- Around line 369-374: Update the "Unknown hint falls back with warning"
scenario to explicitly state that the router will use the default provider and
model but will preserve and pass the raw selector (e.g., "hint:unknown") to
downstream components; also require a warning log that names the unknown hint.
Reference the scenario title "Unknown hint falls back with warning" and the raw
selector example "hint:unknown" so the spec aligns with the routing contract
described around the raw selector behavior (lines referencing the raw selector).
In `@scripts/model-routing-docs.test.mjs`:
- Around line 1-54: The CI is missing a step to execute the model-routing docs
tests (script model-routing-docs.test.mjs) so regressions won't be caught;
update the docs-quality.yml workflow to add a job step that runs the test script
(e.g., a step named "Validate model routing docs content" that runs the Node
script via node model-routing-docs.test.mjs) so the test suite defined by the
readText function and the tests/assert.match blocks in
model-routing-docs.test.mjs are executed in CI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 620094d9-fb6f-43bd-a7a9-2ca7d64785b6
📒 Files selected for processing (17)
clients/agent-runtime/src/agent/agent.rsclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rsclients/web/apps/docs/astro.config.mjsclients/web/apps/docs/src/content/docs/es/guides/model-routing.mdclients/web/apps/docs/src/content/docs/guides/model-routing.mdopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdopenspec/changes/archive/2026-04-07-productize-model-routing/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/proposal.mdopenspec/changes/archive/2026-04-07-productize-model-routing/specs/model-routing/spec.mdopenspec/changes/archive/2026-04-07-productize-model-routing/state.yamlopenspec/changes/archive/2026-04-07-productize-model-routing/tasks.mdopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdopenspec/changes/next-stage-routing-capabilities/exploration.mdopenspec/specs/model-routing/spec.mdscripts/model-routing-docs.test.mjs
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: sonar
- GitHub Check: pr-checks
- GitHub Check: Cloudflare Pages
🧰 Additional context used
📓 Path-based instructions (6)
**/*
⚙️ CodeRabbit configuration file
**/*: Security first, performance second.
Validate input boundaries, auth/authz implications, and secret management.
Look for behavioral regressions, missing tests, and contract breaks across modules.
Files:
clients/web/apps/docs/astro.config.mjsclients/agent-runtime/src/providers/mod.rsopenspec/changes/archive/2026-04-07-productize-model-routing/state.yamlclients/web/apps/docs/src/content/docs/guides/model-routing.mdclients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/agent/agent.rsopenspec/changes/archive/2026-04-07-productize-model-routing/exploration.mdscripts/model-routing-docs.test.mjsopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdclients/agent-runtime/src/doctor/mod.rsopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdopenspec/changes/archive/2026-04-07-productize-model-routing/tasks.mdopenspec/changes/next-stage-routing-capabilities/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/proposal.mdclients/web/apps/docs/src/content/docs/es/guides/model-routing.mdopenspec/changes/archive/2026-04-07-productize-model-routing/specs/model-routing/spec.mdopenspec/specs/model-routing/spec.md
clients/agent-runtime/src/providers/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
Implement
Providertrait insrc/providers/and register insrc/providers/mod.rsfactory when adding a new provider
Files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rs
clients/agent-runtime/src/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
clients/agent-runtime/src/**/*.rs: Never log secrets, tokens, raw credentials, or sensitive payloads in any logging statements
Avoid unnecessary allocations, clones, and blocking operations to maintain performance and efficiency
Files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/agent/agent.rsclients/agent-runtime/src/doctor/mod.rs
clients/agent-runtime/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
Run
cargo fmt --all -- --check,cargo clippy --all-targets -- -D warnings, andcargo testfor code validation, or document which checks were skipped and why
Files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/agent/agent.rsclients/agent-runtime/src/doctor/mod.rs
**/*.rs
⚙️ CodeRabbit configuration file
**/*.rs: Focus on Rust idioms, memory safety, and ownership/borrowing correctness.
Flag unnecessary clones, unchecked panics in production paths, and weak error context.
Prioritize unsafe blocks, FFI boundaries, concurrency races, and secret handling.
Files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/agent/agent.rsclients/agent-runtime/src/doctor/mod.rs
**/*.{md,mdx}
⚙️ CodeRabbit configuration file
**/*.{md,mdx}: Verify technical accuracy and that docs stay aligned with code changes.
For user-facing docs, check EN/ES parity or explicitly note pending translation gaps.
Files:
clients/web/apps/docs/src/content/docs/guides/model-routing.mdopenspec/changes/archive/2026-04-07-productize-model-routing/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdopenspec/changes/archive/2026-04-07-productize-model-routing/tasks.mdopenspec/changes/next-stage-routing-capabilities/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/proposal.mdclients/web/apps/docs/src/content/docs/es/guides/model-routing.mdopenspec/changes/archive/2026-04-07-productize-model-routing/specs/model-routing/spec.mdopenspec/specs/model-routing/spec.md
🧠 Learnings (5)
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/providers/**/*.rs : Implement `Provider` trait in `src/providers/` and register in `src/providers/mod.rs` factory when adding a new provider
Applied to files:
clients/agent-runtime/src/providers/mod.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/main.rs : Preserve CLI contract unless change is intentional and documented; prefer explicit errors over silent fallback for unsupported critical paths
Applied to files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/agent/agent.rsclients/agent-runtime/src/doctor/mod.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/**/*.rs : Run `cargo fmt --all -- --check`, `cargo clippy --all-targets -- -D warnings`, and `cargo test` for code validation, or document which checks were skipped and why
Applied to files:
clients/agent-runtime/src/agent/agent.rsopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdclients/agent-runtime/src/doctor/mod.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/{security,gateway,tools,config}/**/*.rs : Do not silently weaken security policy or access constraints; keep default behavior secure-by-default with deny-by-default where applicable
Applied to files:
clients/agent-runtime/src/doctor/mod.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Include threat/risk notes and rollback strategy for security, runtime, and gateway changes; add or update tests for boundary checks and failure modes
Applied to files:
openspec/changes/archive/2026-04-07-productize-model-routing/design.md
🪛 LanguageTool
clients/web/apps/docs/src/content/docs/guides/model-routing.md
[style] ~41-~41: To elevate your writing, try using more formal phrasing here.
Context: ...ck to the default provider. The runtime keeps working, but it logs a warning so you can fix t...
(CONTINUE_TO_VB)
openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md
[style] ~169-~169: Consider an alternative to strengthen your wording.
Context: ...y discoverable - Cons: Larger scope, more changes across modules - Effort: High 3. **...
(CHANGES_ADJUSTMENTS)
clients/web/apps/docs/src/content/docs/es/guides/model-routing.md
[grammar] ~13-~13: Elimina la puntuación
Context: ...nte clasificas mensajes hacia esos hints, y validas la configuración con `corvus ...
(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)
[grammar] ~17-~17: Corrige la minúscula.
Context: ...tor`. Usa esta guía cuando quieras: - enviar prompts rápidos a un modelo más barato,...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~20-~20: Agrega un signo de puntuación.
Context: ...tas que acepten imágenes explícitamente. ## Qué hace el enrutamiento de modelos `[[mod...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~22-~22: Agrega un signo de puntuación.
Context: ...amente. ## Qué hace el enrutamiento de modelos [[model_routes]] mapea un hint a un provider y a un mode...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~24-~24: Corrige la minúscula.
Context: ...utamiento de modelos [[model_routes]] mapea un hint a un provider y a un modelo. ``...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~38-~38: Agrega un signo de puntuación.
Context: ... model = "o1-preview" ``` En tiempo de solicitud Corvus puede recibir un selector como `...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~41-~41: Corrige el error ortográfico.
Context: ...Si ninguna ruta coincide, Corvus cae al provider por defecto. El runtime sigue funcionan...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~42-~42: Agrega un signo de puntuación.
Context: ...ra que puedas corregir la configuración. ## Qué hace la clasificación de consultas `[q...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~44-~44: Agrega un signo de puntuación.
Context: ...ación. ## Qué hace la clasificación de consultas [query_classification] es opcional. Cuando está habilitada, ex...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~46-~46: Corrige la minúscula.
Context: ...n de consultas [query_classification] es opcional. Cuando está habilitada, examin...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~102-~102: Corrige la minúscula.
Context: ...soning, codeovision. - provider` debe coincidir con un provider que Corvus pue...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~103-~103: Corrige la minúscula.
Context: ...pueda inicializar. - allow_image_input es opt-in. Si lo omites, la ruta se trata c...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~116-~116: Elimina la puntuación
Context: ...de coincidir por keyword, patrón literal, o ambos. | Campo | Tipo | Requerido | ...
(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)
[grammar] ~131-~131: Corrige la minúscula.
Context: ...alquier** pattern coincide. - keywords no distingue mayúsculas/minúsculas. - `patt...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~132-~132: Corrige la minúscula.
Context: ...ngue mayúsculas/minúsculas. - patterns sí distingue mayúsculas/minúsculas. - La pr...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~195-~195: Cambia la palabra o signo.
Context: ...nput = true`. ## Ejemplo: enrutamiento multi-provider con clasificación ```toml default_prov...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)
[grammar] ~246-~246: Corrige la minúscula.
Context: ...n, Phase 1 añade estas advertencias: - clasificación habilitada pero sin reglas configuradas...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~258-~258: Agrega un signo de puntuación.
Context: ... nunca cambia el modelo seleccionado. | enabled = true pero rules está vacío. | Advertencia:...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~258-~258: Corrige la minúscula.
Context: ...pero rules está vacío. | Advertencia: la clasificación está habilitada pero no h...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~258-~258: Agrega un signo de puntuación.
Context: ...o. | Advertencia: la clasificación está habilitada pero no hay reglas configuradas. | Añad...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~258-~258: Aquí puede haber un error.
Context: ...na regla o desactiva la clasificación. | | La clasificación devuelve hints pero el...
(QB_NEW_ES)
[grammar] ~259-~259: Agrega un signo de puntuación.
Context: ...ficación. | | La clasificación devuelve hints pero el routing igual cae al provider p...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~259-~259: Aquí puede haber un error.
Context: ...na ruta real o añade la ruta faltante. | | Una regla nunca se dispara aunque la cl...
(QB_NEW_ES)
[grammar] ~260-~260: Aquí puede haber un error.
Context: ...keywords, patterns o elimina la regla. | | Los turnos con imágenes son rechazados....
(QB_NEW_ES)
[grammar] ~261-~261: Aquí puede haber un error.
Context: ...a ruta con allow_image_input = true. | | Un selector directo como hint:code no...
(QB_NEW_ES)
[grammar] ~262-~262: Aquí puede haber un error.
Context: ...re del hint o añade la ruta que falta. | | Una ruta parece válida en config pero f...
(QB_NEW_ES)
[grammar] ~263-~263: Agrega un signo de puntuación.
Context: ...ue falta. | | Una ruta parece válida en config pero falla en tiempo de solicitud. | Un...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~263-~263: Corrige el error ortográfico.
Context: ...pero falla en tiempo de solicitud. | Un provider no primario falló durante la inicializa...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~274-~274: Elimina la puntuación
Context: ...easoning, valídalas con corvus doctor`, y añade reglas de clasificación después...
(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)
🪛 markdownlint-cli2 (0.22.0)
openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
[warning] 120-120: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 128-128: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 134-134: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 140-140: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 146-146: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 151-151: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 156-156: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
openspec/changes/archive/2026-04-07-productize-model-routing/verify-report.md
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
[warning] 23-23: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 28-28: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 33-33: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 42-42: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 149-149: Files should end with a single newline character
(MD047, single-trailing-newline)
openspec/changes/archive/2026-04-07-productize-model-routing/design.md
[warning] 66-66: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (24)
clients/web/apps/docs/astro.config.mjs (1)
173-179: Sidebar entry is correctly wired and localized.The new guide link and Spanish translation follow the existing sidebar structure cleanly.
openspec/changes/archive/2026-04-07-productize-model-routing/state.yaml (1)
1-13: Archive state record is consistent and complete.Phase progression and terminal
next: nonestate are coherent.clients/agent-runtime/src/providers/router.rs (1)
83-87: Warning enrichment and coverage look solid.
fallback_modelis now captured in logs, and tests validate both emission and no-emission paths.Also applies to: 503-552
clients/agent-runtime/src/providers/mod.rs (1)
752-760: Affected-route warning context is a good addition and is well tested.The new
affected_routesfield materially improves operator diagnosis for partial provider init failures.Also applies to: 1727-1818
clients/agent-runtime/src/agent/agent.rs (1)
3070-3130: Classification fallback tests are targeted and valuable.These cases lock in the default-model contract for disabled and non-matching classification states.
clients/web/apps/docs/src/content/docs/guides/model-routing.md (1)
1-274: Guide is comprehensive and aligned with runtime behavior.The routing/classification contract, fallback semantics, doctor warnings, and operator troubleshooting are clearly documented.
scripts/model-routing-docs.test.mjs (2)
9-12: Synchronous reads at module load time will throw on missing files.This is actually fine for a test script—fast failure is desirable. Just noting that if file paths change, the test will error before any assertions run, giving clear feedback.
41-46: Spanish regex patterns match actual ES doc content correctly.Verification confirms the Spanish documentation consistently uses "provider por defecto" (not "proveedor por defecto"), so the test regex
/default provider|provider por defecto/iwill match the actual content at lines 41, 82, 259, and 262 of the ES guide.openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md (1)
100-117: Test coverage inventory is useful for tracking gaps.The "Missing test coverage" section (lines 112-116) explicitly documents untested paths. This is valuable for follow-up work and aligns with the incremental productization approach.
openspec/changes/archive/2026-04-07-productize-model-routing/design.md (1)
235-244: Rollback strategy is well-documented.Each deliverable can be reverted independently with no migration or data changes. This aligns with the learning about including rollback strategies for runtime changes. Based on learnings: "Include threat/risk notes and rollback strategy for security, runtime, and gateway changes."
openspec/changes/next-stage-routing-capabilities/exploration.md (2)
9-32: DALLAY-175 coverage verdict is well-evidenced.The evidence table maps each acceptance criterion to specific delivered artifacts (docs, doctor checks, spec). This provides clear traceability for issue closure.
98-122: Sound security rationale for deferring managed route updates.The analysis correctly identifies that a managed update API introduces new attack surface (who can change routes, approval flow, rollback). Keeping config-file-driven routing for v1.0.0 is the safer choice.
openspec/changes/archive/2026-04-07-productize-model-routing/tasks.md (1)
1-29: Task list is complete and well-structured.All Phase 1 tasks are marked complete. The TDD approach (RED/GREEN/REFACTOR in 3.1-3.4) and targeted test strategy (4.1-4.2) are solid practices.
openspec/changes/archive/2026-04-07-productize-model-routing/proposal.md (2)
55-61: Risk assessment is pragmatic.The risk table correctly identifies that doctor warnings on existing configs with orphaned hints are medium likelihood but mitigated by being warnings-only. No breaking changes means safe rollout.
63-72: Rollback plan enables independent reversion.Each of the four deliverables (docs, doctor checks, warning logs, spec) can be reverted independently. This is good practice for additive changes.
clients/web/apps/docs/src/content/docs/es/guides/model-routing.md (3)
1-9: Frontmatter is correct and complete.Standard metadata fields are present:
title,description,owner,status,lastReviewed,appliesTo,docType. ThelastRevieweddate matches the PR date.
63-83: Hint flow diagram is clear and operator-friendly.The text-based flow diagram explains the classification → routing → fallback path without exposing Rust internals. This aligns with the spec requirement that docs "MUST NOT expose internal implementation details."
254-263: Troubleshooting table covers all Phase 1 doctor warnings.The table maps symptoms to causes, doctor output, and resolutions for:
- Enabled without rules
- Orphaned hints
- Never-matching rules
- Image rejection
- Unknown hint fallback
- Failed provider init
This aligns with the formal spec requirements.
openspec/changes/archive/2026-04-07-productize-model-routing/specs/model-routing/spec.md (4)
1-8: Spec header is well-structured.Cross-reference to
provider-vision-gatingspec (REQ-6) establishes traceability for image routing gating requirements.
257-289: Route resolution contract is precise.The four-point contract (lines 262-269) clearly defines:
hint:prefix parsing- Matched route dispatch
- Unknown hint fallback (with raw selector)
- Non-hint passthrough
Scenarios cover all paths with testable assertions.
392-426: Image routing gating aligns with provider-vision-gating spec.The requirement correctly specifies:
allow_image_inputdefaults tofalse(opt-in)- Rejection with
RouteNotImageCapablefor non-image routes- Resolution via
vision_model_hintThis complements REQ-6 from the cross-referenced spec.
101-108: Implementation correctly gates checks on classification.enabled.The
check_classification_integrity()function indoctor/mod.rsreturns early whenclassification.enabled = false, skipping all integrity checks and warnings. This satisfies the spec requirement.openspec/specs/model-routing/spec.md (2)
76-186: Doctor-check requirements are well aligned with runtime behavior.The warning-only integrity checks and scenarios map cleanly to implementation behavior (zero rules, zero routes, orphaned hints, never-match rules).
189-247: Logging and image-gating contracts are precise and implementation-consistent.These sections correctly capture warning-field intent and
RouteNotImageCapablegating behavior without overexposing internals.Also applies to: 392-426
| | `clients/agent-runtime/src/providers/router.rs` | Modify | Enhance existing `tracing::warn!` on line 83 to include the fallback model name | | ||
| | `clients/agent-runtime/src/providers/mod.rs` | Modify | Add route-impact warning when non-primary routed provider fails init (~line 752) | |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Fragile line number references.
Lines 103-104 reference specific line numbers in source files (line 83, ~line 752). These will become stale as code evolves. Consider referencing function/method names instead:
"Enhance existing
tracing::warn!inRouterProvider::resolvemethod..."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@openspec/changes/archive/2026-04-07-productize-model-routing/design.md`
around lines 103 - 104, Replace brittle line-number references with
function/method names: change the first entry to reference the tracing::warn!
inside RouterProvider::resolve (so it reads "Enhance existing tracing::warn! in
RouterProvider::resolve to include the fallback model name") and change the
second entry to reference the provider initialization routine (e.g.,
ProviderManager::initialize or init_provider) so it reads "Add route-impact
warning in ProviderManager::initialize when a non-primary routed provider fails
init" — this makes the design note resilient to line shifts while still pointing
to RouterProvider::resolve and the provider init function.
- Fix doctor empty-hint guard to also warn on empty classification hints - Extract tracing capture harness to shared test_support module - Fix Anthropic model ID (claude-sonnet-4-6) in EN/ES docs - Replace brittle line-number refs with function names in design.md - Add language tag to diagram fenced block in design.md - Fix heading levels in exploration.md and verify-report.md - Clarify raw selector preservation in spec unknown-hint scenario - Add CI step for model-routing docs content tests Refs: DALLAY-173
Deploying corvus with
|
| Latest commit: |
b29f79e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c17c33c5.corvus-42x.pages.dev |
| Branch Preview URL: | https://feature-dallay-173-productiz.corvus-42x.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/web/apps/docs/src/content/docs/guides/model-routing.md`:
- Line 30: Replace the incorrect model identifier "qwen-qwq-32b" with the
correct Groq model name "qwen/qwen3-32b" where it's referenced (the string value
assigned to model on line containing "qwen-qwq-32b"); keep other model
references such as "llama-3.3-70b-versatile" unchanged.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1e579af4-124a-41c7-91ea-a4edcb20a098
📒 Files selected for processing (12)
.github/workflows/docs-quality.ymlclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/test_support.rsclients/web/apps/docs/src/content/docs/es/guides/model-routing.mdclients/web/apps/docs/src/content/docs/guides/model-routing.mdopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdopenspec/changes/archive/2026-04-07-productize-model-routing/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdopenspec/specs/model-routing/spec.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: sonar
- GitHub Check: pr-checks
- GitHub Check: submit-gradle
- GitHub Check: Cloudflare Pages
🧰 Additional context used
📓 Path-based instructions (6)
clients/agent-runtime/src/providers/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
Implement
Providertrait insrc/providers/and register insrc/providers/mod.rsfactory when adding a new provider
Files:
clients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/providers/mod.rs
clients/agent-runtime/src/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
clients/agent-runtime/src/**/*.rs: Never log secrets, tokens, raw credentials, or sensitive payloads in any logging statements
Avoid unnecessary allocations, clones, and blocking operations to maintain performance and efficiency
Files:
clients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/test_support.rs
clients/agent-runtime/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
Run
cargo fmt --all -- --check,cargo clippy --all-targets -- -D warnings, andcargo testfor code validation, or document which checks were skipped and why
Files:
clients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/test_support.rs
**/*.rs
⚙️ CodeRabbit configuration file
**/*.rs: Focus on Rust idioms, memory safety, and ownership/borrowing correctness.
Flag unnecessary clones, unchecked panics in production paths, and weak error context.
Prioritize unsafe blocks, FFI boundaries, concurrency races, and secret handling.
Files:
clients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/test_support.rs
**/*
⚙️ CodeRabbit configuration file
**/*: Security first, performance second.
Validate input boundaries, auth/authz implications, and secret management.
Look for behavioral regressions, missing tests, and contract breaks across modules.
Files:
clients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsopenspec/changes/archive/2026-04-07-productize-model-routing/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdclients/web/apps/docs/src/content/docs/guides/model-routing.mdclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/test_support.rsopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdclients/web/apps/docs/src/content/docs/es/guides/model-routing.mdopenspec/specs/model-routing/spec.md
**/*.{md,mdx}
⚙️ CodeRabbit configuration file
**/*.{md,mdx}: Verify technical accuracy and that docs stay aligned with code changes.
For user-facing docs, check EN/ES parity or explicitly note pending translation gaps.
Files:
openspec/changes/archive/2026-04-07-productize-model-routing/exploration.mdopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdclients/web/apps/docs/src/content/docs/guides/model-routing.mdopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.mdclients/web/apps/docs/src/content/docs/es/guides/model-routing.mdopenspec/specs/model-routing/spec.md
🧠 Learnings (10)
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/.github/**/*.{yml,yaml} : For workflow/template-only changes, ensure YAML/template syntax validity
Applied to files:
.github/workflows/docs-quality.yml
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/main.rs : Preserve CLI contract unless change is intentional and documented; prefer explicit errors over silent fallback for unsupported critical paths
Applied to files:
clients/agent-runtime/src/providers/router.rsclients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsopenspec/changes/archive/2026-04-07-productize-model-routing/design.mdclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/test_support.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/**/*.rs : Run `cargo fmt --all -- --check`, `cargo clippy --all-targets -- -D warnings`, and `cargo test` for code validation, or document which checks were skipped and why
Applied to files:
clients/agent-runtime/src/lib.rsclients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/doctor/mod.rsclients/agent-runtime/src/test_support.rsopenspec/changes/archive/2026-04-07-productize-model-routing/verify-report.md
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/**/Cargo.toml : Do not add heavy dependencies for minor convenience; justify new crate additions
Applied to files:
clients/agent-runtime/src/lib.rsclients/agent-runtime/src/test_support.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/**/Cargo.toml : Preserve release-size profile assumptions in `Cargo.toml` and avoid adding heavy dependencies unless clearly justified
Applied to files:
clients/agent-runtime/src/lib.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/**/*.rs : Avoid unnecessary allocations, clones, and blocking operations to maintain performance and efficiency
Applied to files:
clients/agent-runtime/src/lib.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/{security,gateway,tools,config}/**/*.rs : Do not silently weaken security policy or access constraints; keep default behavior secure-by-default with deny-by-default where applicable
Applied to files:
clients/agent-runtime/src/lib.rsclients/agent-runtime/src/doctor/mod.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/providers/**/*.rs : Implement `Provider` trait in `src/providers/` and register in `src/providers/mod.rs` factory when adding a new provider
Applied to files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/test_support.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/src/channels/**/*.rs : Implement `Channel` trait in `src/channels/` with consistent `send`, `listen`, and `health_check` semantics and cover auth/allowlist/health behavior with tests
Applied to files:
clients/agent-runtime/src/providers/mod.rsclients/agent-runtime/src/test_support.rs
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Include threat/risk notes and rollback strategy for security, runtime, and gateway changes; add or update tests for boundary checks and failure modes
Applied to files:
openspec/changes/archive/2026-04-07-productize-model-routing/design.md
🪛 GitHub Actions: Docs Quality
clients/web/apps/docs/src/content/docs/guides/model-routing.md
[error] 1-1: File read failed in scripts/model-routing-docs.test.mjs: ENOENT no such file or directory. Error: ENOENT: no such file or directory, open 'clients/web/apps/docs/src/content/docs/guides/model-routing.md'.
🪛 LanguageTool
openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md
[style] ~169-~169: Consider an alternative to strengthen your wording.
Context: ...y discoverable - Cons: Larger scope, more changes across modules - Effort: High 3. **...
(CHANGES_ADJUSTMENTS)
clients/web/apps/docs/src/content/docs/guides/model-routing.md
[style] ~41-~41: To elevate your writing, try using more formal phrasing here.
Context: ...ck to the default provider. The runtime keeps working, but it logs a warning so you can fix t...
(CONTINUE_TO_VB)
clients/web/apps/docs/src/content/docs/es/guides/model-routing.md
[grammar] ~13-~13: Elimina la puntuación
Context: ...nte clasificas mensajes hacia esos hints, y validas la configuración con `corvus ...
(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)
[grammar] ~17-~17: Corrige la minúscula.
Context: ...tor`. Usa esta guía cuando quieras: - enviar prompts rápidos a un modelo más barato,...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~20-~20: Agrega un signo de puntuación.
Context: ...tas que acepten imágenes explícitamente. ## Qué hace el enrutamiento de modelos `[[mod...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~22-~22: Agrega un signo de puntuación.
Context: ...amente. ## Qué hace el enrutamiento de modelos [[model_routes]] mapea un hint a un provider y a un mode...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~24-~24: Corrige la minúscula.
Context: ...utamiento de modelos [[model_routes]] mapea un hint a un provider y a un modelo. ``...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~38-~38: Agrega un signo de puntuación.
Context: ... model = "o1-preview" ``` En tiempo de solicitud Corvus puede recibir un selector como `...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~41-~41: Corrige el error ortográfico.
Context: ...Si ninguna ruta coincide, Corvus cae al provider por defecto. El runtime sigue funcionan...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~42-~42: Agrega un signo de puntuación.
Context: ...ra que puedas corregir la configuración. ## Qué hace la clasificación de consultas `[q...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~44-~44: Agrega un signo de puntuación.
Context: ...ación. ## Qué hace la clasificación de consultas [query_classification] es opcional. Cuando está habilitada, ex...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~46-~46: Corrige la minúscula.
Context: ...n de consultas [query_classification] es opcional. Cuando está habilitada, examin...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~102-~102: Corrige la minúscula.
Context: ...soning, codeovision. - provider` debe coincidir con un provider que Corvus pue...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~103-~103: Corrige la minúscula.
Context: ...pueda inicializar. - allow_image_input es opt-in. Si lo omites, la ruta se trata c...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~116-~116: Elimina la puntuación
Context: ...de coincidir por keyword, patrón literal, o ambos. | Campo | Tipo | Requerido | ...
(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)
[grammar] ~131-~131: Corrige la minúscula.
Context: ...alquier** pattern coincide. - keywords no distingue mayúsculas/minúsculas. - `patt...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~132-~132: Corrige la minúscula.
Context: ...ngue mayúsculas/minúsculas. - patterns sí distingue mayúsculas/minúsculas. - La pr...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~195-~195: Cambia la palabra o signo.
Context: ...nput = true`. ## Ejemplo: enrutamiento multi-provider con clasificación ```toml default_prov...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_OTHER)
[grammar] ~246-~246: Corrige la minúscula.
Context: ...n, Phase 1 añade estas advertencias: - clasificación habilitada pero sin reglas configuradas...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~258-~258: Agrega un signo de puntuación.
Context: ... nunca cambia el modelo seleccionado. | enabled = true pero rules está vacío. | Advertencia:...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~258-~258: Corrige la minúscula.
Context: ...pero rules está vacío. | Advertencia: la clasificación está habilitada pero no h...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_LOWERCASE)
[grammar] ~258-~258: Agrega un signo de puntuación.
Context: ...o. | Advertencia: la clasificación está habilitada pero no hay reglas configuradas. | Añad...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~258-~258: Aquí puede haber un error.
Context: ...na regla o desactiva la clasificación. | | La clasificación devuelve hints pero el...
(QB_NEW_ES)
[grammar] ~259-~259: Agrega un signo de puntuación.
Context: ...ficación. | | La clasificación devuelve hints pero el routing igual cae al provider p...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~259-~259: Aquí puede haber un error.
Context: ...na ruta real o añade la ruta faltante. | | Una regla nunca se dispara aunque la cl...
(QB_NEW_ES)
[grammar] ~260-~260: Aquí puede haber un error.
Context: ...keywords, patterns o elimina la regla. | | Los turnos con imágenes son rechazados....
(QB_NEW_ES)
[grammar] ~261-~261: Aquí puede haber un error.
Context: ...a ruta con allow_image_input = true. | | Un selector directo como hint:code no...
(QB_NEW_ES)
[grammar] ~262-~262: Aquí puede haber un error.
Context: ...re del hint o añade la ruta que falta. | | Una ruta parece válida en config pero f...
(QB_NEW_ES)
[grammar] ~263-~263: Agrega un signo de puntuación.
Context: ...ue falta. | | Una ruta parece válida en config pero falla en tiempo de solicitud. | Un...
(QB_NEW_ES_OTHER_ERROR_IDS_MISSING_PUNCTUATION)
[grammar] ~263-~263: Corrige el error ortográfico.
Context: ...pero falla en tiempo de solicitud. | Un provider no primario falló durante la inicializa...
(QB_NEW_ES_OTHER_ERROR_IDS_REPLACEMENT_ORTHOGRAPHY_SPELLING)
[grammar] ~274-~274: Elimina la puntuación
Context: ...easoning, valídalas con corvus doctor`, y añade reglas de clasificación después...
(QB_NEW_ES_OTHER_ERROR_IDS_UNNECESSARY_PUNCTUATION)
🪛 markdownlint-cli2 (0.22.0)
openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md
[warning] 8-8: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
openspec/changes/archive/2026-04-07-productize-model-routing/design.md
[warning] 8-8: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
🔇 Additional comments (24)
clients/agent-runtime/src/lib.rs (1)
77-78: LGTM!Test-only module declaration is correctly gated with
#[cfg(test)]and the reordering is purely organizational.clients/agent-runtime/src/test_support.rs (1)
96-185: LGTM!Well-designed test harness. Key observations:
- Thread-local
set_defaultworks correctly since consuming tests are synchronous#[test](not#[tokio::test])parking_lot::Mutexis appropriate for the capture layerVisittrait implementation covers all field types correctlyThis addresses the prior review feedback about extracting duplicated tracing-capture utilities into a shared module.
openspec/changes/archive/2026-04-07-productize-model-routing/design.md (1)
1-7: LGTM!Design document is well-structured with clear decision rationale. The data flow diagram now correctly uses the
textlanguage identifier (addressing prior feedback), and line-number references have been replaced with function/method names for resilience..github/workflows/docs-quality.yml (1)
68-69: LGTM!CI step correctly validates model routing docs before the main docs build. Path traversal matches the working directory context.
clients/agent-runtime/src/providers/router.rs (2)
83-87: LGTM!Enhanced warning now includes the raw
fallback_modelfield, which aids debugging when operators misconfigure hints. The message text clarifies the fallback behavior.
423-472: LGTM!Comprehensive test coverage for warning behavior:
- Verifies structured fields (
hint,fallback_model) are captured correctly- Confirms no spurious warnings for valid hints and non-hint selectors
- Uses synchronous tests which correctly pair with thread-local
set_defaultsemanticsclients/agent-runtime/src/providers/mod.rs (2)
752-761: LGTM!Enhanced warning now surfaces which route hints are impacted when a provider fails initialization. The
affected_routesfield provides actionable diagnostic information for operators. Computation only occurs on the error path, avoiding overhead in the happy case.
1646-1737: LGTM!Tests thoroughly validate both positive and negative cases:
failed_routed_provider_warns_about_affected_routes: Verifies warning includes provider name and affected hint listrouted_provider_init_stays_quiet_when_all_providers_succeed: Confirms no false-positive warningsclients/agent-runtime/src/doctor/mod.rs (2)
256-316: LGTM!Comprehensive classification integrity validation covering:
- Empty rules with classification enabled
- Missing model_routes with classification enabled
- Empty hint (addresses prior review feedback)
- Orphaned hints with helpful "available" list
- Never-matching rules (empty keywords AND patterns)
All checks emit warnings (not errors) preserving backward compatibility with existing configs.
920-1137: LGTM!Thorough test coverage for all classification integrity warning scenarios, including the edge case where patterns are present without keywords (should not warn about never-matching).
openspec/changes/archive/2026-04-07-productize-model-routing/exploration.md (1)
1-6: LGTM!Exploration document now correctly uses a top-level heading (addressing prior feedback). The document provides comprehensive inventory of the existing routing system and clearly identifies the product gaps being addressed by this PR.
clients/web/apps/docs/src/content/docs/guides/model-routing.md (3)
1-1: Pipeline failure resolved by file creation.The docs quality check failed because it attempted to read this file before it was committed. Now that the file exists, the test should pass on the next run.
214-214: Anthropic model name is correct.The model ID
claude-sonnet-4-6aligns with Anthropic's current naming convention as verified in the previous review.
236-272: Doctor validation and troubleshooting sections are comprehensive.The guide correctly documents the Phase 1 warning-only checks and maps troubleshooting symptoms to resolutions. This aligns with the spec requirements and the
doctor/mod.rsimplementation.openspec/changes/archive/2026-04-07-productize-model-routing/verify-report.md (3)
1-1: Markdown linting issues resolved.The H1 heading fix from the previous review has been applied. The report now follows proper markdown structure.
22-58: Build and test evidence is well-structured.The verification report documents formatter, clippy, test runs, and targeted behavioral tests. The format is clear and includes both baseline and targeted test coverage.
64-103: Spec compliance matrix provides comprehensive traceability.All 35 scenarios map to specific test evidence in
doctor/mod.rs,providers/router.rs,providers/mod.rs,agent/classifier.rs,channels/mod.rs, andscripts/model-routing-docs.test.mjs. This enables verification of the formal contract.clients/web/apps/docs/src/content/docs/es/guides/model-routing.md (2)
214-214: Anthropic model name correction applied.The invalid
claude-sonnet-4-20250514has been corrected toclaude-sonnet-4-6as recommended in the previous review.
1-274: EN/ES parity verified.The Spanish guide maintains structural parity with the English version:
- Same frontmatter metadata (lines 1-9)
- Matching section structure (config reference, examples, troubleshooting)
- Equivalent TOML examples with identical model/provider configurations
- Parallel troubleshooting table covering the same diagnostic scenarios
Technical terminology is consistently translated (e.g., "enrutamiento" for routing, "clasificación" for classification, "hints" preserved as technical term).
As per coding guidelines, EN/ES parity is required for user-facing docs.
openspec/specs/model-routing/spec.md (5)
369-376: Unknown-hint fallback contract clarified.The scenario now explicitly specifies that the raw selector (e.g.,
"hint:code") must be preserved and passed downstream as the model string (line 374). This resolves the ambiguity flagged in the previous review.
12-73: Operator documentation requirements are comprehensive.The spec mandates:
- Complete TOML config reference for all fields
- Multiple example configurations (fast/reasoning, code, vision, multi-provider)
- End-to-end hint flow explanation
- Troubleshooting section covering common misconfigurations
These requirements map directly to the documentation guide content and are validated by
scripts/model-routing-docs.test.mjs.
76-186: Config validation requirements align with doctor implementation.The spec defines four warning-only checks:
- Classification rule hint integrity (orphaned hints)
- Classification enabled with zero rules
- Classification enabled with zero model routes
- Never-matching rules (empty keywords AND patterns)
Each requirement includes multiple scenarios with Given/When/Then structure, enabling verification through the test evidence in
verify-report.md.
189-254: Silent failure fixes add observability without behavior change.The unknown-hint fallback logging (lines 189-223) and failed provider init logging (lines 226-254) requirements correctly specify warning-level logs with structured fields (
hint,fallback_model,provider,affected_routes) while preserving existing fallback behavior.
257-427: Formal contracts cover routing, classification, fallback, and image gating.The specification formalizes:
- Route resolution (hint prefix parsing, lookup, fallback)
- Classification (priority ordering, length gating, keyword/pattern matching, case sensitivity)
- Fallback behavior (unknown hint warns, no-match is silent, disabled uses default)
- Image routing gating (vision_model_hint resolution, allow_image_input opt-in)
All contracts include testable scenarios that map to the compliance matrix in the verification report.
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
|



Summary
Productize the existing model routing and query classification system with
operator-facing documentation, config validation hardening, improved warning
logs, and a formal behavioral specification.
The routing engine itself is unchanged — all changes are additive.
What's included
Operator documentation
guides/model-routing.mdes/guides/model-routing.mdastro.config.mjsConfig validation (doctor checks)
Warning log improvements
Formal specification
openspec/specs/model-routing/spec.mdwith Given/When/Then scenariosSDD artifacts
Testing
Issues
Closes #269
Refs: DALLAY-173, DALLAY-174, DALLAY-175