Commit Graph

33160 Commits

Author SHA1 Message Date
Peter Steinberger
de31f91417 test: accept codex active-model fallback
(cherry picked from commit 87b81fa66f)
2026-04-21 16:40:07 +01:00
Peter Steinberger
e01c76eaf9 fix: guard empty docker host args in install smoke
(cherry picked from commit ddd05f4e89)
2026-04-21 16:40:07 +01:00
Peter Steinberger
9d3c155bf8 fix: avoid empty bash arrays in linux smoke
(cherry picked from commit 2db45c7892)
2026-04-21 16:40:07 +01:00
Peter Steinberger
66a5864c2a fix: support older shells in parallels smoke
(cherry picked from commit 8ce7c4f08b)
2026-04-21 16:40:07 +01:00
Peter Steinberger
d2185bd45b fix: run packed bundled postinstall in release check
(cherry picked from commit e57e54e591)
2026-04-21 16:40:07 +01:00
Tak Hoffman
714598774f feat: add soft reset command (#68635)
* feat: add soft reset command

* fix: harden soft reset follow-up behavior

* fix: accept whitespace-delimited soft reset tails

* test: cover newline soft reset normalization

* fix: preserve stale sessions for soft reset

* fix: gate soft reset stale bypass

* fix: align soft reset auth gating

* fix: normalize soft reset session detection

* test: cover multiline soft reset session state

* test: cover multiline soft reset parsing
2026-04-21 10:17:52 -05:00
Vincent Koc
68fd946e6d test(zalo): use preferred tmp dir in outbound media test 2026-04-21 07:28:52 -07:00
Vincent Koc
ce0e191ae0 fix(zalo): use managed temp dir for outbound media 2026-04-21 06:57:03 -07: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
Tak Hoffman
06ff594a3e fix: preload slugged startup memory files (#69600)
* fix: load slugged startup memory files

* fix: harden slugged startup memory loading

* fix: prefer recent startup memory artifacts

* fix: tolerate startup memory stat races

* fix: include utc startup memory dates

* fix: prioritize recent startup memory dates

* fix: cap merged startup memory dates

* fix: preserve local startup memory window

* fix: order startup memory compatibility dates

* fix startup memory directory rescans
2026-04-21 07:03:44 -05:00
Pavan Kumar Gondhi
31160dc069 fix(agents): enforce subagent envelope inheritance on ACP child sessions [AI-assisted] (#69383)
* fix: address issue

* fix: address review feedback

* fix: finalize issue changes

* fix: address PR review feedback

* address build faiure

* 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 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 PR review feedback
2026-04-21 17:25:25 +05:30
Cássio Jones Dhein Silva
89b6d02481 fix(tui): arm streaming watchdog on every delta, not only visible ones (#69338)
When ingestDelta returns null (first empty/commentary delta or unchanged
content), the handler returned early, skipping setActivityStatus and
armStreamingWatchdog. If all subsequent deltas were also null (e.g.
due to phase filtering), the watchdog was never armed and the status bar
stayed stale as "idle" while a run was live.

Move setActivityStatus("streaming") and armStreamingWatchdog before
the null-displayText guard so they fire on every received delta event.

Fixes #34513, #40824

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 21:53:36 +10:00
Sanjay Santhanam
081da17090 fix(codex): exclude codex-app-server synthetic apiKey from secrets audit (#69581)
* fix(codex): exclude codex-app-server synthetic apiKey from secrets audit

The Codex extension uses the literal string "codex-app-server" as a
hardcoded placeholder apiKey in provider.ts, since the real
authentication is managed by the app-server transport itself.

The secrets audit currently reports this as a real plaintext leak
(PLAINTEXT_FOUND), producing a false positive for any user who has
configured the Codex harness.

Declare it as a plugin-owned non-secret marker in the Codex plugin
manifest, so it flows through the standard
`listKnownNonSecretApiKeyMarkers()` path alongside `ollama-local`,
`lmstudio-local`, `gcp-vertex-credentials`, and `minimax-oauth`.

Also extends the existing `model auth markers` unit tests to lock
in the behavior.

Fixes #69511

* ci: retrigger checks (no-op)
2026-04-21 21:38:26 +10:00
Mason Huang
850b6d2d46 docs(changelog): deduplicate #67800 entries in Unreleased (#69670)
* fix(changelog): remove duplicate entry for PR #67800

* docs(changelog): move #67800 note from Unreleased into 2026.4.20
2026-04-21 18:05:05 +08:00
Ted Li
4bacdc8824 fix(agents): honor explicit long Anthropic cache TTL on custom hosts (#67800)
Merged via squash.

Prepared head SHA: 0ffde15713
Co-authored-by: MonkeyLeeT <6754057+MonkeyLeeT@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
2026-04-21 17:45:27 +08:00
Ayaan Zaidi
f1df354222 fix: fix Telegram media file delivery (#69641) 2026-04-21 14:19:27 +05:30
Ayaan Zaidi
fcc86f043b fix(media): preserve outbound attachment filenames 2026-04-21 14:19:27 +05:30
Ayaan Zaidi
f350bb4dfc fix(media): parse lowercase media directives 2026-04-21 14:19:27 +05:30
Omar Shahine
14506aeca4 fix(bluebubbles): add opt-in coalesceSameSenderDms for split-send DMs (#69258)
Merged via squash.

Prepared head SHA: 8f1bd3cf53
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-04-21 01:43:17 -07:00
Peter Steinberger
f1805ab54d fix: centralize provider thinking profiles 2026-04-21 09:13:35 +01:00
Peter Steinberger
1cc2fc82ca docs: prepare 2026.4.20 changelog 2026-04-21 08:59:32 +01:00
Peter Steinberger
047acaa176 fix: stage ACP and Codex runtime deps 2026-04-21 08:47:24 +01:00
Ayaan Zaidi
6a4a60fe25 fix(gateway): drop stale service env on reinstall 2026-04-21 13:08:40 +05:30
Peter Steinberger
f14e91b39f test: add bundled channel dependency Docker smoke 2026-04-21 08:26:23 +01:00
Peter Steinberger
1d98853813 test: relax detached task recovery timing assertion 2026-04-21 08:22:35 +01:00
Peter Steinberger
2ad7bd0f55 fix: ignore placeholder shells in runtime detection (#69308) 2026-04-21 08:18:01 +01:00
Sk7n4k3d
7b414d8c0b shell: fall back to sh when SHELL is /usr/bin/false or nologin 2026-04-21 08:18:01 +01:00
Peter Steinberger
7b1871b99b fix(browser): clarify DevToolsActivePort attach failures 2026-04-21 08:11:41 +01:00
Peter Steinberger
9f054ee05b fix: sanitize mcp transport warning fields 2026-04-21 08:06:54 +01:00
Peter Steinberger
fccb2b8ace fix: launch Windows startup gateway directly 2026-04-21 08:03:34 +01:00
Peter Steinberger
c197b3fef4 fix(openai-codex): normalize legacy copilot transport 2026-04-21 08:03:31 +01:00
Peter Steinberger
85d86ebc4b fix: narrow MCP stdio env safety filter (#69540) 2026-04-21 08:03:29 +01:00
Devin Robison
62fa507189 fix(mcp): block dangerous stdio env overrides 2026-04-21 08:03:29 +01:00
Peter Steinberger
97534372f8 fix(openai-codex): normalize completions transport drift 2026-04-21 07:58:25 +01:00
Peter Steinberger
dc6ecd571a fix: skip workspace plugin runtime deps 2026-04-21 07:53:44 +01:00
Peter Steinberger
aacae4ce62 fix: use npm for bundled runtime dep repair 2026-04-21 07:53:44 +01:00
Peter Steinberger
fb2c405dbc fix: bound gateway usage cost cache (#68842) 2026-04-21 07:53:44 +01:00
Feelw00
8bf57e8bde fix(gateway): bound costUsageCache with MAX + FIFO eviction
Regression: `costUsageCache` in `src/gateway/server-methods/usage.ts` had no
delete/prune/evict path. The TTL check at L310 only gates stale reads — on a
miss after expiry, `set()` overwrites the same key but never removes stale
keys. `parseDateRange` derives cacheKey from `getTodayStartMs`, so cacheKey
rolls at every UTC 00:00, and additional axes (days / startDate / endDate /
utcOffset) multiply cardinality. The macOS menu polls `usage.cost` every ~45s
with no params, exercising `parseDateRange`'s default branch every day. Over
gateway uptime the map grows monotonically.

Three sibling caches in the same subsystem already implement MAX + FIFO
eviction (resolvedSessionKeyByRunId, TRANSCRIPT_SESSION_KEY_CACHE,
sessionTitleFieldsCache). This change mirrors their pattern:

- `COST_USAGE_CACHE_MAX = 256` (matches RUN_LOOKUP_CACHE_LIMIT and
  TRANSCRIPT_SESSION_KEY_CACHE_MAX).
- New `setCostUsageCache(cacheKey, entry)` helper checks size + evicts
  `keys().next().value` when adding a new key would exceed the cap.
- The three existing `costUsageCache.set(...)` call sites now route through
  the helper. TTL-on-read, in-flight dedup, and overwrite-on-same-key
  semantics are preserved.

Adds `src/gateway/server-methods/usage.cost-usage-cache.test.ts` which drives
growth through `__test.loadCostUsageSummaryCached` with 600 distinct
(startMs, endMs) pairs (mirrors day rollover + range switches). Pre-fix the
Map grows to 600; post-fix it plateaus, the last key is retained, and the
first key is evicted (FIFO).

AI-assisted (fully tested). 432 server-methods tests pass, pnpm check +
pnpm build clean.
2026-04-21 07:53:44 +01:00
Peter Steinberger
0d305839e5 fix(anthropic): scope api default normalization 2026-04-21 07:48:21 +01:00
Peter Steinberger
0532feb0d3 fix: skip redundant bundled runtime dep repairs 2026-04-21 07:37:48 +01:00
Peter Steinberger
494cd78889 fix: tolerate pnpm-backed runtime dependency installs 2026-04-21 07:37:48 +01:00
Peter Steinberger
05ba1335d9 fix: tolerate qa cli json startup logs 2026-04-21 07:37:48 +01:00
Ahmed Tokyo
c92490881b fix: map thinkingLevel to reasoning.effort for openai-responses-defaults family 2026-04-21 07:37:48 +01:00
Ayaan Zaidi
b9d2e0f86d fix(cron): gate delivery prompt on message tool availability 2026-04-21 12:01:06 +05:30
Ayaan Zaidi
19e451dc75 fix(cli): paginate cron show lookup 2026-04-21 12:01:06 +05:30
Ayaan Zaidi
5579fef673 fix(cron): align dry-run delivery previews with target policy 2026-04-21 12:01:06 +05:30
Ayaan Zaidi
ab3938df1e fix: cron chat delivery policy (#69587) 2026-04-21 12:01:06 +05:30
Ayaan Zaidi
0b25a73288 fix(cron): resolve delivery preview server-side 2026-04-21 12:01:06 +05:30
Ayaan Zaidi
4f0a978fc2 fix(cron): track implicit message sends 2026-04-21 12:01:06 +05:30