Commit Graph

19184 Commits

Author SHA1 Message Date
Rai Butera 1192e3ccf9 test: harden sentinel edge cases (empty channel, leaked state, non-discord external)
Pre-empt edge case regressions flagged in review:
- empty string persistedLastChannel treated as absent (no mismatch risk)
- sentinel value leaked into persistedLastChannel returns undefined (corrupted state guard)
- non-discord external channels (telegram etc.) correctly preserve persistedLastTo
2026-03-15 22:25:51 +00:00
Rai Butera 5ba0b7d0e7 fix: avoid stale lastTo when channel resolves via session-key hint
Codex P1: resolveLastToRaw's inter-session sentinel was unconditionally
returning persistedLastTo. When resolveLastChannelRaw falls back to a
session-key hint (e.g. agent:navi:discord:direct:* → 'discord') because
persistedLastChannel is not yet external (e.g. still 'webchat'), blindly
returning persistedLastTo creates a mismatched lastChannel/lastTo pair
(discord channel + stale webchat target), causing subsequent 'last'
replies to be routed to an invalid destination.

Fix: mirror resolveLastChannelRaw's sentinel logic — only preserve
persistedLastTo when persistedLastChannel is already an external routing
channel (consistent pair). Return undefined otherwise so the caller
derives an appropriate target from the resolved channel.

Adds two new tests:
- 'returns undefined when channel resolves via session-key hint'
- 'preserves persistedLastTo when persisted channel is already external'

21/21 session-delivery tests, 19/19 sessions tests, 23/23 install tests.
2026-03-15 22:25:51 +00:00
Rai Butera a570b7d40c fix: extend sentinel reservation to registerChannel in registry
Codex P2: validatePluginId in install.ts only blocks the npm package
install path. A channel loaded via discovery/config can still call
registerChannel with id='inter_session', bypassing the guard.

- Move RESERVED_CHANNEL_IDS to message-channel.ts (canonical location
  for channel constants) and export it
- Import RESERVED_CHANNEL_IDS in both install.ts and registry.ts
- Add guard in registerChannel: push error diagnostic and return early
  if a plugin attempts to register a reserved channel ID

All three reservation paths are now covered:
  1. Package install (validatePluginId in install.ts)
  2. Runtime channel registration (registerChannel in registry.ts)
  3. isInterSessionChannel deliverability guard (existing)

60/60 tests green.
2026-03-15 22:25:51 +00:00
Rai Butera 8fc4eff1af fix: reserve inter_session and webchat as plugin ids
Codex P2: a plugin named 'inter_session' would make
isInterSessionChannel return false (deliverable guard), silently
disabling the sentinel routing path in sessions_send.

Add RESERVED_CHANNEL_IDS set to validatePluginId() covering both
INTER_SESSION_CHANNEL and INTERNAL_MESSAGE_CHANNEL. Any attempt to
install a channel plugin with those ids now returns a clear error.

Adds regression test covering both sentinel ids.
2026-03-15 22:25:51 +00:00
Rai Butera e35a2041fb refactor(sessions): address Greptile dead-variable and Codex P2 plugin-collision concerns
Greptile: originatingChannel was computed before the isInterSessionChannel guard
but never used inside it, wasting a normalizeMessageChannel call on the fast path.
Moved the declaration to after the guard where it is actually needed.

Codex P2: isInterSessionChannel had no protection against a real deliverable plugin
channel named 'inter_session'. Added isDeliverableMessageChannel check so that if a
plugin registers that id, the sentinel path is skipped and normal routing applies.

Test: added invariant test documenting the Codex P2 guard (19 tests green).
2026-03-15 22:25:51 +00:00
Rai Butera 45981e0e82 fix(sessions): use INTER_SESSION_CHANNEL sentinel in sessions_send to preserve receiver's external route
Codex P2 on #43353: threading agentChannel alone without paired to/accountId/threadId
causes resolveLastToRaw to fall back to a stale persistedLastTo, producing mismatched
channel+to state (e.g. channel=discord but routing to an old Telegram destination).

Instead, use a new INTER_SESSION_CHANNEL ("inter_session") sentinel. Both
resolveLastChannelRaw and resolveLastToRaw handle it explicitly:

- resolveLastChannelRaw: returns the persisted external channel (or session-key hint)
  without injecting the sender's channel or flipping to webchat
