Commit Graph

23524 Commits

Author SHA1 Message Date
khhjoe 5f628c0bf8 build: copy acpx mcp-proxy.mjs to dist in runtime-postbuild 2026-03-30 05:09:59 +09:00
khhjoe 415899984e feat(mcp): add plugin tools MCP server for ACP sessions
Standalone MCP server that exposes OpenClaw plugin-registered tools
(e.g. memory-lancedb's memory_recall, memory_store, memory_forget)
to ACP sessions running Claude Code via acpx's MCP proxy mechanism.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 05:09:59 +09:00
Peter Steinberger 3f5ed11266
fix: clear stalled model resolution lanes 2026-03-30 05:09:26 +09:00
Gustavo Madeira Santana 9b4f26e70a
Plugins/CLI: add descriptor-backed lazy root command registration (#57165)
Merged via squash.

Prepared head SHA: ad1dee32eb
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-03-29 16:02:59 -04:00
Peter Steinberger d330782ed1
fix(matrix): stop discovering runtime helper as plugin entry 2026-03-29 21:00:57 +01:00
Gustavo Madeira Santana dc192d7b2f
Build: mirror Matrix crypto WASM runtime deps (#57163)
Merged via squash.

Prepared head SHA: b3aeb9d08a
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-03-29 15:57:28 -04:00
Peter Steinberger 82f04ced27
refactor(plugin-sdk): drop legacy provider compat subpaths 2026-03-29 20:55:53 +01:00
Peter Steinberger cce6d3bbb7
fix: resolve CI type and lint regressions 2026-03-30 04:51:33 +09:00
Peter Steinberger 855878b4f0
fix: stabilize serial test suite 2026-03-30 04:46:04 +09:00
George Zhang b787669340 docs(plugins): add before_install payload example 2026-03-29 12:35:01 -07:00
George Zhang 2607191d04 refactor(plugins): centralize before_install context shaping 2026-03-29 12:35:01 -07:00
George Zhang 9a07fd83fb docs(plugins): describe before_install policy foundation 2026-03-29 12:35:01 -07:00
George Zhang b5d48d311c test(plugins): cover before_install policy metadata 2026-03-29 12:35:01 -07:00
George Zhang 150faba8d1 plugins: enrich before_install policy context 2026-03-29 12:35:01 -07:00
George Zhang 9ea0b76f06 docs(plugins): document before_install hook 2026-03-29 12:35:01 -07:00
George Zhang ac3951d731 test(plugins): cover before_install install flows 2026-03-29 12:35:01 -07:00
George Zhang 7cd9957f62 plugins: add before_install hook for install scanners 2026-03-29 12:35:01 -07:00
Robin Waslander 77555d6c85
fix(infra): classify SQLite transient errors as non-fatal in unhandled rejection handler (#57018)
Add isTransientSqliteError() covering SQLITE_CANTOPEN, SQLITE_BUSY,
SQLITE_LOCKED, and SQLITE_IOERR via named codes, numeric errcodes
(node:sqlite), and message-string fallback. Combine with existing
network transient check so both families are treated as non-fatal
in the global unhandled rejection handler.

Prevents crash loop under launchd on macOS when SQLite files are
temporarily unavailable.

Fixes #34678
2026-03-29 21:29:38 +02:00
Peter Steinberger bfb0907777 fix: harden MCP SSE config redaction (#50396) (thanks @dhananjai1729) 2026-03-30 04:23:47 +09:00
dhananjai1729 2c6eb127d9 fix: redact sensitive query params in invalid URL error reasons
Extends the invalid-URL redaction to also scrub sensitive query parameters
(token, api_key, secret, access_token, etc.) using the same param list as
the valid-URL description path. Adds tests for both query param and
credential redaction in error reasons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 04:23:47 +09:00
dhananjai1729 4e03d899b3 fix: handle Headers instances in SSE fetch and redact invalid URLs
- Properly convert Headers instances to plain objects in eventSourceInit.fetch
  so SDK-generated headers (e.g. Accept: text/event-stream) are preserved
  while user-configured headers still take precedence.
- Redact potential credentials from invalid URLs in error reasons to prevent
  secret leakage in log output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 04:23:47 +09:00
dhananjai1729 62d0e12155 fix(mcp): user headers override SDK defaults & expand redaction list
Address Greptile P1/P2 review feedback:
- Fix header spread order so user-configured auth headers take precedence
  over SDK-internal headers in SSE eventSourceInit.fetch
- Add password, pass, auth, client_secret, refresh_token to the
  sensitive query-param redaction set in describeSseMcpServerLaunchConfig
- Add tests for redaction of all sensitive params and embedded credentials

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 04:23:47 +09:00
dhananjai1729 32b7c00f90 fix: apply SSE auth headers to initial GET, redact URL credentials, warn on malformed headers 2026-03-30 04:23:47 +09:00
dhananjai1729 6fda8b4e9a fix: use SDK Transport type to satisfy client.connect() signature 2026-03-30 04:23:47 +09:00
dhananjai1729 bf8303370e fix: address review feedback - fix env JSDoc, warn on dropped headers, await server close 2026-03-30 04:23:47 +09:00
dhananjai1729 d89bfed5cc feat(mcp): add SSE transport support for remote MCP servers 2026-03-30 04:23:47 +09:00
Peter Steinberger fc5fdcb091
refactor(plugin-sdk): remove bundled provider setup shims 2026-03-29 20:23:20 +01:00
George Zhang e133924047
[codex] harden clawhub plugin publishing and install (#56870)
* fix: harden clawhub plugin publishing and install

* fix(process): preserve windows shim exit success
2026-03-29 11:59:19 -07:00
Peter Steinberger 58dde4b016
test(contracts): hoist shared plugin mock ids 2026-03-29 19:54:27 +01:00
Marcus Castro 34648235a3
WhatsApp: use shared resolveReactionMessageId for context-aware reactions (#57226)
Wire the shared resolveReactionMessageId helper into the WhatsApp
channel adapter, matching the pattern already used by Telegram, Signal,
and Discord. The model can now react to the current inbound message
without explicitly providing a messageId.

Safety guards:
- Only falls back to context when the source is WhatsApp
- Suppresses fallback when targeting a different chat (normalized comparison)
- Throws ToolInputError (400) instead of plain Error (500) when messageId
  is missing, preserving gateway error mapping
2026-03-29 15:42:19 -03:00
Nimrod Gutman f38b7291f9
fix(ios): mark activitykit import as preconcurrency (#57180)
* fix(ios): mark activitykit import as preconcurrency

* fix: note iOS ActivityKit preconcurrency build fix (#57180) (thanks @ngutman)
2026-03-29 21:24:25 +03:00
Peter Steinberger 5801506ce7
test(discord): fix hoisted configured-binding mocks 2026-03-29 19:17:08 +01:00
Peter Steinberger 8a6d1b9f1e
test(contracts): avoid sync telegram vitest harness loads 2026-03-29 18:37:11 +01:00
Tyler Yust 798e5f9501 plugin-sdk: fix provider setup import cycles 2026-03-29 09:59:52 -07:00
Peter Steinberger 56640a6725
fix(plugin-sdk): break vllm setup recursion 2026-03-29 17:55:09 +01:00
Keith Elliott 2d2e386b94
fix(matrix): resolve crypto bootstrap failure and multi-extension idHint warning (#53298)
Merged via squash.

Prepared head SHA: 6f5813ffff
Co-authored-by: keithce <2086282+keithce@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-03-29 12:38:10 -04:00
Peter Steinberger ba7911bd16
ci: extend long-running test lane timeouts 2026-03-29 16:48:50 +01:00
Peter Steinberger 354bc01f29
ci: raise test workflow timeouts 2026-03-29 16:00:51 +01:00
Peter Steinberger 637b4c8193
refactor: move remaining provider policy into plugins 2026-03-29 23:05:58 +09:00
Peter Steinberger edc58a6864
refactor: generalize provider transport hooks 2026-03-29 23:05:58 +09:00
Peter Steinberger 8109195ad8
fix(plugin-sdk): avoid recursive bundled facade loads 2026-03-29 15:00:25 +01:00
Peter Steinberger 24d16c39ad
refactor(plugin-sdk): remove source alias residue 2026-03-29 14:53:03 +01:00
Peter Steinberger e6116769b4
build(plugin-sdk): verify dist facade exports 2026-03-29 14:53:03 +01:00
Peter Steinberger 2c9bc0bb78
chore(deps): bump workspace dependencies 2026-03-29 14:41:58 +01:00
Peter Steinberger 2dd29db464
fix: ease bundled browser plugin recovery 2026-03-29 22:39:30 +09:00
Peter Steinberger f1af7d66d2
chore: bump version to 2026.3.29 2026-03-29 14:33:12 +01:00
Thomas M 0a01386756
fix: canonicalize session keys at write time (#30654) (thanks @thomasxm)
* fix: canonicalize session keys at write time to prevent orphaned sessions (#29683)

resolveSessionKey() uses hardcoded DEFAULT_AGENT_ID="main", but all read
paths canonicalize via cfg. When the configured default agent differs
(e.g. "ops" with mainKey "work"), writes produce "agent:main:main" while
reads look up "agent:ops:work", orphaning transcripts on every restart.

Fix all three write-path call sites by wrapping with
canonicalizeMainSessionAlias:
- initSessionState (auto-reply/reply/session.ts)
- runWebHeartbeatOnce (web/auto-reply/heartbeat-runner.ts)
- resolveCronAgentSessionKey (cron/isolated-agent/session-key.ts)

Add startup migration (migrateOrphanedSessionKeys) to rename existing
orphaned keys to canonical form, merging by most-recent updatedAt.

* fix: address review — track agent IDs in migration map, align snapshot key

P1: migrateOrphanedSessionKeys now tracks agentId alongside each store
path in a Map instead of inferring from the filesystem path. This
correctly handles custom session.store templates outside the default
agents/<id>/ layout.

P2: Pass the already-canonicalized sessionKey to getSessionSnapshot so
the heartbeat snapshot reads/restores use the same key as the write path.

* fix: log migration results at all early return points

migrateOrphanedSessionKeys runs before detectLegacyStateMigrations, so
it can canonicalize legacy keys (e.g. "main" → "agent:main:main") before
the legacy detector sees them. This caused the early return path to skip
logging, breaking doctor-state-migrations tests that assert log.info was
called.

Extract logMigrationResults helper and call it at every return point.

* fix: handle shared stores and ~ expansion in migration

P1: When session.store has no {agentId}, all agents resolve to the same
file. Track all agentIds per store path (Map<path, Set<id>>) and run
canonicalization once per agent. Skip cross-agent "agent:main:*"
remapping when "main" is a legitimate configured agent sharing the store,
to avoid merging its data into another agent's namespace.

P2: Use expandHomePrefix (environment-aware ~ resolution) instead of
os.homedir() in resolveStorePathFromTemplate, matching the runtime
resolveStorePath behavior for OPENCLAW_HOME/HOME overrides.

* fix: narrow cross-agent remap to provable orphan aliases only

Only remap agent:main:* keys where the suffix is a main session alias
("main" or the configured mainKey). Other agent:main:* keys — hooks,
subagents, cron sessions, per-sender keys — may be intentional
cross-agent references and must not be silently moved into another
agent's namespace.

* fix: run orphan-key session migration at gateway startup (#29683)

* fix: canonicalize cross-agent legacy main aliases in session keys (#29683)

* fix: guard shared-store migration against cross-agent legacy alias remap (#29683)

* refactor: split session-key migration out of pr 30654

---------

Co-authored-by: Your Name <your_email@example.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-29 18:59:25 +05:30
Peter Steinberger e0f0a1aa1f
docs: clarify browser allowlist troubleshooting 2026-03-29 22:19:22 +09:00
wangchunyue 2c8c4e45f1
fix: preserve fallback prompt on model fallback for new sessions (#55632) (thanks @openperf)
* fix(agents): preserve original task prompt on model fallback for new sessions

* fix(agents): use dynamic transcript check for sessionHasHistory on fallback retry

Address Greptile review feedback: replace the static !isNewSession flag
with a dynamic sessionFileHasContent() check that reads the on-disk
transcript before each fallback retry. This correctly handles the edge
case where the primary model completes at least one assistant-response
turn (flushing the user message to disk) before failing - the fallback
now sends the recovery prompt instead of duplicating the original body.

The !isNewSession short-circuit is kept as a fast path so existing
sessions skip the file read entirely.

* fix(agents): address security vulnerabilities in session fallback logic

Fixes three medium-severity security issues identified by Aisle Security Analysis on PR #55632:
- CWE-400: Unbounded session transcript read in sessionFileHasContent()
- CWE-400: Symlink-following in sessionFileHasContent()
- CWE-201: Sensitive prompt replay to a different fallback provider

* fix(agents): use JSONL parsing for session history detection (CWE-703)

Replace bounded byte-prefix substring matching in sessionFileHasContent()
with line-by-line JSONL record parsing. The previous approach could miss
an assistant message when the preceding user content exceeded the 256KB
read limit, causing a false negative that blocks cross-provider fallback
entirely.

* fix(agents): preserve fallback prompt across providers

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-29 18:35:45 +05:30
wangchunyue fc3f6fa51f
fix: preserve node exec cwd on remote hosts (#50961) (thanks @openperf)
* fix(gateway): skip local workdir resolution for remote node execution

* chore: add inline comment for non-obvious node workdir skip

* fix: preserve node exec cwd on remote hosts (#50961) (thanks @openperf)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-29 17:46:49 +05:30