Commit Graph

805 Commits

Author SHA1 Message Date
Josh Lehman 3a87783632
test: avoid extra plugin-sdk guardrail analysis 2026-03-30 22:51:18 -07:00
Josh Avant 44674525f2
feat(tts): add structured provider diagnostics and fallback attempt analytics (#57954)
* feat(tts): add structured fallback diagnostics and attempt analytics

* docs(tts): document attempt-detail and provider error diagnostics

* TTS: harden fallback loops and share error helpers

* TTS: bound provider error-body reads

* tts: add double-prefix regression test and clean baseline drift

* tests(tts): satisfy error narrowing in double-prefix regression

* changelog

Signed-off-by: joshavant <830519+joshavant@users.noreply.github.com>

---------

Signed-off-by: joshavant <830519+joshavant@users.noreply.github.com>
2026-03-30 22:55:28 -05:00
Peter Steinberger 6b6ddcd2a6
test: speed up core runtime suites 2026-03-31 02:25:02 +01:00
Shakker 82695bb24d test: remove timeout-prone windows ci waits 2026-03-31 01:40:55 +01:00
Shakker da03d857f9 test: stabilize recurring windows ci suites 2026-03-31 01:40:55 +01:00
Shakker a8ba6f2c03 test: stabilize channel lifecycle timers in ci 2026-03-31 01:40:55 +01:00
scoootscooob 9ff57ac479
refactor(exec): unify channel approvals and restore routing/auth (#57838)
* fix(exec): add shared approval runtime

* fix(exec): harden shared approval runtime

* fix(exec): guard approval expiration callbacks

* fix(exec): handle approval runtime races

* fix(exec): clean up failed approval deliveries

* fix(exec): restore channel approval routing

* fix(exec): scope telegram legacy approval fallback

* refactor(exec): centralize native approval delivery

* fix(exec): harden approval auth and account routing

* test(exec): align telegram approval auth assertions

* fix(exec): align approval rebase followups

* fix(exec): clarify plugin approval not-found errors

* fix(exec): fall back to session-bound telegram accounts

* fix(exec): detect structured telegram approval misses

* test(exec): align discord approval auth coverage

* fix(exec): ignore discord dm origin channel routes

* fix(telegram): skip self-authored message echoes

* fix(exec): keep implicit approval auth non-explicit
2026-03-30 15:49:02 -07:00
Jacob Tomlinson cfe1445953
Sandbox: sanitize SSH subprocess env (#57848)
* Sandbox: sanitize SSH subprocess env

* Sandbox: add sanitize env undefined test
2026-03-30 20:05:57 +01:00
Ayaan Zaidi 2dced6b4a0
fix: allow setup-code bootstrap auth for operator pairing 2026-03-30 20:39:19 +05:30
Ayaan Zaidi 0b632dde8c fix: add facade recursion regression coverage (#57508) (thanks @openperf) 2026-03-30 13:48:21 +05:30
openperf 9a03fe8181 fix(facade-runtime): add recursion guard to facade module loader to prevent infinite stack overflow
Place a sentinel object in the loadedFacadeModules cache before the Jiti
sync load begins.  Re-entrant calls (caused by circular facade references
from constant exports evaluated at module-evaluation time) now receive the
sentinel instead of recursing infinitely.  Once the real module finishes
loading, Object.assign() back-fills the sentinel so any references
captured during the circular load phase see the final exports.

The Jiti load is wrapped in try/catch: on failure the sentinel is removed
from the cache so that subsequent retry attempts re-execute the load
instead of silently returning an empty object.  The function returns the
sentinel (not the raw loaded module) to guarantee a single object identity
for all callers, including those that captured a reference during the
circular load phase.

Also tightens the generic constraint from <T> to <T extends object> so
Object.assign() is type-safe, and propagates the constraint to the
test-utils callers in bundled-plugin-public-surface.ts.

Fixes #57394
2026-03-30 13:48:21 +05:30
Gustavo Madeira Santana 3efcc90034
Tests: read packed manifest without shell tar 2026-03-29 23:21:24 -04:00
Gustavo Madeira Santana e86a2183df
Tests: type package contract npm pack helper 2026-03-29 23:10:58 -04:00
Gustavo Madeira Santana e7984272a7
Tests: make package contract guardrails Windows-safe 2026-03-29 23:07:27 -04:00
Peter Steinberger fec51572a3
fix: stabilize gate and extension boundary checks 2026-03-30 02:37:36 +01:00
Peter Steinberger 9857d40923
fix(runtime): stabilize image generation auth/runtime loading 2026-03-30 01:14:29 +01:00
Peter Steinberger c2cbdea28c
refactor: add approval auth capabilities to more channels 2026-03-30 09:04:08 +09:00
Peter Steinberger 471e059b69
refactor(plugin-sdk): remove channel-specific sdk shims 2026-03-30 01:03:24 +01:00
Peter Steinberger 3b878e6b86
refactor: move approval auth and payload hooks to generic channel capabilities 2026-03-30 08:46:44 +09:00
Peter Steinberger 15c3aa82bf
refactor: unify approval forwarding and rendering 2026-03-30 08:28:33 +09:00
Peter Steinberger 8720070fe0
refactor: rename channel approval capabilities 2026-03-30 08:28:33 +09:00
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