Commit Graph

1760 Commits

Author SHA1 Message Date
Bek
e116b343b2 feat(slack): Annotate inbound Slack mention tokens in Slack RawBody and BodyForAgent content so the agent sees both the actionable Slack mention token and a human-readable name. (#65731)
* Annotate inbound Slack mentions in raw bodies

* Avoid shared regex state in Slack mention rendering

* Bound Slack mention lookups with concurrency

* slack: keep mention concurrency helper plugin-local

* test: stabilize node core CI assertions

* slack: cap mention lookups per inbound message

* test: reset suite gateway runtime state

* fix(slack): reuse plugin sdk concurrency helper
2026-04-21 19:03:50 -04:00
Peter Steinberger
d7a173e60e feat(plugin-sdk): add presentation and skills runtime contracts 2026-04-21 21:29:44 +01:00
Gustavo Madeira Santana
ddc1d9aa54 perf: speed up telegram channel registration (#69786)
Merged via squash.

Prepared head SHA: ac03f96e0d
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-21 13:24:28 -04:00
Shadow
38aaa23e63 feat(channels): stream tool progress into preview edits (#69611) (thanks @thewilloftheshadow) 2026-04-21 11:51:16 -05:00
Pavan Kumar Gondhi
a65eb1b864 fix(zalo): add SSRF guard on outbound photo URLs [AI-assisted] (#69593)
* fix: address issue

* fix: address review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address build failures

* fix: address PR review feedback

* fix: address review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address review feedback

* fix: address build feedback
2026-04-21 19:20:26 +05:30
Alex Knight
4407df6c03 perf(plugin-sdk): per-phase + per-jiti-call probes for bundled channel entries (#69537)
* perf(plugin-sdk): per-phase + per-jiti-call probes for bundled channel entries

Extends the existing OPENCLAW_PLUGIN_LOAD_PROFILE infrastructure (see
src/plugins/loader.ts `profilePluginLoaderSync` and src/plugins/source-loader.ts)
with two new probe sites inside src/plugin-sdk/channel-entry-contract.ts:

1. `bundled-register:<phase>` — wraps each phase of `defineBundledChannelEntry`'s
   register() callback (`setChannelRuntime`, `loadChannelPlugin`, `registerChannel`,
   `registerCliMetadata`, `registerFull`). Lets us pinpoint which phase of plugin
   registration is responsible for cold-start cost on a per-plugin basis.

2. `bundled-entry-module-load` — instruments `loadBundledEntryModuleSync` and
   reports `getJitiMs` (jiti loader factory) vs `jitiCallMs` (actual graph walk
   + transpile + ESM linking) separately. Lets us distinguish alias-map / loader
   setup overhead from import-graph traversal cost on a per-module basis.

Both probes are gated on OPENCLAW_PLUGIN_LOAD_PROFILE=1 and have zero overhead
when the env flag is unset (early return before any `performance.now()` call).
Log format matches the existing `[plugin-load-profile]` line shape so existing
log scrapers continue to work.

The helper is a file-local mirror of `profilePluginLoaderSync` rather than a
new SDK export — keeps the SDK boundary narrow per src/plugin-sdk/AGENTS.md
and avoids cross-importing host internals.

Used to validate PR #69317 (slack startup perf) — measurements showed slack
`setChannelRuntime` dropping from 13183ms to 67ms after barrel narrowing,
which would have been undiagnosable without these per-phase probes.

* perf(plugins): per-plugin register() probe in plugin loader

Adds a `phase=${registrationMode}:register` probe wrapping each call to
`runPluginRegisterSync(register, api)` in src/plugins/loader.ts. Emits the
established `[plugin-load-profile]` line shape via `profilePluginLoaderSync`,
gated on OPENCLAW_PLUGIN_LOAD_PROFILE=1.

Two call sites are wrapped:
- The main load path (registrationMode is dynamic: "snapshot", "validate",
  "full") at the post-snapshot register block. Emits e.g.
  `phase=full:register plugin=slack elapsedMs=14102.1 source=...`
- The cli-metadata-only path (registrationMode hardcoded to "cli-metadata")
  for fast `--metadata` boot flows.

Together with the existing `phase=full` (entire load) and `phase=source-loader`
probes plus the `bundled-register:*` and `bundled-entry-module-load` probes
added in the previous commit, this gives a full breakdown:

- `phase=full plugin=slack` — total cost from import through register return
- `phase=full:register plugin=slack` — just the register() callback (NEW)
- `phase=bundled-register:setChannelRuntime plugin=slack` — sub-phase
- `phase=bundled-register:loadChannelPlugin plugin=slack` — sub-phase
- `phase=bundled-entry-module-load plugin=(bundled-entry)` — per-module load

Lets you `sort -k4 -n -r` the log output to find the slowest plugin's
register() call across all bundled+third-party plugins, then drill in via
the sub-phase probes for bundled entries.

* perf(plugins): consolidate plugin-load-profile primitives in shared module

Extracts the previously duplicated `shouldProfilePluginLoader` /
`profilePluginLoaderSync` helpers into a new `src/plugins/plugin-load-profile.ts`
module. Removes 3 file-local copies of the same env-flag check and 2
near-duplicate `try { run() } finally { console.error(...) }` wrappers.

Files updated:
- NEW src/plugins/plugin-load-profile.ts — sole owner of:
    shouldProfilePluginLoader()
    profilePluginLoaderSync<T>({phase, pluginId?, source, run, extras?})
    formatPluginLoadProfileLine({phase, pluginId?, source, elapsedMs, extras?})
- src/plugins/loader.ts — drop file-local copies, import shared helper
  (existing 4 + new 2 call sites unchanged in shape)
- src/plugins/source-loader.ts — drop renamed local copy
  (`shouldProfilePluginSourceLoader`), use shared helper with
  `pluginId: "(direct)"` to preserve the existing `plugin=(direct)` field
- src/plugin-sdk/channel-entry-contract.ts — drop file-local copies and
  inline `profileStep` closure; use shared `profilePluginLoaderSync` directly
  at all 5 `bundled-register:*` call sites; dual-timing
  `bundled-entry-module-load` probe uses `formatPluginLoadProfileLine` with
  ordered `extras` for `getJitiMs`/`jitiCallMs`

Log line format is byte-for-byte identical to before (validated against
3 cases: standard, with pluginId, dual-timing). The `extras` API is
intentionally an ordered tuple list (not a record) so that scrapers see
deterministic field order between `elapsedMs=` and `source=`.

Net: +155/-87 lines across 4 files, removing ~60 lines of duplication
while exposing a stable, documented probe surface.

Verified:
- pnpm tsgo (core) — 0 errors
- pnpm lint on all 4 files — 0 warnings, 0 errors
- pnpm test src/plugins/loader.test.ts — 102/102
- pnpm test src/plugins/contracts/plugin-entry-guardrails.test.ts — 7/7
- pnpm test src/plugin-sdk/channel-entry-contract.test.ts — 4/4
- Standalone formatter smoke test — output matches existing format byte-for-byte

* refactor(plugins): rename profilePluginLoaderSync to withProfile and bind scope at register sites

* fix(plugin-sdk): zero jiti sub-step timings on Win32 nodeRequire fast-path
2026-04-21 22:06:13 +10:00
Peter Steinberger
f1805ab54d fix: centralize provider thinking profiles 2026-04-21 09:13:35 +01:00
Ahmed Tokyo
c92490881b fix: map thinkingLevel to reasoning.effort for openai-responses-defaults family 2026-04-21 07:37:48 +01:00
Peter Steinberger
6ce17db11a fix: gate max thinking by model support 2026-04-21 07:02:43 +01:00
Tak Hoffman
1303b03241 fix: add silent reply policy by conversation type (#68644)
Thanks @Takhoffman.
2026-04-21 05:17:55 +01:00
Peter Steinberger
a9bef83a0c refactor: delegate bluebubbles conversation helpers 2026-04-21 03:12:42 +01:00
aniaan
c8e5150fd4 feat(moonshot): default to Kimi K2.6 with K2.6-only thinking.keep support (#68816)
Merged via squash.

Prepared head SHA: ed54e02842
Co-authored-by: aniaan <40813941+aniaan@users.noreply.github.com>
Co-authored-by: odysseus0 <8635094+odysseus0@users.noreply.github.com>
Reviewed-by: @odysseus0
2026-04-20 18:04:49 -07:00
Peter Steinberger
6bb6cfc68e test: use synthetic plugin channel fixtures 2026-04-21 01:32:27 +01:00
Peter Steinberger
3f274006cd refactor: share oauth callback flow 2026-04-21 01:07:09 +01:00
Peter Steinberger
7b1f7b179f refactor: share thread binding lifecycle 2026-04-21 01:07:09 +01:00
Peter Steinberger
660e4257a7 refactor: share codex auth bridge 2026-04-21 00:54:08 +01:00
Peter Steinberger
0647481c7c refactor: share ssrf policy merging 2026-04-21 00:54:08 +01:00
Peter Steinberger
7ca649413a refactor: share env secret ref allowlist check 2026-04-20 23:42:11 +01:00
Peter Steinberger
0094f76314 refactor: share plugin config issue formatting 2026-04-20 23:34:19 +01:00
Peter Steinberger
6464cf4756 refactor: share plugin package version lookup 2026-04-20 23:34:19 +01:00
Peter Steinberger
4fb2e2309e refactor: share timeout abort helper with matrix 2026-04-20 23:34:19 +01:00
Peter Steinberger
8b7418b127 refactor: share channel doctor alias normalization 2026-04-20 23:34:19 +01:00
Peter Steinberger
da5a6b68bd refactor: share ssrf base url policy 2026-04-20 23:15:58 +01:00
Peter Steinberger
d7c7905a52 refactor: share provider polling helper 2026-04-20 23:04:10 +01:00
Peter Steinberger
8f4920e2eb refactor: share line sdk types 2026-04-20 23:04:10 +01:00
Peter Steinberger
d8745d928d test: share browser facade fixtures 2026-04-20 21:46:35 +01:00
Peter Steinberger
ba331014be test: share plugin sdk facade fixtures 2026-04-20 21:46:35 +01:00
Peter Steinberger
c99a13f72c test: share channel config dm resolver fixture 2026-04-20 19:40:04 +01:00
Peter Steinberger
905d2d8062 test: share qa runtime fixtures 2026-04-20 19:38:34 +01:00
Peter Steinberger
b3a0da7c5e test(extensions): split outbound payload contracts 2026-04-20 19:37:20 +01:00
Peter Steinberger
6a4d633e42 perf(test): keep session init thread parsing hot path lazy 2026-04-20 17:14:42 +01:00
Peter Steinberger
61fa215acd refactor: share stream message wrapper 2026-04-20 15:36:20 +01:00
Peter Steinberger
f6f7d2f85e refactor: share qa channel protocol types 2026-04-20 15:32:31 +01:00
Peter Steinberger
eddfffebe8 refactor: share facade resolution helpers 2026-04-20 15:29:16 +01:00
Peter Steinberger
f73d8e8d9e refactor: share configured account id helper 2026-04-20 15:21:20 +01:00
Peter Steinberger
0a9edac632 refactor: share parsed chat allowlist matcher 2026-04-20 15:18:44 +01:00
Peter Steinberger
4e907f78ca refactor: reuse channel config policy helper 2026-04-20 15:06:24 +01:00
Peter Steinberger
8642137252 refactor: share model allowlist entry helper 2026-04-20 15:02:51 +01:00
Peter Steinberger
f27c164e7f refactor: share lazy facade value binder 2026-04-20 14:57:50 +01:00
Peter Steinberger
85c1c59c5f refactor: share message content block visitor 2026-04-20 14:53:42 +01:00
Peter Steinberger
4da0a99a9e refactor: share speech provider helpers 2026-04-20 14:50:58 +01:00
Peter Steinberger
9d17871ff0 refactor: share computed status adapter base 2026-04-20 14:46:20 +01:00
Peter Steinberger
1e4f3f2123 refactor(test): remove legacy extension test seams 2026-04-20 13:18:49 +01:00
Mariano
bd3ad3436e tasks: add detached runtime plugin registration contract (#68915)
* tasks: register detached runtime plugins

* tasks: harden detached runtime ownership

* tasks: extract detached runtime contract types

* changelog: note detached runtime contract

* changelog: attribute detached runtime contract
2026-04-19 13:13:11 +02:00
Peter Steinberger
e069169765 perf: decouple plugin facades from extension types 2026-04-18 22:06:45 +01:00
Peter Steinberger
85826c83e4 refactor(google): move Gemini transport into plugin 2026-04-18 21:41:54 +01:00
Peter Steinberger
2fc429dfbf fix: keep codex oauth bridge extension-owned (#68284) (thanks @vincentkoc) 2026-04-18 21:27:27 +01:00
Vincent Koc
a018257487 fix(auth): harden codex oauth bridge security 2026-04-18 21:27:27 +01:00
Vincent Koc
78288e37ed fix(auth): close codex review gaps 2026-04-18 21:27:27 +01:00
Vincent Koc
859eb06662 refactor(auth): route codex runtimes through canonical oauth 2026-04-18 21:27:27 +01:00