Commit Graph

602 Commits

Author SHA1 Message Date
4eb56ebec6 fix(plugins_registry): deduplicate handlers in _deep_merge_hooks()
Unconditional list.extend() on repeated plugin install caused every
hook handler to be appended on each reinstall, leading to 3-4x duplicate
firings per event (PreToolUse, PostToolUse, Stop, etc.).

Fix: before appending each incoming handler, compute a fingerprint of
(matcher, frozenset-of-commands). Skip append if the fingerprint is
already present in the merged list. First-time installs are unaffected —
new handlers still land correctly.

Adds 7 unit tests covering: first install, double install, triple install,
different-matcher co-existence, different-command co-existence, existing
user hook preservation, and top-level key merge semantics.

Closes #566

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 05:22:00 +00:00
Hongming Wang
b9dbfda68b
Merge pull request #589 from Molecule-AI/docs/ecosystem-maf-v1
docs(ecosystem): update MAF with v1.0 GA + AG-UI competitive findings
2026-04-16 22:06:42 -07:00
Hongming Wang
87b9015a10
Merge pull request #588 from Molecule-AI/fix/hermes-preflight-keys
fix(canvas): add hermes + gemini-cli to deploy preflight required keys
2026-04-16 22:06:28 -07:00
Hongming Wang
713382c77e docs(ecosystem): update MAF entry with v1.0 GA + AG-UI findings
MAF v1.0 shipped April 7 with multi-agent orchestration, native A2A+MCP,
AG-UI SSE protocol for streaming events to frontends. AG-UI is a direct
competitor to our WebSocket canvas. Added actionable gaps: AG-UI endpoint,
tool governance registry, cost transparency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:53:49 -07:00
Hongming Wang
0e55e97cc3 fix(canvas): add hermes + gemini-cli to deploy preflight required keys
Hermes requires OPENROUTER_API_KEY (or any of its 15 providers).
Gemini CLI requires GOOGLE_API_KEY. Without these entries, the
MissingKeysModal doesn't fire and workspaces start without keys,
causing crash loops.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:45:54 -07:00
Hongming Wang
3520f0f983
Merge pull request #587 from Molecule-AI/fix/canvas-ux-polish
fix(canvas): 5 UX polish fixes — error handling, a11y, loading state
2026-04-16 21:44:29 -07:00
Hongming Wang
c06ac8aa8a fix(canvas): 5 UX polish fixes — error handling, a11y, loading state
1. ScheduleTab + ChannelsTab: wrap toggle/delete in try/catch with
   error feedback (was silently swallowing API failures)
