Go to file
Hongming Wang 2b9b4306eb fix(adapter): per-entry isolation in _load_providers + tighten _normalize_provider
Two correctness issues spotted in self-review of c6f4912:

1. String-as-prefix typo split into character tuple. ``model_prefixes:
   mimo-`` (operator forgot brackets) used to iterate over characters
   → ``('m','i','m','o','-')``, silently routing every model id starting
   with 'm', 'i', or '-' through the entry. Now: non-list values coerce
   to empty tuple (entry survives but matches nothing — operator notices
   in boot banner, not via misrouted requests).

2. Single bad provider entry nuked the whole registry. _load_providers
   built the registry via a generator inside tuple(...). One AttributeError
   mid-comprehension (e.g. ``[mimo-, 123]`` — int's missing .lower())
   propagated out, broad except caught it, registry silently fell back
   to _BUILTIN_PROVIDERS (oauth + anthropic-api only). Every third-party
   model would then route to anthropic-oauth — exactly the silent-fallback
   failure mode this PR was meant to eliminate. Now: per-entry try/except
   drops the bad entry with a warning, rest survives.

Also: entries without a string ``name`` field are now dropped with a
warning instead of silently using the placeholder ``<unnamed>`` —
operator typos surface in boot logs.

Tests: 28 passing (3 new regression tests covering both issues plus
the no-name path).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 23:58:24 -07:00
.claude feat: initial template content (extracted from molecule-monorepo) 2026-04-16 03:05:40 -07:00
.github/workflows ci: install pyyaml so the YAML-loading test path is exercised 2026-04-30 23:40:47 -07:00
.molecule-ci/scripts docs: add CI validation scripts (#4) 2026-04-21 03:17:30 +00:00
runbooks docs: add known-issues.md and runbooks/local-dev-setup.md 2026-04-22 08:36:22 +00:00
scripts fix: wire up GitHub App token refresh — fixes #1933 2026-04-23 17:57:30 -07:00
tests fix(adapter): per-entry isolation in _load_providers + tighten _normalize_provider 2026-04-30 23:58:24 -07:00
__init__.py feat: add adapter code + Dockerfile for standalone deployment 2026-04-16 04:27:22 -07:00
.gitattributes chore: enforce LF line endings + fix entrypoint.sh CRLF 2026-04-23 17:57:57 -07:00
.gitignore chore: gitignore credentials for molecule-ai-workspace-template-claude-code 2026-04-16 09:15:36 -07:00
adapter.py fix(adapter): per-entry isolation in _load_providers + tighten _normalize_provider 2026-04-30 23:58:24 -07:00
claude_sdk_executor.py fix(a2a-v1): rewrite FilePart emit using v1 protobuf Part struct 2026-04-29 00:46:47 -07:00
CLAUDE.md feat: initial template content (extracted from molecule-monorepo) 2026-04-16 03:05:40 -07:00
config.yaml feat(config): add MiniMax-M2.7-highspeed model entry 2026-04-30 23:30:24 -07:00
Dockerfile Merge branch 'main' into fix/wire-up-gh-token-refresh 2026-04-29 00:56:02 -07:00
entrypoint.sh feat(adapter): data-driven provider registry in config.yaml 2026-04-30 23:29:40 -07:00
known-issues.md fix(adapter): warn at startup if CLAUDE_CODE_OAUTH_TOKEN is absent (KI-001) 2026-04-29 01:57:16 -07:00
README.md fix: document Token Plan URL support and multi-endpoint routing 2026-04-29 16:56:43 -07:00
requirements.txt chore: bump pin to >=0.1.22 (state_transition_history fix) 2026-04-27 07:39:20 -07:00

template-claude-code-default

Molecule AI workspace template for the claude-code-default runtime.

Usage

In Molecule AI canvas

Select this template when creating a new workspace — it appears in the template picker automatically.

From a URL (community install)

Paste this URL when creating a workspace:

github://Molecule-AI/template-claude-code-default

Files

  • config.yaml — workspace configuration (runtime, model, skills, etc.)
  • system-prompt.md — agent system prompt (if present)

Auth paths

Path Env var(s) Where to get the key
OAuth (Claude Code subscription) CLAUDE_CODE_OAUTH_TOKEN claude login
Anthropic API (direct) ANTHROPIC_API_KEY console.anthropic.com
Third-party Anthropic-compat (e.g. Xiaomi MiMo pay-as-you-go) ANTHROPIC_API_KEY (provider's key) provider console
Xiaomi MiMo Token Plan ANTHROPIC_API_KEY (Token Plan key), ANTHROPIC_BASE_URL (Token Plan endpoint) token-plan dashboard

For third-party providers, entrypoint.sh rewrites ANTHROPIC_BASE_URL based on the selected MODEL so the claude CLI routes there. Currently auto-routes mimo-* models to https://api.xiaomimimo.com/anthropic (pay-as-you-go). Token Plan users should set ANTHROPIC_BASE_URL=https://token-plan-sgp.xiaomimimo.com/anthropic as a workspace or org-level secret — the shell mapping is the fallback and operator-set values always win. Other Token Plan endpoints (e.g. token-plan-hk.xiaomimimo.com) can be used by setting the secret explicitly.

Schema version

template_schema_version: 1 — compatible with Molecule AI platform v1.x.

License

Business Source License 1.1 — © Molecule AI.