fix(adapter): honor explicit provider config — fail fast when not in registry (#180) #4

Merged
claude-ceo-assistant merged 2 commits from fix/180-explicit-provider-validation into main 2026-05-07 18:09:01 +00:00

Closes #180. See commit message for details. 10 new tests + all 45 existing tests pass.

Closes #180. See commit message for details. 10 new tests + all 45 existing tests pass.
claude-ceo-assistant added 1 commit 2026-05-07 17:47:37 +00:00
fix(adapter): honor explicit provider config — fail fast when not in registry (#180)
Some checks failed
CI / Adapter unit tests (pull_request) Failing after 54s
CI / Adapter unit tests (push) Failing after 54s
CI / validate (push) Successful in 3m35s
CI / validate (pull_request) Successful in 3m25s
Secret scan / secret-scan (pull_request) Successful in 8s
e40ba56dc8
Workspace operators set 'provider: minimax' in /configs/config.yaml
expecting the adapter to route to MiniMax. Pre-fix behavior: adapter
ignored 'provider:' entirely, _resolve_provider model-matched against
_BUILTIN_PROVIDERS (anthropic-oauth + anthropic-api only), no model_prefix
matched 'MiniMax-M2.7-highspeed', silent fallback to providers[0]
(anthropic-oauth) — SDK kept using CLAUDE_CODE_OAUTH_TOKEN, hit OAuth
quota under a name the operator never asked for.

Fix: _resolve_provider now takes an explicit_provider arg. setup() reads
it from runtime_config.provider OR top-level config.yaml provider:.
Explicit name in registry → returned. Not in registry → ValueError with
the two paths to fix (add provider entry, or switch runtime template).

10 new tests cover: explicit-in-registry returns match, case-insensitive,
not-in-registry raises with actionable message, defense-in-depth against
silent fallback regression, custom-registry lookup, empty/None treated as
no-explicit (back-compat).

Closes #180.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
claude-ceo-assistant added 1 commit 2026-05-07 17:53:28 +00:00
test(adapter): install adapter import shims via conftest
All checks were successful
Secret scan / secret-scan (pull_request) Successful in 9s
CI / Adapter unit tests (pull_request) Successful in 59s
CI / validate (pull_request) Successful in 3m25s
CI / validate (push) Successful in 3m25s
CI / Adapter unit tests (push) Successful in 55s
de17e60d4a
CI runner installs only `pytest pytest-asyncio pyyaml`; without the
molecule_runtime/a2a/claude_sdk_executor stubs, the new
test_provider_resolution.py fails to collect with
ModuleNotFoundError. test_adapter_prevalidate.py owned the same
shims via a per-file _install_stubs(), but two files maintaining
parallel stub copies eventually disagree on shape (BaseAdapter
needing install_plugins_via_registry, etc.).

Move the shim install + sys.path bump into tests/conftest.py so
every test module shares a single canonical stub set, collected
before any test imports adapter.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
claude-ceo-assistant force-pushed fix/180-explicit-provider-validation from de17e60d4a to f8d7f8f3a8 2026-05-07 17:59:01 +00:00 Compare
claude-ceo-assistant merged commit 3c849b3ba7 into main 2026-05-07 18:09:01 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-ai-workspace-template-claude-code#4
No description provided.