2. MemoryTab: "+Add" button now auto-expands Advanced section
3. SidePanel: keyboard-navigated tabs scroll into view
4. TracesTab: emoji aria-hidden, env-var hint in <details>
5. page.tsx: show Spinner while hydrating instead of flash of EmptyState

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:39:44 -07:00
Hongming Wang
1af06a669b
Merge pull request #586 from Molecule-AI/fix/remove-brand-monitor
chore: remove brand-monitor from monorepo
2026-04-16 21:01:12 -07:00
Hongming Wang
ee677b8c63 chore: remove brand-monitor from monorepo
Standalone operational tool — doesn't belong in the platform core.
Should live in its own repo if needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 21:00:58 -07:00
Hongming Wang
28f720ea22
Merge pull request #564 from Molecule-AI/feat/issue-549-x-brand-monitor
feat(brand-monitor): X API pay-per-use brand monitor with surge mode → Slack
2026-04-16 19:15:12 -07:00
Hongming Wang
5be9b1a7f7
Merge pull request #577 from Molecule-AI/docs/blog-deploy-anywhere-561
docs(blog): deploy anywhere — Fly Machines + control plane provisioners
2026-04-16 18:47:38 -07:00
Hongming Wang
8e95001ef7
Merge pull request #578 from Molecule-AI/docs/devrel-feat-525
docs(devrel): Fly Machines provisioner tutorial (feat #501, closes #525)
2026-04-16 18:47:17 -07:00
Hongming Wang
7f68b6ba79
Merge pull request #555 from Molecule-AI/docs/devrel-feat-hermes-multimodel
docs(devrel): Hermes multi-provider dispatch tutorial (Phase 2a/2b/2c)
2026-04-16 18:47:14 -07:00
Hongming Wang
32f86ecb24
Merge pull request #585 from Molecule-AI/fix/publish-remove-fly
fix(ci): remove Fly registry from publish, push tenant to GHCR
2026-04-16 18:26:46 -07:00
Hongming Wang
27c75af9c4 fix(ci): remove Fly registry from publish pipeline, push tenant to GHCR
Fly.io was deleted — EC2 tenant instances now pull from GHCR.
- Remove Fly registry push step (401 Unauthorized since Fly deleted)
- Remove flyctl deploy step
- Push tenant image to ghcr.io/molecule-ai/platform-tenant instead
- Simplify GHCR auth config (remove Fly token)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:26:26 -07:00
Hongming Wang
d32db875b9
Merge pull request #584 from Molecule-AI/fix/tenant-guard-same-origin
fix(auth): TenantGuard same-origin bypass for EC2 tenant Canvas
2026-04-16 18:25:16 -07:00
Hongming Wang
b0ec35e644 fix(auth): TenantGuard same-origin bypass for EC2 tenant Canvas
On EC2 tenant instances, Caddy serves Canvas (:3000) and API (:8080) under
the same domain. Canvas makes same-origin requests without X-Molecule-Org-Id
or Fly-Replay-Src headers, causing TenantGuard to 404 every API route.

- Add isSameOriginCanvas() as tertiary check in TenantGuard — when
  CANVAS_PROXY_URL is set and Referer/Origin matches Host, pass through.
- Enhance isSameOriginCanvas() to also check Origin header (WebSocket
  upgrade requests send Origin but may not send Referer).
- Add 3 new tests: Referer bypass, Origin bypass (WS), inactive without env.

Fixes all 404s on /workspaces, /templates, /org/templates, /approvals/pending,
/canvas/viewport, and /ws WebSocket on tenant EC2 instances.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:22:23 -07:00
Hongming Wang
f815d9a05c
Merge pull request #569 from Molecule-AI/docs/devrel-feat-550
docs(devrel): Google ADK runtime tutorial (feat #550)
2026-04-16 18:17:33 -07:00
molecule-ai[bot]
b1c976a54d
fix(github): refresh installation token when TTL < 10 min (#547) (#567)
Root cause: the github-app-auth plugin injects GH_TOKEN + GITHUB_TOKEN
into each workspace container's env at provision time (EnvMutator). Those
are GitHub App installation tokens with a fixed ~60 min TTL. The plugin
has an in-process cache that proactively refreshes 5 min before expiry —
but the workspace env is set once at container start and never updated.
Any workspace alive >60 min ends up with an expired token.

Fix (Option B — on-demand endpoint):

pkg/provisionhook:
  - Add TokenProvider interface: Token(ctx) (token, expiresAt, error)
    Lives in pkg/ (public) so the github-app-auth plugin can implement it.
  - Add Registry.FirstTokenProvider() — discovers the first mutator that
    also satisfies TokenProvider via interface assertion. Safe under
    concurrent reads (existing RWMutex).

platform/internal/handlers/github_token.go:
  - New GitHubTokenHandler serving GET /admin/github-installation-token
  - Delegates to the registered TokenProvider (plugin cache — always fresh)
  - 404 if no GitHub App configured, 500 + [github] prefix log on error
  - Never logs the token itself

platform/internal/handlers/workspace.go:
  - Add TokenRegistry() getter so the router can wire the handler without
    coupling to WorkspaceHandler internals

platform/internal/router/router.go:
  - Register GET /admin/github-installation-token under AdminAuth

workspace-template/:
  - scripts/molecule-git-token-helper.sh — git credential helper; calls
    the platform endpoint on every push/fetch; falls through to next
    helper (operator PAT) if platform unreachable
  - entrypoint.sh — configure the credential helper at startup

Why Option B over Option A (background goroutine):
  - The plugin already has its own cache refresh; nothing to refresh here.
  - Pushing env updates into running containers requires docker exec, which
    the architecture explicitly rejects (issue #547 "Alternatives").
  - Pull-based is stateless, trivially testable, zero extra goroutines.

Closes #547

Co-authored-by: Molecule AI DevOps Engineer <devops-engineer@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:47:03 +00:00
molecule-ai[bot]
d08f237de9
fix(platform): reject self-delegation to prevent _run_lock deadlock (#570)
When a workspace delegated a task to itself, it would acquire
_run_lock twice on the same goroutine mutex, blocking permanently.

Add an early-return guard in `DelegationHandler.Delegate` that
returns HTTP 400 {"error": "self-delegation not permitted"} as soon
as sourceID == body.TargetID, before any DB or A2A work is done.

Adds TestDelegate_SelfDelegation_Rejected to delegation_test.go.

Closes #548

Co-authored-by: Molecule AI Backend Engineer <backend-engineer@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:46:20 +00:00
molecule-ai[bot]
a360b64157
fix(platform): persist secrets envelope from POST /workspaces payload (#568)
`CreateWorkspacePayload` was missing a `Secrets` field, so any
`secrets: { KEY: value }` included in a POST /workspaces body was
silently dropped by ShouldBindJSON.

Changes:
- Add `Secrets map[string]string` field to `CreateWorkspacePayload`
- Wrap workspace INSERT in a DB transaction; iterate over secrets,
  encrypt each value via `crypto.Encrypt`, and upsert into
  `workspace_secrets` within the same tx — rollback both on any failure
- Add `mock.ExpectBegin()`/`mock.ExpectCommit()`/`mock.ExpectRollback()`
  to all existing Create tests that were missing transaction expectations
- Add 3 new tests: WithSecrets_Persists, SecretPersistFails_RollsBack,
  EmptySecrets_OK

Closes #545

Co-authored-by: Molecule AI Backend Engineer <backend-engineer@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:46:17 +00:00
molecule-ai[bot]
692747887f
docs(competitors): downgrade Paperclip threat HIGH → MEDIUM (#581)
Deep-dive #571 (Competitive Intelligence, 2026-04-17) confirmed Paperclip
has no A2A protocol, no visual canvas, and no org-chart UI on roadmap.
Blocker dependencies are a single-process task-graph DAG, not inter-agent
coordination. Execution policies are budget ceilings only. The sole
capability gap vs Molecule AI is per-workspace budget limits (tracked #541).
Brand/framing threat ("zero-human companies") but not a technical substitute.

- docs/ecosystem-watch.md: threat_level high → medium, notable_changes
  updated with deep-dive conclusion
- docs/marketing/competitors.md: move Paperclip row from HIGH to MEDIUM
  table; update Watchlist escalation levels; add recently-changed entry

Closes #571

Co-authored-by: Molecule AI Research Lead <research-lead@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:45:53 +00:00
Molecule AI Backend Engineer
41ff4b6f42 fix(brand-monitor): patch CVE-2024-47081 in requests, escape mrkdwn in Slack digest
CVE-2024-47081: upgrade requests 2.32.3 → 2.33.1 (netrc credential leak).

Slack mrkdwn injection: post_digest() embedded raw tweet text into a
mrkdwn link label (<url|snippet>) without escaping, allowing a malicious
tweet containing <!channel> or a phishing <url|label> to inject verbatim.
Fix: add _escape_mrkdwn() helper (& → &amp;, < → &lt;, > → &gt;) and
apply to the snippet in post_digest(). post_mentions() was already safe
via _format_tweet_block(). New test: test_post_digest_mrkdwn_escaping_in_snippet.

65 tests, 100% coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:41:38 +00:00
molecule-ai[bot]
c0e960a303
docs(devrel): Fly Machines provisioner tutorial (feat #501, closes #525) 2026-04-17 00:40:46 +00:00
molecule-ai[bot]
d9750095a8
docs(eco-watch): add structured competitor snapshot for PMM cron (#559)
* chore(eco-watch): 2026-04-16 daily survey — OpenAI Sandbox Agents, Tencent AI-Infra-Guard, VoltAgent

Adds three new ecosystem-watch entries:

- OpenAI Agents SDK v0.14 Sandbox Agents (released April 15 2026): SandboxAgent
  with persistent isolated workspaces, snapshot/resume, and sandbox memory across
  7 hosted backends. Directly competes with our workspace lifecycle model.

- Tencent AI-Infra-Guard: MCP server scanning, skills scanning, and agent audit
  platform (3.5k stars, Tencent Zhuque Lab). Enterprise security audits will
  touch our plugin manifests and MCP server surface.

- VoltAgent: TypeScript agent framework + VoltOps Console (8.2k stars, 668 releases).
  Closest Canvas analogue in the TS ecosystem; supervisor/sub-agent coordination
  mirrors our PM delegation chain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(eco-watch): add structured competitor snapshot for PMM cron (#537)

Add a machine-readable `## Competitor Snapshot` YAML block to
docs/ecosystem-watch.md so the PMM cron has stable, diff-able fields
(name, slug, date, version, stars, threat_level, notable_changes,
source_url) to parse and detect competitor moves each tick.

Also bootstrap docs/marketing/competitors.md — the PMM cron output
file that was missing, causing every cron run to be a silent no-op.

34 competitors across three threat tiers (HIGH/MEDIUM/LOW). Data
verified by Technical Researcher (version check), Market Analyst
(threat matrix), and Competitive Intelligence (source URLs + notable
changes) as of 2026-04-17.

Key findings incorporated from analyst run:
- Paperclip v2026.416.0 shipped Apr 16 (HIGH — newest escalation)
- Hermes v0.10.0 Tool Gateway launched Apr 16
- Google ADK updated to v1.30.0 (was v1.29.0 in narrative)
- OpenHands actually at v1.6.0 (file showed stale v0.39.0)
- Microsoft Agent Framework upgraded to HIGH (1.0 GA, enterprise dist.)
- Flowise downgraded to LOW (Workday acquisition narrows market)
- Dify corrected to v1.13.3 stable (v1.14.0 was RC-only)

Closes #537

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Molecule AI Research Lead <research-lead@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:38:39 +00:00
molecule-ai[bot]
84c92e561f
docs(blog): deploy anywhere — Fly Machines + control plane provisioners
Closes #561
2026-04-17 00:38:06 +00:00
molecule-ai[bot]
b37f71b6da
fix(canvas): hydration error UI (#554), radio arrow-key nav (#556), zoom-to-team context menu (#557) (#565)
- #554 CRITICAL: Add hydrationError state to Zustand store; catch handler now
  calls setHydrationError instead of silent console.error; page renders a
  full-screen zinc-950 error banner with a Retry button that reloads the page
- #556 MEDIUM: Add roving tabIndex + ArrowDown/Up/Left/Right keyboard handler
  to the tier radio group in CreateWorkspaceDialog (WCAG 2.1 compliant)
- #557 MEDIUM: Add "Zoom to Team" menu item to ContextMenu (visible only when
  node has children); dispatches molecule:zoom-to-team for keyboard accessibility
- Bonus: add missing 'use client' directive to RevealToggle.tsx

Co-authored-by: Molecule AI Frontend Engineer <frontend-engineer@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:35:54 +00:00
molecule-ai[bot]
0aae3521ce
docs(devrel): Google ADK runtime tutorial (feat #550) 2026-04-17 00:30:49 +00:00
Hongming Wang
15f55f2fb0
Merge pull request #550 from Molecule-AI/feat/issue-542-google-adk-adapter
feat(adapters): add google-adk runtime adapter
2026-04-16 17:22:15 -07:00
Hongming Wang
c5ac1bd6ab
Merge pull request #551 from Molecule-AI/fix/settings-hook-dedup
fix(scripts): dedup_settings_hooks + verify — fix 3-4x duplicate hook firings
2026-04-16 17:22:11 -07:00
molecule-ai[bot]
9d6f20f0dd
fix(devrel): correct capability table — tool_use/vision/streaming are Phase 2d (not yet shipped) 2026-04-17 00:21:02 +00:00
Molecule AI Backend Engineer
85db648da3 feat(brand-monitor): add X API pay-per-use brand monitor with surge mode
Adds brand-monitor/ — a cron-based X API v2 poller that posts new Molecule AI
brand mentions to Slack #brand-monitoring.  Surge mode enables 15-min polling
for launch days / crisis windows; state persisted in .surge_state.json so
restarts within an active window continue in surge mode.

Closes #549

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:19:06 +00:00
molecule-ai[bot]
0d38d05d6f
docs(devrel): Hermes multi-provider dispatch tutorial (Phase 2a/2b/2c, issue #513) 2026-04-17 00:12:52 +00:00
b69e50d98c fix(scripts): add dedup_settings_hooks + verify utilities
molecule_runtime's _deep_merge_hooks() uses unconditional list.extend()
when merging plugin settings-fragment.json files. On every plugin install
or reinstall each hook handler is re-appended, causing 3-4x duplicate
firings per event.

scripts/dedup_settings_hooks.py — idempotent live fix (reads via
/proc/*/root, no docker CLI required). Safe to re-run.
scripts/verify_settings_hooks.py — exits 1 if any container still has
duplicate hooks; used in CI health checks and manual audits.

Upstream fix needed in molecule_runtime._deep_merge_hooks() to
deduplicate by (matcher, frozenset(commands)) before writing. Track
separately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:12:07 +00:00
Molecule AI Backend Engineer
dbcea7f191 feat(adapters): add Google ADK runtime adapter (#542)
Implements WorkspaceAdapter for Google's Agent Development Kit (google-adk
v1.x, Apache-2.0). Ships four files under workspace-template/adapters/google-adk/:

- adapter.py — GoogleADKAdapter + GoogleADKA2AExecutor (100% test coverage)
- requirements.txt — pinned google-adk==1.30.0 + google-genai>=1.16.0
- README.md — overview, install, usage, config, architecture diagram
- test_adapter.py — 46 unit tests, all passing, no live API calls

Supports AI Studio (GOOGLE_API_KEY) and Vertex AI (GOOGLE_GENAI_USE_VERTEXAI=1).
Model prefix stripping: "google:gemini-2.0-flash" → "gemini-2.0-flash".
Error sanitization mirrors the hermes_executor convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:08:17 +00:00
Hongming Wang
4f0da825ed
Merge pull request #546 from Molecule-AI/fix/restore-cp-provisioner
fix: restore CP provisioner for EC2 workspace deployment
2026-04-16 14:26:04 -07:00
Hongming Wang
737dd1999b fix: restore cp_provisioner.go updated for EC2 backend
The CP provisioner calls POST /cp/workspaces/provision which now
creates EC2 instances (not Fly Machines). The tenant platform
auto-activates this when MOLECULE_ORG_ID is set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 14:25:43 -07:00
Hongming Wang
347245bdd5
Merge pull request #536 from Molecule-AI/feat/issue-496-hermes-reasoning
feat(hermes): HermesA2AExecutor — native reasoning for Hermes 4 via OpenAI-compat API (#496)
2026-04-16 14:15:16 -07:00
Hongming Wang
5caefc5909
Merge pull request #532 from Molecule-AI/fix/issue-450-csp-nonce
fix(canvas): nonce-based CSP replaces unsafe-inline/unsafe-eval in production
2026-04-16 14:15:12 -07:00
Hongming Wang
21fa78689d
Merge pull request #543 from Molecule-AI/chore/eco-watch-2026-04-16
chore(docs): eco-watch 2026-04-16 — Paperclip, Google ADK, Chrome DevTools MCP
2026-04-16 14:04:51 -07:00
Hongming Wang
8789bfef53
Merge pull request #538 from Molecule-AI/devrel/gemini-cli-demo
devrel: gemini-cli runtime adapter demo (closes #534)
2026-04-16 14:04:47 -07:00
molecule-ai[bot]
0324984789
docs: brand discoverability audit — Molecule AI SERP pollution (2026-04-16) 2026-04-16 20:46:46 +00:00
Hongming Wang
b8a1503363
Merge pull request #528 from Molecule-AI/fix/issue-450-csp-api-strict
fix(middleware): strict CSP on API routes, permissive for canvas (#450)
2026-04-16 13:46:20 -07:00
molecule-ai[bot]
1b73307e15
Merge pull request #531 from Molecule-AI/docs/devrel-feat-480
docs(devrel): Lark / Feishu channel adapter tutorial (feat #480)
2026-04-16 20:46:19 +00:00
Hongming Wang
1c20892671
Merge pull request #527 from Molecule-AI/feat/issue-493-hermes-provider-picker
feat(canvas): Hermes provider picker + API key field in CreateWorkspaceDialog
2026-04-16 13:46:16 -07:00
Hongming Wang
c54379586b
Merge pull request #509 from Molecule-AI/docs/devrel-feat-379
docs(devrel): gemini-cli runtime tutorial (feat #379)
2026-04-16 13:46:13 -07:00
Molecule AI Research Lead
65dc334225 docs(ecosystem-watch): add Paperclip, Google ADK, Chrome DevTools MCP entries (2026-04-16)
Three new entries from today's eco-watch scan:

- paperclipai/paperclip (~54.8k ): hierarchical CEO/manager/worker multi-agent
  orchestration with budget constraints and audit trails. Highest-star agent-
  orchestration OSS project tracked; direct conceptual competitor to our "AI company"
  thesis. Signals: watch for persistent memory and visual org chart additions.

- google/adk-python (~19k , v1.29.0): Google's official multi-agent SDK. Pairs with
  Gemini CLI (already tracked) to form Google's full agent stack. Evaluation teams will
  weigh ADK + Gemini CLI vs Molecule AI. Spawns issue #542 (google-adk adapter).

- ChromeDevTools/chrome-devtools-mcp (~35.5k ): official ChromeDevTools MCP server,
  23 tools, already the de facto standard for browser tool use across 29 MCP clients.
  Replaces our bespoke Puppeteer/CDP integration with a standard skill install.
  Spawns issue #540 (browser-automation plugin migration).

GH issues filed: #540 (browser-automation), #541 (budget_limit), #542 (google-adk adapter)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 20:45:15 +00:00
molecule-ai[bot]
feb412852f
devrel: gemini-cli demo README walkthrough (issue #534) 2026-04-16 20:43:22 +00:00
molecule-ai[bot]
04f4ae9b72
devrel: Makefile for gemini-cli demo (issue #534) 2026-04-16 20:42:35 +00:00
molecule-ai[bot]
1e4c125959
devrel: gemini-cli demo script (issue #534) 2026-04-16 20:42:33 +00:00