feat(backends): add capability registry#670
Conversation
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
cb62b23for PR #670
Review record:
ea083c3c-b46d-4f36-b60b-776cfb00c743
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Follow-up Findings
src/ouroboros/cli/commands/config.py:29[warning]ouroboros config validatestill rejects valid alias-backed runtime configs._VALID_BACKENDSis built fromruntime_backend_choices()without aliases, so values likeclaude_code,codex_cli,opencode_cli, etc. fail the check at line 443 even though the schema explicitly allows them (config/models.py:342) and the runtime factory now resolves them viaresolve_runtime_backend_name(). This leaves users with a false validation failure for configs that the rest of the system accepts.
Non-blocking Suggestions
| 1 | tests/unit/backends/test_capabilities.py:17 | Tests | The new registry tests only exercise the pure helper layer. They do not cover the loader integration that changed in get_llm_backend() for runtime aliases like codex_cli, gemini_cli, and opencode_cli, or the claude_code special-case. Adding a few cases in tests/unit/config/test_loader.py would lock down the user-visible env-var contract. |
Design Notes
Centralizing backend capability metadata is the right direction and removes several duplicated alias maps. The main gap is that validation still uses a canonical-only view, so the new registry contract is not applied consistently across all touched surfaces.
Policy Notes
- No in-scope blocking findings remained after policy filtering; downgraded verdict accordingly.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
`config validate` rejected valid alias-backed runtime configs such as `claude_code`, `codex_cli`, and `opencode_cli` because `_VALID_BACKENDS` was built from the canonical-only `runtime_backend_choices()` list. The configuration schema (`config/models.py:VALID_RUNTIME_BACKENDS`) explicitly accepts those aliases and the runtime factory resolves them through `resolve_runtime_backend_name()`, so the CLI validate command must do the same. - Use the alias-aware `resolve_runtime_backend_name` helper for the membership check at the validate path. The canonical-only set `_VALID_BACKENDS` remains for the switch command's "switchable backend" list, which is intentionally a curated public surface. - Add parametrized regression coverage for `claude_code`, `codex_cli`, `opencode_cli`, `gemini_cli`, and `hermes_cli` aliases. Addresses ouroboros-agent[bot] follow-up on #670.
There was a problem hiding this comment.
Review — ouroboros-agent[bot]
Verdict: APPROVE
Reviewing commit
ba592f5for PR #670
Review record:
005bf2fb-1456-4e87-acc1-96858414e129
Blocking Findings
No in-scope blocking findings remained after policy filtering.
Non-blocking Suggestions
None.
Design Notes
The central registry reduces duplicated backend-name logic across config, runtime, and provider factories, and the refactor appears contract-consistent within the changed surface. Added unit coverage is aligned with the main alias/capability paths; I did not execute tests because pytest is not installed in this environment.
Recovery Notes
First recoverable review artifact generated from codex analysis log.
Reviewed by ouroboros-agent[bot] via Codex deep analysis
Ready for maintainer review — re-review pingThis PR (capability registry) is now in a clean merge-ready state on commit
Why this is safe to merge
Q00 maintainers — could you take a final pass and merge if it looks good? Happy to rebase if anything stack-related needs aligning post-merge of the foundation chain. |
Re-review pingStatus
What the PR doesCentralizes backend metadata in a single capability registry ( Iterative improvements driven by the botThe bot's APPROVE on the prior head still flagged one user-visible follow-up:
Why merging is safe
cc @Q00 — please consider merging this so the rest of the stack ( |
Stack
1/3 Capability registry for backend aliases and surfaces.
Next PRs:
Changes
ouroboros.backendscapability registry.Validation
uv run pytest tests/unit/backends/test_capabilities.py tests/unit/providers/test_factory.py tests/unit/config/test_loader.py tests/unit/cli/test_config.py tests/unit/orchestrator/test_runtime_factory.py -quv run ruff check src/ouroboros/backends src/ouroboros/providers/factory.py src/ouroboros/orchestrator/runtime_factory.py src/ouroboros/config/loader.py src/ouroboros/cli/commands/config.py tests/unit/backends/test_capabilities.py