hongming 8845b719da
publish-image / Resolve runtime version (push) Successful in 5s
CI / Adapter unit tests (push) Successful in 7s
Secret scan / Scan diff for credential-shaped strings (push) Successful in 8s
publish-image / Classify change (decouple publish from promote) (push) Successful in 6s
CI / Template validation (static) (push) Successful in 9s
meta-ci-advisory / meta (advisory) (push) Successful in 11s
verify-providers-projection / Regenerate projection, fail on drift, assert registry ⊆ template (push) Successful in 14s
CI / Adapter conformance (ADR-004 socket) (push) Successful in 41s
CI / T4 tier-4 conformance (live) (push) Successful in 2m18s
CI / Template validation (runtime) (push) Successful in 2m35s
CI / validate (push) Successful in 2s
publish-image / Build & push workspace-template-claude-code image (push) Successful in 5m5s
publish-image / Promote runtime_image_pins (CP admin) (staging-api.moleculesai.app, staging) (push) Successful in 3s
publish-image / Verify runtime_image_pins moved (fail-loud) (staging-api.moleculesai.app, staging) (push) Successful in 6s
Merge pull request 'fix(overflow): match the runtime's own "Context length exceeded" string' (#397) from fix/context-overflow-human-readable-pattern into main
2026-08-13 21:17:44 +00:00

Molecule AI workspace template — Claude Code

This repository builds the claude-code workspace image used by Molecule AI. The canonical source is this Gitea repository; the canvas template picker is the supported way to create a workspace from it.

Runtime shape

  • entrypoint.sh prepares the mounted workspace/config directories, exposes plugin-provided skills to Claude Code, drops to the agent user, and executes molecule-runtime.
  • adapter.py resolves the configured model/provider and creates the Claude Code executor.
  • claude_sdk_executor.py owns the Claude Agent SDK session, recovery, and channel behavior.
  • config.yaml is the template's model/provider source. The copy under internal/providers/ is a CI-checked projection of the control-plane registry, not a second runtime configuration.

Authentication

Authentication follows the selected provider. Claude subscription workspaces can use CLAUDE_CODE_OAUTH_TOKEN; direct or compatible provider routes use the credential names declared in config.yaml (for example ANTHROPIC_API_KEY). MOLECULE_RESOLVED_PROVIDER, when injected by the platform, has precedence over heuristic provider selection.

adapter.py applies provider-specific endpoint routing. An explicitly supplied ANTHROPIC_BASE_URL remains an override and is not replaced at boot.

Never commit credentials or put them in command-line examples. Configure them through the workspace/platform secret surfaces.

Important files

Path Purpose
Dockerfile Builds the runtime image and installs the private runtime wheel from the Gitea package registry
entrypoint.sh Container boot and privilege-drop path
adapter.py Provider resolution and runtime adapter
claude_sdk_executor.py Claude Agent SDK execution/session behavior
config.yaml Template metadata, providers, models, and runtime settings
tests/ Adapter, entrypoint, provenance, and documentation contracts
tests_conformance/ SDK-owned adapter conformance suite

The current file contains template_schema_version: 1; change it only with a corresponding platform contract change and validation.

Development and delivery

See runbooks/local-dev-setup.md for commands that mirror CI. Pull requests run validation and tests. A push to main invokes the repository's publish-image workflow, which builds the image, pushes it to the Gitea OCI registry, and applies the configured pin checks. Do not substitute a manual registry or direct-main-push procedure.

License

Business Source License 1.1 — © Molecule AI.

S
Description
No description provided
Readme 1.3 MiB
Languages
Python 86.3%
Shell 11.6%
Dockerfile 2.1%