- resolveLastToRaw: returns persistedLastTo, preserving the receiver's destination

The sender's agentChannel is still captured in inputProvenance.sourceChannel for
observability but is no longer used to mutate the receiver's routing state.

Tests:
- sessions.test.ts: updated two agentChannel-threading tests to assert inter_session
  sentinel is used (not webchat, not sender channel)
- session-delivery.test.ts: 6 new tests covering INTER_SESSION_CHANNEL routing cases
  including the original webchat-flip regression and the stale-to preservation

Fixes https://github.com/openclaw/openclaw/issues/43318
2026-03-15 22:25:51 +00:00
Rai Butera cb878abad1 test(sessions): verify agentChannel threads through sessions_send to agent gateway call
Add two regression tests for #43318:
- asserts that when agentChannel is provided, the 'agent' gateway call
  receives that channel (not 'webchat') in sendParams
- asserts that when agentChannel is absent, channel falls back to webchat
  (preserving existing behaviour for internal spawns)

Closes #43318
2026-03-15 22:25:51 +00:00
Rai Butera 61d9fb3190 fix(sessions): thread agentChannel through sessions_send instead of hardcoding INTERNAL_MESSAGE_CHANNEL
When sessions_send injects a message into a target session, it was
hardcoding channel: INTERNAL_MESSAGE_CHANNEL ('webchat'). For main
sessions with an active external channel route (Discord, Telegram etc),
this caused resolveLastChannelRaw to flip lastChannel to 'webchat' for
that turn, silently routing the agent's reply to the control UI instead
of the user's channel.

Fix: pass opts?.agentChannel ?? INTERNAL_MESSAGE_CHANNEL so external-
originated A2A sends carry the correct source channel through. Falls
back to INTERNAL_MESSAGE_CHANNEL for internal spawns with no agentChannel.

