fix(adapter): restore multi-path _load_providers (closes molecule-core#129 failure mode #1) #7
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/load-providers-multipath-restore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes molecule-core#129 failure mode #1
38h chronic canary red traced to this:
_load_providersonly checked${config_path}/config.yaml(i.e./configs/config.yaml, the per-workspace override). The canary's step 7c PUTs a synthetic config.yaml that has noproviders:section, so the lookup fell through to_BUILTIN_PROVIDERS(oauth + anthropic-api). MiniMax-M2.7-highspeed has no matching prefix in builtins →_resolve_providerreturnsproviders[0]=anthropic-oauth→ CLAUDE_CODE_OAUTH_TOKEN is unset → claude CLI fails withNot logged in · Please run /login→ A2A returnsAgent error (Exception).How this got missed
The May-4 image already had the proper 4-path lookup (
/opt/adapter/config.yaml→dirname(__file__)/config.yaml→/configs/config.yaml→ builtins). I extracted it from the running container today viadocker cpfrom the deployed image. But Gitea main never carried that fix — the post-suspension migration cycle apparently moved a different branch's adapter.py into main, so subsequent rebuilds dropped the multi-path code.Verification
Local smoke (verified 2026-05-08T20:18 UTC):
Without the fix, returns 2 (builtins only).
Post-merge: rebuild image → push to ECR → CP
runtime_image_pinsupdated to new digest → next canary tenant pulls fixed image → A2A returns PONG → green.🤖 Generated with Claude Code
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>LGTM. Restores the 4-path _load_providers from the May-4 image. Verified locally: 7 providers loaded vs 2 (builtins) on old code. Closes #129 failure mode #1 (the 38h chronic canary red).