Commit Graph

4 Commits

Author SHA1 Message Date
Hongming Wang
ad2aba5770 fix(adapter): skip gateway spawn under MOLECULE_SMOKE_MODE
The boot-smoke gate (molecule-core#2275) invokes adapters with stub
creds and no network so it can exercise executor.execute() lazy
imports. OpenClaw's setup() spawns a real `openclaw gateway --dev`
subprocess that needs valid creds + network — under smoke env it
exits immediately, raising RuntimeError("OpenClaw gateway process
exited") and failing the publish-image workflow.

Add a 1-line opt-out at the top of setup() so the runtime can reach
its smoke short-circuit. Real production boots are unaffected.

Closes the openclaw failure surfaced when running publish-image
across all 8 workspace templates with the new boot-smoke step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 22:46:51 -07:00
Hongming Wang
4e0f1b621d fix: rename new_agent_text_message → new_text_message + a2a.utils → a2a.helpers (a2a-sdk v1)
Lazy import inside async def execute() used the v0 a2a-sdk symbol +
import path. Module-load doesn't evaluate it so the boot-smoke gate
in molecule-ci's publish-template-image workflow didn't catch it,
but the image ships broken — first A2A message hits ImportError:

    from a2a.utils import new_agent_text_message
    ImportError: cannot import name 'new_agent_text_message' from 'a2a.utils'

Verified against the running image (a2a-sdk==1.0.2):
  a2a.utils.new_agent_text_message:    False
  a2a.helpers.new_agent_text_message:  False
  a2a.utils.new_text_message:          False
  a2a.helpers.new_text_message:        True

Surfaced via cross-template audit while verifying v0.1.36 cascade
health. crewai/openclaw/autogen all share the same lazy-import bug.
Fix: rename symbol + switch import path.

Refs: molecule-core memory `reference_a2a_sdk_v0_to_v1_migration`,
task #131 (smoke gate doesn't catch lazy imports).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:35:01 -07:00
Hongming Wang
510694b2a3 fix: add Adapter alias for runtime adapter discovery
`molecule_runtime.adapters.get_adapter()` reads
`getattr(mod, "Adapter")` after importing ADAPTER_MODULE.
Without the alias the workspace startup fails preflight with
"no \`Adapter\` class is exported".

Same fix already shipped in claude-code, hermes, gemini-cli,
langgraph, deepagents today. Surfaced by today's wire-real E2E
sweep against fresh template images. The new bare-imports lint
in molecule-ci PR #8 catches related issues automatically.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 05:51:34 -07:00
Hongming Wang
50d001013d feat: add adapter code + Dockerfile for standalone deployment
Adapters extracted from molecule-monorepo/workspace-template.
Uses molecule-ai-workspace-runtime PyPI package for shared infrastructure.

- adapter.py — runtime-specific adapter class
- requirements.txt — runtime-specific deps + molecule-ai-workspace-runtime
- Dockerfile — FROM python:3.11-slim, pip install, COPY adapter, molecule-runtime entrypoint
- ADAPTER_MODULE=adapter tells the runtime to load this repo's Adapter class

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 04:27:22 -07:00