Fixes: openclaw/openclaw#43318
2026-03-15 22:25:51 +00:00
Peter Steinberger 392ddb56e2
build(plugins): add bundled provider plugin manifests 2026-03-15 15:18:32 -07:00
Peter Steinberger 4a0f72866b
feat(plugins): move provider runtimes into bundled plugins 2026-03-15 15:18:32 -07:00
Gustavo Madeira Santana 14137bef22
Plugins: clean stale bundled skill outputs 2026-03-15 21:48:09 +00:00
Gustavo Madeira Santana 50a6902a9a
Plugins: skip nested node_modules in bundled skills 2026-03-15 21:43:13 +00:00
Gustavo Madeira Santana 1839bc0b1a
Plugins: relocate bundled skill assets 2026-03-15 21:42:02 +00:00
Vincent Koc b810e94a17
Commands: lazy-load non-interactive plugin provider runtime (#47593)
* Commands: lazy-load non-interactive plugin provider runtime

* Tests: cover non-interactive plugin provider ordering

* Update src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.runtime.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-15 14:37:41 -07:00
Nimrod Gutman 50c8934231
fix(dev): align gateway watch with tsdown wrapper (#47636) 2026-03-15 23:28:57 +02:00
Vincent Koc 5a7aba94a2
CLI: support package-manager installs from GitHub main (#47630)
* CLI: resolve package-manager main install specs

* CLI: skip registry resolution for raw package specs

* CLI: support main package target updates

* CLI: document package update specs in help

* Tests: cover package install spec resolution

* Tests: cover npm main-package updates

* Tests: cover update --tag main

* Installer: support main package targets

* Installer: support main package targets on Windows

* Docs: document package-manager main updates

* Docs: document installer main targets

* Docs: document npm and pnpm main installs

* Docs: document update --tag main

* Changelog: note package-manager main installs

* Update src/infra/update-global.test.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-15 14:18:12 -07:00
Vincent Koc 3735156766
fix(ci): restore config baseline release-check output (#47629)
* Docs: regenerate config baseline

* Chore: ignore generated config baseline

* Update .prettierignore

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-15 14:14:30 -07:00
Nimrod Gutman 47fd8558cd
fix(plugins): fix bundled plugin roots and skill assets (#47601)
* fix(acpx): resolve bundled plugin root correctly

* fix(plugins): copy bundled plugin skill assets

* fix(plugins): tolerate missing bundled skill paths
2026-03-15 23:00:30 +02:00
Vincent Koc 7931f06c00 Plugins: harden context engine ownership 2026-03-15 13:51:15 -07:00
Gustavo Madeira Santana 4fb0160309
Gateway: sync runtime post-build artifacts 2026-03-15 20:44:15 +00:00
Vincent Koc b795ba1d02 Merge branch 'main' of https://github.com/openclaw/openclaw
* 'main' of https://github.com/openclaw/openclaw:
  Plugins: reserve context engine ownership (#47595)
  fix(release): block oversized npm packs that regress low-memory startup (#46850)
  Scripts: rebuild on extension and tsdown config changes (#47571)
  Docs: move release runbook to maintainer repo (#47532)
  docs(zalo): document current Marketplace bot behavior (openclaw#47552)
2026-03-15 13:42:21 -07:00
Vincent Koc 85dd0ab2f8
Plugins: reserve context engine ownership (#47595)
* Plugins: reserve context engine ownership

* Update src/context-engine/registry.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-15 13:33:37 -07:00
Ted Li 07f890fa45
fix(release): block oversized npm packs that regress low-memory startup (#46850)
* fix(release): guard npm pack size regressions

* fix(release): fail closed when npm omits pack size
2026-03-15 21:31:30 +01:00
Gustavo Madeira Santana 594920f8cc
Scripts: rebuild on extension and tsdown config changes (#47571)
Merged via squash.

Prepared head SHA: edd8ed8254
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-15 16:19:27 -04:00
Onur Solmaz a2080421a1
Docs: move release runbook to maintainer repo (#47532)
* Docs: redact private release setup

* Docs: tighten release order

* Docs: move release runbook to maintainer repo

* Docs: delete public mac release page

* Docs: remove zh-CN mac release page

* Docs: turn release checklist into release policy

* Docs: point release policy to private docs

* Docs: regenerate zh-CN release policy pages

* Docs: preserve Doctor in zh-CN hubs

* Docs: fix zh-CN polls label

* Docs: tighten docs i18n term guardrails

* Docs: enforce zh-CN glossary coverage
2026-03-15 20:42:39 +01:00
Tomáš Dinh 4a7fbe090a
docs(zalo): document current Marketplace bot behavior (openclaw#47552)
Verified:
- pnpm check:docs

Co-authored-by: Tomáš Dinh <82420070+No898@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-03-15 14:40:35 -05:00
Vincent Koc 51631e5797 Plugins: reserve context engine ownership 2026-03-15 12:27:29 -07:00
peizhe.chen 42837a04bf
fix(models): preserve stream usage compat opt-ins (#45733)
Preserves explicit `supportsUsageInStreaming` overrides from built-in provider
catalogs and user config instead of unconditionally forcing `false` on non-native
openai-completions endpoints.

Adds `applyNativeStreamingUsageCompat()` to set `supportsUsageInStreaming: true`
on ModelStudio (DashScope) and Moonshot models at config build time so their
native streaming usage works out of the box.

Closes #46142

Co-authored-by: pezy <peizhe.chen@vbot.cn>
2026-03-15 20:21:11 +01:00
Nimrod Gutman e2dac5d5cb
fix(plugins): load bundled extensions from dist (#47560) 2026-03-15 21:16:27 +02:00
xiaoyi bbb0c3e5d7
CLI/completion: fix generator OOM and harden plugin registries (#45537)
* fix: avoid OOM during completion script generation

* CLI/completion: fix PowerShell nested command paths

* CLI/completion: cover generated shell scripts

* Changelog: note completion generator follow-up

* Plugins: reserve shared registry names

---------

Co-authored-by: Xiaoyi <xiaoyi@example.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-03-15 12:14:30 -07:00
Vincent Koc dd2eb29038
Commands: split static onboard auth choice help (#47545)
* Commands: split static onboard auth choice help

* Tests: cover static onboard auth choice help

* Changelog: note static onboard auth choice help
2026-03-15 12:11:55 -07:00
Vincent Koc c9a8b6f82f chore(fmt): format changes and broken types 2026-03-15 12:03:35 -07:00
Vincent Koc 438991b6a4
Commands: lazy-load model picker provider runtime (#47536)
* Commands: lazy-load model picker provider runtime

* Tests: cover model picker runtime boundary
2026-03-15 10:54:46 -07:00
Vincent Koc 630958749c
Changelog: note CLI OOM startup fixes (#47525) 2026-03-15 10:54:21 -07:00
Vincent Koc fc2d29ea92
Gateway: tighten forwarded client and pairing guards (#46800)
* Gateway: tighten forwarded client and pairing guards

* Gateway: make device approval scope checks atomic

* Gateway: preserve device approval baseDir compatibility
2026-03-15 10:50:49 -07:00
Vincent Koc 132e459009 fix(ci): config drift found and documented 2026-03-15 10:43:03 -07:00
Vincent Koc 756d9b5782
CLI: lazy-load auth choice provider fallback (#47495)
* CLI: lazy-load auth choice provider fallback

* CLI: cover lazy auth choice provider fallback
2026-03-15 10:29:31 -07:00
Nimrod Gutman d88da9f5f8
fix(config): avoid failing startup on implicit memory slot (#47494)
* fix(config): avoid failing on implicit memory slot

* fix(config): satisfy build for memory slot guard

* docs(changelog): note implicit memory slot startup fix (#47494)
2026-03-15 19:28:50 +02:00
Vincent Koc f0202264d0
Gateway: scrub credentials from endpoint snapshots (#46799)
* Gateway: scrub credentials from endpoint snapshots

* Gateway: scrub raw endpoint credentials in snapshots

* Gateway: preserve config redaction round-trips

* Gateway: restore redacted endpoint URLs on apply
2026-03-15 10:28:15 -07:00
Sally O'Malley d37e3d582f
Scope Control UI sessions per gateway (#47453)
* Scope Control UI sessions per gateway

Signed-off-by: sallyom <somalley@redhat.com>

* Add changelog for Control UI session scoping

Signed-off-by: sallyom <somalley@redhat.com>

---------

Signed-off-by: sallyom <somalley@redhat.com>
2026-03-15 13:08:37 -04:00
Vincent Koc 13e256ac9d
CLI: trim onboarding provider startup imports (#47467) 2026-03-15 09:47:56 -07:00
Vincent Koc 8e97b752d0
Tools: revalidate workspace-only patch targets (#46803)
* Tools: revalidate workspace-only patch targets

* Tests: narrow apply-patch delete-path assertion
2026-03-15 09:45:58 -07:00
Vincent Koc 5e78c8bc95
Webhooks: tighten pre-auth body handling (#46802)
* Webhooks: tighten pre-auth body handling

* Webhooks: clean up request body guards
2026-03-15 09:45:18 -07:00
Vincent Koc 7679eb3752
Subagents: restrict follow-up messaging scope (#46801)
* Subagents: restrict follow-up messaging scope

* Subagents: cover foreign-session follow-up sends

* Update CHANGELOG.md
2026-03-15 09:44:51 -07:00
Vincent Koc 9e2eed211c Changelog: add more unreleased PR numbers 2026-03-15 09:36:53 -07:00
Vincent Koc a493f01a90 Changelog: add missing PR credits 2026-03-15 09:33:47 -07:00
Vincent Koc 229426a257
ACP: require admin scope for mutating internal actions (#46789)
* ACP: require admin scope for mutating internal actions

* ACP: cover operator admin mutating actions

* ACP: gate internal status behind admin scope
2026-03-15 09:28:44 -07:00
Vincent Koc a47722de7e
Integrations: tighten inbound callback and allowlist checks (#46787)
* Integrations: harden inbound callback and allowlist handling

* Integrations: address review follow-ups

* Update CHANGELOG.md

* Mattermost: avoid command-gating open button callbacks
2026-03-15 09:24:24 -07:00
Vincent Koc 67b2d1b8e8
CLI: reduce channels add startup memory (#46784)
* CLI: lazy-load channel subcommand handlers

* Channels: defer add command dependencies

* CLI: skip status JSON plugin preload

* CLI: cover status JSON route preload

* Status: trim JSON security audit path

* Status: update JSON fast-path tests

* CLI: cover root help fast path

* CLI: fast-path root help

* Status: keep JSON security parity

* Status: restore JSON security tests

* CLI: document status plugin preload

* Channels: reuse Telegram account import
2026-03-15 09:10:40 -07:00
Vincent Koc 8d44b16b7c
Plugins: preserve scoped ids and reserve bundled duplicates (#47413)
* Plugins: preserve scoped ids and reserve bundled duplicates

* Changelog: add plugin scoped id note

* Plugins: harden scoped install ids

* Plugins: reserve scoped install dirs

* Plugins: migrate legacy scoped update ids
2026-03-15 09:07:10 -07:00