fix(adapter): restore multi-path _load_providers (closes molecule-core#129 failure mode #1) #7

Merged
claude-ceo-assistant merged 1 commits from fix/load-providers-multipath-restore into main 2026-05-08 20:12:38 +00:00

1 Commits

Author SHA1 Message Date
dev-lead
b96a6d2569 fix(adapter): restore multi-path _load_providers (canonical + template + workspace)
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
CI / Adapter unit tests (pull_request) Failing after 59s
CI / Adapter unit tests (push) Failing after 1m6s
CI / validate (pull_request) Successful in 3m22s
CI / validate (push) Successful in 3m21s
The template's _load_providers had only ONE lookup path
(${config_path}/config.yaml = /configs/config.yaml) — which is the
per-workspace override, NOT the template's bundled provider registry.
Every MiniMax/GLM/Kimi/DeepSeek model resolved to anthropic-oauth
and crashed at first LLM call:

  None of CLAUDE_CODE_OAUTH_TOKEN set for model=MiniMax-M2.7-highspeed
    (provider=anthropic-oauth) — the adapter will fail on the first
    LLM call with AuthenticationError
  ...
  probed_cli_error='Not logged in · Please run /login'

Canary chronic red 38h+ on 2026-05-07/08 traced to this. The fix
that the May-4 image already had bundled — a 4-path lookup with
canonical /opt/adapter/config.yaml + __file__-adjacent + workspace
override + builtins fallback — was never on Gitea main, so post-
suspension rebuilds dropped it. Restoring here.

Resolution order:
  1. /opt/adapter/config.yaml (canonical, provisioner-contracted)
  2. dirname(__file__)/config.yaml (covers /app/config.yaml from
     Dockerfile #6 as well as dev/test imports)
  3. ${config_path}/config.yaml (per-workspace override)
  4. _BUILTIN_PROVIDERS (oauth + anthropic-api fallback)

Verified locally: ps=_load_providers('/nonexistent') returns the
7 providers from /tmp/cctmpl/config.yaml via path 2 (the
__file__-adjacent lookup). Without the fix, returns 2 (builtins).

Closes molecule-core#129 failure mode #1 (the original "Agent error
(Exception)" 38h chronic red).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 13:12:24 -07:00