Commit Graph

31011 Commits

Author SHA1 Message Date
Peter Steinberger
0fe7479752 fix(agents): fence yield abort lock release 2026-05-27 02:32:51 +01:00
OpenClaw Assistant
a7eab7467f fix(agents): release yield abort session lock
Release the embedded attempt session lock before sessions_yield abort cleanup waits for session events and rewrites yielded-parent artifacts.

This keeps the existing bounded settle wait while preventing child completion callbacks from contending on the coarse parent transcript lock.

Adds focused session-lock lifecycle coverage.
2026-05-27 02:32:51 +01:00
NVIDIAN
bba429831c fix(agents): honor per-agent thinking defaults for ingress runs (#86689)
Honor the selected session agent's thinkingDefault for ingress agent runs before global fallback.

Also keep session store cache object-clone writes parse-free while matching persisted JSON shape when cloning values.

Fixes #86669

Co-authored-by: ai-hpc <mail.speedy.hpc@hotmail.com>
2026-05-27 02:18:57 +01:00
Peter Steinberger
2035f38ab2 perf: trim gateway runtime hotspots 2026-05-27 02:17:29 +01:00
Peter Steinberger
f6599ede0d fix(sessions): avoid parsing object cache writes 2026-05-26 21:16:21 -04:00
Peter Steinberger
049d6c9683 test: skip claude resume live proof without cli 2026-05-26 21:04:46 -04:00
Chunyue Wang
71d24f98a8 fix(agents): force SIGKILL for stuck MCP stdio children (#86739)
Guarantee MCP stdio child cleanup during Gateway shutdown by sending a synchronous SIGKILL when the child survives the existing stdin and SIGTERM waits. This prevents SIGTERM-ignoring local MCP processes from outliving the Gateway when killProcessTree's unref'd SIGKILL timer would otherwise lose the shutdown race.

Fixes #86412.

Verification:
- GitHub CI green on relevant agent/runtime, lint/type, CodeQL/security, OpenGrep, and Real behavior proof checks.
- Real behavior proof: https://github.com/openclaw/openclaw/actions/runs/26430512156/job/77802651894
- Maintainer manual review: no blocking findings.

Thanks @openperf.

Co-authored-by: openperf <16864032@qq.com>
2026-05-27 02:04:29 +01:00
Alix-007
c9ca7fc0d2 fix(cron): preview no-deliver message targets
Fix cron delivery previews for no-delivery jobs that still provide explicit message-tool targets.

- Reuse one cron delivery-plan explicit-target predicate across preview and isolated-agent runtime paths.
- Treat numeric threadId 0 as an explicit delivery target.
- Avoid fail-closed wording for unresolved message-tool-only targets.

Thanks @Alix-007 for the fix.

Co-authored-by: Alix-007 <267018309+Alix-007@users.noreply.github.com>
2026-05-27 01:53:11 +01:00
Peter Steinberger
a43da0c8c5 perf: reduce gateway cpu churn 2026-05-27 01:52:27 +01:00
Vincent Koc
80749b3bdf fix(gateway): harden runtime smoke checks 2026-05-27 02:49:22 +02:00
JanusAsmussen
84e62824f6 fix(anthropic): pass system prompt on resumed claude-cli sessions
Summary:
- send Claude CLI system prompt files on resumed turns when backend policy is always
- set Claude CLI default systemPromptWhen to always
- add argv/unit coverage plus live ALPHA-to-BRAVO resume proof for #80374

Verification:
- pnpm test src/agents/cli-runner/helpers.system-prompt-resume.test.ts extensions/anthropic/cli-shared.test.ts src/agents/cli-backends.test.ts test/scripts/test-live-shard.test.ts -- --reporter=verbose
- OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_USE_REAL_HOME=1 OPENCLAW_LIVE_CLI_BACKEND=true OPENCLAW_LIVE_CLI_BACKEND_MODEL=claude-cli/claude-haiku-4-5 node scripts/run-vitest.mjs run --config test/vitest/vitest.live.config.ts src/gateway/gateway-cli-backend.system-prompt-resume.live.test.ts --reporter=verbose
- /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode local
- git diff --check
- gitcrawl gh pr checks 86433 --repo openclaw/openclaw --watch=false --required

Co-authored-by: JanusAsmussen <jjasmussen@outlook.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-27 01:31:13 +01:00
Enjou
d8f6d65525 fix(skills): sync plugin skills to sandbox workspaces
Copy plugin-provided skills from their validated real target into sandbox workspaces while keeping prompt-visible skill paths sandbox-local.

Adds regression coverage for symlinked plugin skills, multiple plugin skill roots, escaped symlink targets, and sandbox prompt paths that must not leak host plugin-skill locations.

Refs #86190
2026-05-27 01:27:10 +01:00
Jason (Json)
ee655f4d94 fix: scrub serialized tool-call text from replies (#86924)
* fix: scrub serialized tool-call text from replies

* fix: consume xmlish tool parameters
2026-05-27 01:16:58 +01:00
Peter Steinberger
eac918d69b test: fix CI type checks 2026-05-26 20:13:03 -04:00
Peter Steinberger
61fa2b285e test(docs): avoid URL default stringification 2026-05-26 20:04:33 -04:00
Peter Steinberger
9f7584c385 test: speed up plugin runtime tests 2026-05-27 01:02:46 +01:00
Peter Steinberger
69d84d775b fix(docs): use Cloudflare docs search API 2026-05-27 00:58:09 +01:00
Peter Steinberger
7e913c08f8 test: speed up run-node infra tests 2026-05-27 00:57:44 +01:00
Ted Li
030861e5d1 fix(agents): unwrap standalone message tool JSON (#86626)
* fix(agents): unwrap standalone message tool JSON

* fix(agents): guard message JSON unwrap

* fix(agents): gate message JSON recovery

* fix(agents): treat to as routed message JSON
2026-05-27 00:53:02 +01:00
Peter Steinberger
dc1e6fb02b test: bound gateway live model discovery 2026-05-26 19:47:07 -04:00
Peter Steinberger
75fc0bce0f test: speed up plugin install suites 2026-05-27 00:46:44 +01:00
Jason (Json)
532494b12a Preserve xAI usage limit errors in local TUI (#86614)
* fix: preserve xai usage limit errors

* fix: classify actual xai credit errors

* fix: classify xai 429 billing exhaustion

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-27 00:43:55 +01:00
Abdel Gomez-Perez
474b1e0386 fix(cli-runner): scale Claude CLI reseed history automatically
Remove the proposed public `maxReseedHistoryChars` config surface and scale Claude CLI reseed history automatically from the resolved context tier instead.

Claude CLI 200K-context runs now keep a 64K-character reseed slice, 1M Opus/Sonnet runs use the bounded 256KiB cap, and non-Claude CLI backends keep the existing 12KiB default. This preserves the intended long-context behavior without adding another config option.

Verification:
- `node scripts/run-vitest.mjs src/agents/cli-runner/session-history.test.ts src/agents/cli-runner/prepare.test.ts`
- `node scripts/run-vitest.mjs src/agents/cli-runner/prepare.test.ts -t "automatic Claude CLI cap"`
- `node scripts/run-oxlint.mjs src/agents/cli-runner/prepare.ts src/agents/cli-runner/prepare.test.ts src/agents/cli-runner/session-history.ts src/agents/cli-runner/session-history.test.ts src/config/types.agent-defaults.ts src/config/zod-schema.core.ts`
- `pnpm check:changed` via Testbox `tbx_01kska2twjxb925xft9dj82hvb`
- GitHub PR checks green

Closes #83985
Co-authored-by: Abdel Gomez-Perez <nabdel07@icloud.com>
2026-05-27 00:41:01 +01:00
Peter Steinberger
8592352c24 test: speed up infra test hotspots 2026-05-27 00:39:27 +01:00
Peter Steinberger
693f06d811 fix(live): classify Z.ai plan denials as billing drift 2026-05-27 00:36:54 +01:00
Eric Milgram, PhD
678a0ee944 fix(config): render transform-backed config schema inputs (#67328)
Generate the public config JSON Schema from accepted input shapes so transform-backed fields remain renderable in the Control UI. Keep transform output schemas representable with explicit string pipes, align analyzer metadata handling, and cover the generated schema plus browser-safe UI render shapes.

Co-authored-by: Altay <altay@hey.com>

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-27 00:36:13 +01:00
Peter Steinberger
980d73dc5a perf: speed up test hotspots 2026-05-27 00:30:51 +01:00
Peter Steinberger
0f608bc497 test: speed up hot test fixtures 2026-05-27 00:11:23 +01:00
Alix-007
8ec2b2d09b fix(auto-reply): suppress repeated silent tokens (#86848)
* fix(auto-reply): suppress repeated silent tokens

* test(plugin-sdk): cover repeated silent token exports

* test(plugin-sdk): cover custom repeated silent token export

* fix(lint): drop redundant image registry casts

---------

Co-authored-by: Alix-007 <267018309+Alix-007@users.noreply.github.com>
2026-05-27 00:04:57 +01:00
Peter Steinberger
1313e15241 fix(commands): preserve async skill commands
Preserve native slash-command laziness while allowing `/skill` to load workspace skill commands asynchronously when needed. The loaded command list is reused for downstream native skill dispatch so valid `/skill <name>` calls do not get misclassified as unknown.

Verification:
- git diff --check
- fnm exec --using v24.15.0 -- pnpm changed:lanes --json
- .agents/skills/autoreview/scripts/autoreview --mode local
- GitHub CI rollup success for c0d778d512

Co-authored-by: Keshav's Bot <keshavbotagent@gmail.com>
2026-05-27 00:03:25 +01:00
fuller-stack-dev
669bfdd9b0 test: fix bundled install mock typing 2026-05-26 23:51:53 +01:00
fuller-stack-dev
771675e826 fix: keep bundled OpenClaw plugins image-owned 2026-05-26 23:51:53 +01:00
Peter Steinberger
3f524a6423 perf: cache npm globalconfig lookups 2026-05-26 23:45:17 +01:00
狼哥
126a3363a3 fix(daemon): ignore recursive Windows gateway wrapper
Fixes #86007.

Release note: Windows gateway install/update now ignores a persisted OPENCLAW_WRAPPER when it points back at the generated gateway.cmd task script, preventing recursive gateway startup while keeping valid wrapper installs intact.

Credit: thanks @luoyanglang for the fix and proof.
2026-05-26 23:42:25 +01:00
Kevin Lin
7d6b7f434c feat(plugin-sdk): add reaction approval helpers (#86735)
* feat(plugin-sdk): add reaction approval helpers

* fix(signal): register target approval reactions

* Remove legacy WhatsApp approval reaction appender

* refactor(plugin-sdk): share native exec prompt suppression

* revert(discord): keep exec prompt suppression local

* refactor(plugin-sdk): share native approval fallback suppression

* fix(whatsapp): bind outbound approval reactions

* chore(plugin-sdk): refresh api baseline

* revert(imessage): defer reaction approval changes
2026-05-26 15:28:50 -07:00
Frederic David blum
1e1cf14da2 fix(gateway): reject RPCs from invalidated device-token clients durin… (#70707)
* fix(gateway): reject RPCs from invalidated device-token clients during rotation/revoke race

device.token.rotate, device.token.revoke and device.pair.remove all
respond 200 OK to the admin, then schedule disconnectClientsForDevice
via queueMicrotask so the response can flush before the socket close.
That microtask window plus the absence of a per-RPC re-check for
device-token auth (unlike shared-auth, which gets checked at
message-handler.ts:1444-1458) created a race: an attacker with RPCs
already pipelined in the WS socket buffer could land a few more
authenticated operations with the rotated/revoked token before the
socket actually closed.

Fix: add a cheap in-memory 'invalidated' flag on GatewayWsClient and
mark it synchronously *before* responding in the three handlers. Add
a mirror check at the start of the per-RPC dispatch that force-closes
the client if the flag is set, regardless of whether socket.close()
has taken effect yet. Disconnect still happens via queueMicrotask so
the admin's rotate/revoke response flushes normally.

Introduces context.invalidateClientsForDevice(deviceId, opts) as a
sync companion to the existing disconnectClientsForDevice. Also
defense-in-depth: disconnectClientsForDevice now sets the flag too,
so any other caller of the hard-disconnect path gets the per-RPC
gate for free.

* test(gateway): use vi.mocked instead of direct Mock casts in devices tests

check-test-types failed on the PR because direct 'as ReturnType<typeof vi.fn>' casts from RespondFn (or the optional context methods) don't structurally overlap with the Mock type — Mock has mockImplementation/mockReturnValue that RespondFn lacks, so strict tsgo rejects the conversion. vi.mocked() is the intended helper for reinterpreting an already-mocked function, and drops through to the Mock surface cleanly.

* test(gateway): align tests with upstream type/shape changes after rebase

After rebasing onto upstream main, two test surfaces drifted:

1. GatewayRequestContextParams gained two required fields upstream
   (getRuntimeConfig, broadcastVoiceWakeRoutingChanged). The
   makeContextParams test helper was missing them, so every consumer
   tripped tsgo with a missing-field error. Add both as vi.fn()
   stubs.

2. revokeDeviceToken's return shape changed upstream from a bare
   entry record to a discriminated union {ok: true, entry: ...} | {ok:
   false, reason}. The new device.token.revoke synchronous-invalidate
   test still mocked the old shape, so the production handler took the
   !revoked.ok branch and never reached the invalidateClientsForDevice
   call the test asserted. Update the mock to the new union shape.

Also fix three new Set([...] as never) sites in server-request-
context.test.ts that produced Set<unknown> rather than Set<never>.
Move the cast outside the Set constructor so the literal stays
inferred while the wrapper is type-erased to never, which is
assignable to the Partial<GatewayRequestContextParams> clients field.

* fix(gateway): export GatewayRequestContextParams for test access

* fix(ci): resolve check-test-types and lint failures from PR #70707 branch

- server-request-context.test.ts: hasConnectedMobileNode → hasConnectedTalkNode
  (field renamed in server-request-context.ts but test fixture not updated)
- status.summary.redaction.test.ts: add configuredModel/selectedModel/
  modelSelectionReason to createRecentSessionRow fixture
  (SessionStatus gained these fields in a13468320c; test was not updated)
- video-generation-providers.live.test.ts: replace empty {} fallbacks in
  conditional spreads with undefined (oxlint 1.65.0, 5 occurrences)
- music-generation-providers.live.test.ts: same fix for 4 occurrences

Remaining CI failures (FsSafeError/Python helper, media tests, Windows ACL,
session-memory hooks) are pre-existing infra failures unrelated to this PR.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): add missing GatewayRequestContextParams fields to test fixture

chatDeltaLastBroadcastText, agentDeltaSentAt, and bufferedAgentEvents are
required fields in GatewayRequestContextParams but were absent from the
makeContextParams fixture, causing TS2322 in check-test-types.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* fix(gateway): serialize credential invalidating RPCs

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-26 23:09:56 +01:00
Peter Steinberger
6158742f80 fix(channel): handle plugin channel markdown fallback
(cherry picked from commit 8824a8de47)
2026-05-26 23:04:49 +01:00
Thesaranshn8n
6729dea36f fix(codex): share native hook relay registry (#73950)
Co-authored-by: Sar Jeeves <sar-jeeves@example.com>
Co-authored-by: Kaspre <kaspre@gmail.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-05-26 15:02:03 -07:00
Peter Steinberger
5a7d5c6def fix(codex): bound app-server timeout fallout
Retire timed-out Codex app-server clients with lease-aware cleanup and keep harness-owned timeouts out of provider fallback.
2026-05-26 22:41:02 +01:00
Peter Steinberger
9fc71e9076 fix(agents): keep model browse normalization bounded
Keep model browse/list visibility consistent with runtime-normalized allowlist entries while keeping unrestricted default browse off plugin/runtime hydration. Add regression coverage for catalog visibility, `/models` browse data, and the replay sanitizer mock isolation that made the agents shard order-sensitive.

Verification:
- pnpm test src/agents/pi-embedded-runner.sanitize-session-history.test.ts src/agents/model-catalog-visibility.test.ts src/auto-reply/reply/commands-models.test.ts src/auto-reply/reply/model-selection.test.ts src/agents/model-selection.plugin-runtime.test.ts -- --reporter=verbose
- OPENCLAW_VITEST_MAX_WORKERS=2 pnpm exec node scripts/test-projects.mjs test/vitest/vitest.agents-core.config.ts
- .agents/skills/autoreview/scripts/autoreview --mode local
- GitHub Actions CI run 26476126784
2026-05-26 22:34:37 +01:00
Peter Steinberger
a818556dd9 fix: stabilize media-related tests 2026-05-26 17:30:34 -04:00
Peter Steinberger
acd3ce00ea test(agents): pin native anthropic replay policy 2026-05-26 22:29:46 +01:00
Fermin Quant
0a085bf15e fix(status): surface systemd gateway hygiene (#86976) 2026-05-26 22:29:20 +01:00
Andy Ye
f3e61580bd Fix status JSON plugin scan (#87001)
* fix status json plugin scan

* fix status json metadata imports

* fix channel metadata repair fallback

* fix runtime channel id normalization fallback

* fix status json env channel detection

Co-authored-by: Peter Steinberger <steipete@gmail.com>

* fix signed thinking legacy tool repair

* fix: preserve first signed replay turn

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-26 22:24:25 +01:00
吴杨帆
77505daa85 fix(telegram): preserve command slots for aliases (#85270)
* fix(telegram): preserve command slots for aliases

* fix: report Telegram alias command overflow

* fix: preserve Telegram alias menu order

* docs: drop release-owned changelog entry

---------

Co-authored-by: wuyangfan <yangfan.wu@succaiss.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-26 22:24:03 +01:00
Peter Steinberger
94fb547fe2 fix(agents): handle deferred maintenance drain
Ensure deferred context-engine maintenance rejects cleanly when the gateway command queue is draining, including coalesced active-run requests. This prevents budget compaction from treating an unscheduled deferred maintenance run as successful and leaving the context engine alive.

Verification:
- pnpm exec oxfmt --check --threads=1 src/process/command-queue.ts src/agents/pi-embedded-runner/compact.queued.ts src/agents/pi-embedded-runner/context-engine-maintenance.ts src/agents/pi-embedded-runner/context-engine-maintenance.test.ts
- pnpm test src/auto-reply/reply/agent-runner-memory.test.ts src/agents/pi-embedded-runner/compact.hooks.test.ts src/agents/pi-embedded-runner/context-engine-maintenance.test.ts src/tasks/task-flow-registry.store.test.ts src/auto-reply/reply/commands-compact.test.ts src/agents/pi-embedded-runner/compact-reasons.test.ts
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
- GitHub Actions CI run 26475226442: relevant Node/Linux, lint, type, security, CodeQL, OpenGrep, Socket, Real behavior proof, and build jobs passed; Windows job failed before tests due current runner image Node 22.19.0 vs required 24.x, matching current main infra failure.
2026-05-26 22:17:19 +01:00
Peter Steinberger
72bc429f60 test: keep legacy tool-result error proof 2026-05-26 22:13:19 +01:00
Peter Steinberger
b546998b9b ci: fix post-merge Rastermill checks 2026-05-26 22:11:50 +01:00
Peter Steinberger
8523d3268a fix(agents): mark repaired legacy tool results errored 2026-05-26 17:01:12 -04:00
Peter Steinberger
acb942f634 fix: keep EXIF normalization best-effort (#86923) 2026-05-26 21:55:57 +01:00