Commit Graph

3 Commits

Author SHA1 Message Date
Hongming Wang
754d162d99 feat: dual-mode for upstream register_platform (post-#17751) + legacy register_platform_adapter
Some checks failed
CI / test (3.11) (push) Failing after 13m37s
CI / test (3.12) (push) Failing after 13m37s
NousResearch/hermes-agent#17751 (merged 2026-04-30) shipped a
comprehensive pluggable-platform system with:

- ctx.register_platform(name, label, adapter_factory, check_fn, ...)
- Open Platform enum (Platform('molecule') creates a pseudo-member
  via _missing_() when the platform_registry knows about it)

That supersedes my upstream PR #18775 (which used a narrower
register_platform_adapter shape with a closed enum + custom
PluginPlatformIdentifier). Closing #18775 as redundant.

This plugin previously coupled to my fork's API. Migration:

- __init__.py register() now prefers ctx.register_platform when
  available; falls back to ctx.register_platform_adapter on legacy
  forks (template-hermes' baked-in fork until it migrates).
- adapter.py constructs Platform(name) when the enum accepts
  'molecule', else falls back to PluginPlatformIdentifier(name).

Same wheel installs cleanly on stock hermes-agent (post-#17751)
AND on the legacy template-hermes fork build. Removed the test
stub of PluginPlatformIdentifier; tests now stub the open-enum
Platform shape with the same _missing_() behavior the upstream
ships.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 07:47:51 -07:00
Hongming Wang
191ee89c19 feat: surface MOLECULE_WORKSPACE_TOKEN requirement + soft-warn when unset
The molecule-runtime spawned subprocess reads MOLECULE_WORKSPACE_TOKEN
to authenticate outbound platform calls (per
molecule_runtime.platform_auth.get_token). Inside a container the
runtime falls back to /configs/.auth_token; external runtimes (the
common case for this plugin) must supply the env var.

The env var was already inherited via os.environ.copy(), so existing
installs that DID export MOLECULE_WORKSPACE_TOKEN were fine. But there
was no signal to operators that the var was needed — silent 401s are
the worst failure mode. This adds:

- A soft warning in check_molecule_requirements when the token is unset
  (does NOT block plugin load; in-container case still works).
- README env-var section now lists the token alongside WORKSPACE_ID.
- Two regression tests asserting (a) the token reaches the subprocess
  when set and (b) is absent when unset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 04:33:35 -07:00
Hongming Wang
ac6f261150 Initial commit — hermes platform plugin for the Molecule channel
Connects an external hermes-agent to the Molecule platform via the
molecule-runtime A2A MCP server. Inbound canvas-user and peer-agent
messages surface as hermes platform events; outbound replies route
back through send_message_to_user (canvas) or delegate_task (peer).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 03:26:06 -07:00