Commit Graph

784 Commits

Author SHA1 Message Date
Peter Steinberger 52fb4a149a
refactor: share approval interactive renderers 2026-03-30 08:03:59 +09:00
Gustavo Madeira Santana e5dac0c39e
CLI: keep root help plugin descriptors non-activating (#57294)
Merged via squash.

Prepared head SHA: c8da48f689
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 18:49:57 -04:00
Peter Steinberger 1efef8205c
fix: stabilize extensions surface test gate 2026-03-30 07:47:58 +09:00
Peter Steinberger 8861cdbb6f
refactor(plugin-sdk): untangle extension test seams 2026-03-29 23:43:53 +01:00
Peter Steinberger 69eea2cb80
refactor: split approval auth delivery and rendering 2026-03-30 07:36:18 +09:00
Peter Steinberger f8dc4305a5
refactor: share native approval delivery helpers 2026-03-30 07:16:33 +09:00
Peter Steinberger e01ca8cfc6
refactor(plugin-sdk): remove direct extension source leaks 2026-03-29 23:11:20 +01:00
Peter Steinberger 2e0682d930
refactor: finish decoupling plugin sdk seams 2026-03-29 22:42:06 +01:00
Peter Steinberger 216afe275e
test: harden packed manifest guardrails 2026-03-29 22:21:29 +01:00
Peter Steinberger aed87a608e
fix: stabilize bundled plugin ci lanes 2026-03-30 05:35:53 +09:00
Peter Steinberger 35233bae96
refactor: decouple bundled plugin sdk surfaces 2026-03-29 21:20:46 +01:00
Peter Steinberger 3f5ed11266
fix: clear stalled model resolution lanes 2026-03-30 05:09:26 +09: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 855878b4f0
fix: stabilize serial test suite 2026-03-30 04:46:04 +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
Tyler Yust 798e5f9501 plugin-sdk: fix provider setup import cycles 2026-03-29 09:59:52 -07: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
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 270d0c5158
fix: avoid telegram plugin self-recursive sdk imports 2026-03-29 11:32:29 +01:00
Peter Steinberger 8e0ab35b0e
refactor(plugins): decouple bundled plugin runtime loading 2026-03-29 09:10:38 +01:00
Peter Steinberger 04c976b43d
refactor(markdown): share render-aware chunking 2026-03-29 16:33:22 +09:00
Ayaan Zaidi 1791c7c304 fix: unify telegram exec approval auth 2026-03-29 10:45:57 +05:30
Subash Natarajan aee7992629 fix(telegram): accept approval callbacks from forwarding target recipients
When approvals.exec.targets routes to a Telegram DM, the recipient
receives inline approval buttons but may not have explicit
channels.telegram.execApprovals configured. This adds a fallback
isTelegramExecApprovalTargetRecipient check so those DM recipients
can act on the buttons they were sent.

Includes accountId scoping for multi-bot deployments and 9 new tests.
2026-03-29 10:45:57 +05:30
Peter Steinberger 148a65fe90 refactor: share webhook channel status helpers 2026-03-29 02:11:22 +01:00
Peter Steinberger 9e1b524a00 fix: break mattermost runtime cycle 2026-03-29 00:43:58 +00:00
Harold Hunt fcee6fa047
Docs: add boundary AGENTS guides (#56647) 2026-03-28 20:22:03 -04:00
Peter Steinberger 5872f860c9 feat(xai): add plugin-owned x_search onboarding 2026-03-29 00:12:37 +00:00
Peter Steinberger 887d7584d6 refactor(plugins): expose bundled onboard helpers 2026-03-28 21:35:13 +00:00
Ayaan Zaidi b31cd35b36
test(plugin-sdk): align matrix runtime api guardrail 2026-03-28 16:20:33 +05:30
Ayaan Zaidi 8ea5c22985
fix(matrix): avoid heavy jiti runtime barrels 2026-03-28 15:35:05 +05:30
Peter Steinberger a955537a61 fix: slim provider sdk surfaces 2026-03-28 09:35:42 +00:00
Ayaan Zaidi 40a09cc582
fix(irc): avoid registry bootstrap in plugin sdk seam 2026-03-28 14:58:02 +05:30
Kenny Xie cb5afdf108
fix: prevent matrix-js-sdk plugin load crash (#56273) (thanks @aquaright1)
* Fix matrix-js-sdk multiple entrypoint crash on plugin load

* test(matrix): cover runtime bundle import regression

* fix: prevent matrix-js-sdk plugin load crash (#56273) (thanks @aquaright1)

* fix: widen matrix-js-sdk bundle import guard (#56273) (thanks @aquaright1)

---------

Co-authored-by: Kenny Xie <kennyxie@Mac-mini-von-Kenny.local>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-28 14:27:54 +05:30
Peter Steinberger 30be04cd87 fix: include matrix runtime deps for bundled installs 2026-03-28 07:27:29 +00:00
Peter Steinberger 61936938e9 refactor: move test harnesses off infra runtime 2026-03-28 06:52:06 +00:00
Peter Steinberger c65ec46490 refactor: trim remaining infra runtime residue 2026-03-28 06:41:56 +00:00
Peter Steinberger 922c90e9fa refactor: add approval runtime sdk seam 2026-03-28 06:33:07 +00:00
Peter Steinberger 0d98ce1065 refactor: add diagnostic and error runtime sdk seams 2026-03-28 06:26:38 +00:00
Peter Steinberger 70c2458861 refactor: add host and collection runtime sdk seams 2026-03-28 06:19:16 +00:00
Peter Steinberger d042192c7c
refactor(plugins): move provider policy hooks into plugins 2026-03-28 06:11:13 +00:00
Peter Steinberger c222a44e6f refactor: add retry runtime sdk seam 2026-03-28 05:59:07 +00:00
Peter Steinberger 83135c31c9
refactor(acp): extract generic current conversation binding store 2026-03-28 05:53:07 +00:00
Peter Steinberger a126d23f0d refactor: add fetch runtime sdk seam 2026-03-28 05:44:33 +00:00
Peter Steinberger b236f39104
refactor(agents): generalize tool schema compat cleanup 2026-03-28 05:42:46 +00:00
Peter Steinberger c7883fe892
refactor(plugins): register provider model id hooks 2026-03-28 05:42:46 +00:00
Peter Steinberger 49f693d06a refactor: widen webhook request guard sdk seam 2026-03-28 05:28:10 +00:00