Commit Graph

32467 Commits

Author SHA1 Message Date
Vincent Koc
a3fa5b6577 test(vitest): classify Crabbox shared dependencies 2026-05-31 19:31:17 +02:00
zhang-guiping
b6e9473e9f fix(auth): skip Anthropic API keys for usage status
Fixes #85124.

Anthropic standard API keys no longer resolve as provider usage auth for `openclaw status --usage`, so valid inference keys are not sent to Anthropic's OAuth usage endpoint and surfaced as misleading invalid bearer-token errors.

The provider usage-auth SDK result now has an explicit handled/no-token shape so provider hooks can suppress generic fallback without widening the OAuth helper contract. Docs, Plugin SDK API baseline, and extension package-boundary cache inputs were updated with the new contract.

Thanks @zhangguiping-xydt.

Proof:
- node scripts/run-vitest.mjs src/infra/provider-usage.auth.normalizes-keys.test.ts src/infra/provider-usage.auth.plugin.test.ts extensions/anthropic/index.test.ts
- pnpm plugin-sdk:api:check
- pnpm plugin-sdk:check-exports
- git diff --check origin/main...HEAD
- pnpm docs:list
- pnpm run test:extensions:package-boundary:compile
- autoreview clean: no accepted/actionable findings
- PR CI rollup green: 131 success, 22 skipped, 1 neutral, 0 failures

Co-authored-by: 张贵萍0668001030 <zhang.guiping@xydigit.com>
2026-05-31 18:26:03 +01:00
Peter Steinberger
1a65425a6e refactor: extract ACP translator session updates
Extract ACP translator session-update and event-ledger emission into a dedicated helper. Keeps translator orchestration intact while preserving replay, recording, and fallback behavior.\n\nProof: focused ACP translator tests, narrow oxlint, pnpm check:test-types, autoreview clean, PR CI green.
2026-05-31 18:24:26 +01:00
Rain
301f17fb58 fix(agents): validate context engine assemble result shape
Validate context-engine assemble results at the shared harness boundary before embedded or Codex runners consume them.

Malformed plugins that return an object without a `messages` array now throw a descriptive engine-scoped error and use the existing runner fallback to pipeline messages, rather than poisoning session state and crashing prompt assembly on `.length`.

Proof:
- `node scripts/run-vitest.mjs src/agents/harness/context-engine-lifecycle.test.ts`
- `node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts`
- `pnpm exec oxfmt --check src/agents/harness/context-engine-lifecycle.ts src/agents/harness/context-engine-lifecycle.test.ts`
- `git diff --check origin/main...HEAD`
- GitHub CI on `5b6b7b1bf69b8f30329fdf749161a192d3d016fe`: https://github.com/openclaw/openclaw/actions/runs/26719202811

Thanks @Pluviobyte.

Fixes #75541
2026-05-31 18:21:59 +01:00
wAngByg
6c5cd7177f fix(doctor): detect stale gateway service version metadata 2026-05-31 18:17:30 +01:00
Peter Steinberger
6f2fbaaaf8 fix(gateway): track plugin subagent runs in agent handler
Plugin SDK subagent runs now register at the Gateway agent acceptance boundary so subagent_ended hooks fire without creating duplicate CLI task rows.

The registration stays best-effort: if the subagent registry cannot persist tracking state, the run still dispatches and falls back to the existing CLI task tracking path.

Closes #59164

Co-authored-by: Cornna <96944678+ymylive@users.noreply.github.com>
2026-05-31 18:16:00 +01:00
Vincent Koc
938841cff3 fix(agents): count stream deltas incrementally
Count model stream diagnostic response bytes from snapshotless stream chunks, excluding accumulated partial snapshots on delta events. This avoids repeatedly serializing answer-so-far snapshots during streamed model calls and updates OTEL/docs wording for the new metric baseline.

Refs #86599.

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-05-31 18:13:58 +01:00
Peter Steinberger
a053ae5d65 test: align release CI expectations 2026-05-31 18:13:02 +01:00
Peter Steinberger
33c246dbba refactor: move plugin state slices to sqlite
* refactor: move plugin state slices to sqlite

* fix: keep legacy plugin state migration out of runtime

* fix: add doctor migrations for plugin sqlite state

* fix: preserve teams feedback learning migration keys

* fix: merge teams legacy feedback learnings

* fix: guard doctor imports against plugin state caps

* fix: leave lossy teams learning filenames unmigrated

* fix: preserve teams feedback learning scope

* fix: load plugin doctor contracts from package dist

* fix: satisfy plugin state migration gates
2026-05-31 18:09:27 +01:00
Peter Steinberger
12d4dda1bb perf(plugins): avoid duplicate provider hook load probes
Avoid duplicate provider hook load probes.

Summary:
- Route provider hook-list resolution through the existing provider resolver skip path instead of pre-checking provider load state separately.
- Preserve the provider runtime in-flight/reentrant guard because existing tests prove it prevents cached misses and nested provider-load recursion.

Verification:
- node scripts/run-vitest.mjs src/plugins/providers.runtime.consult-current-snapshot.test.ts
- node scripts/run-vitest.mjs src/plugins/provider-runtime.test.ts
- node scripts/run-vitest.mjs src/plugins/providers.test.ts
- pnpm exec oxfmt --check src/plugins/providers.runtime.ts src/plugins/provider-hook-runtime.ts
- git diff --check
- pnpm changed:lanes --json
- autoreview --mode local --prompt-file /tmp/provider-hotpath-cleanup-review.md
- Live E2E: https://github.com/openclaw/openclaw/actions/runs/26718818705
2026-05-31 18:08:13 +01:00
Peter Steinberger
f80a1e9e85 refactor: clean up ACP translator and manager tests (#88677)
* test: split ACP translator bridge coverage

* refactor: extract ACP translator session helpers

* refactor: extract ACP manager backend failover helpers

* test: split ACP manager failover coverage

* test: split ACP manager runtime config coverage

* test: split ACP manager turn result coverage

* test: split ACP manager runtime handle coverage

* test: keep ACP manager helpers within task boundaries

* ci: split gateway runtime state test shard
2026-05-31 18:04:28 +01:00
alkor2000
3ceaafb2b3 fix: extend CA bundle auto-injection to all 8 Node version managers
Expand Linux CA bundle auto-injection to recognize fnm, Volta, asdf, mise, n, nodenv, nodebrew, and nvs paths in addition to nvm. Adds regression coverage for the new version-manager path layouts.

Fixes #59494.
Thanks @alkor2000.

Co-authored-by: alkor2000 <200923177@qq.com>
2026-05-31 18:02:34 +01:00
Vincent Koc
0f6be951e0 fix(agents): avoid full stream replay on text deltas (#88252)
Prevent streaming assistant text updates from reparsing the full accumulated reply for plain deltas, avoiding repeated work for small-model streams while preserving full cleanup for directives, media, and final events.

Also load the normal Control UI Vite config in the mock browser server so browser E2E uses the same workspace aliases as dev.

Thanks @vincentkoc.
2026-05-31 17:59:45 +01:00
alkor2000
723d09ff85 fix(cli): extend holiday tagline dates through 2030
Extend the CLI holiday tagline tables for Lunar New Year, Eid al-Fitr, Easter, Diwali, and Hanukkah through 2030 so those taglines do not silently disappear after 2027.

Maintainer fixup: corrected the 2030 Diwali row to October 25 and added explicit regression coverage for that date.

Verification:
- node scripts/run-vitest.mjs src/cli/tagline.test.ts
- Direct pickTagline() probe confirmed 2030-10-25 activates Diwali and 2030-10-26 does not.

Co-authored-by: alkor2000 <200923177@qq.com>
2026-05-31 17:59:43 +01:00
Peter Steinberger
4150c6ff82 feat: add typed MCP code-mode API (#88678)
* feat: add typed MCP code-mode API

* fix: stabilize code-mode namespace drain

* fix: preserve code-mode run cap

* fix: reserve code-mode snapshot capacity
2026-05-31 17:51:22 +01:00
Peter Steinberger
d1b514af2e fix: remove webchat config surface 2026-05-31 12:49:18 -04:00
Masato Hoshino
3ef02ca818 fix(plugins): reuse current metadata snapshot in provider hot paths
Refactor provider metadata lookup so hot paths consult the current process snapshot before falling back to a metadata load.

Centralize provider metadata lookup in the provider runtime and update the focused tests/mocks that exercise embedded-agent and provider loading paths.

Verification:
- node scripts/run-vitest.mjs src/plugins/providers.runtime.consult-current-snapshot.test.ts
- node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/attempt.cwd-split.test.ts
- node scripts/run-vitest.mjs src/plugins/providers.test.ts
- autoreview --mode branch --base origin/main
- CPU profile loop: current-snapshot resolve 0.459 us/call vs warm direct metadata load 131.493 us/call
- GitHub CI on 728bd53510

Co-authored-by: masatohoshino <g515hoshino@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 17:48:58 +01:00
Jerry-Xin
4e84d0eaa5 fix(auto-reply): track memory flush failure exhaustion
Add durable memoryFlush failure metadata and lifecycle events so provider failures during memory flush no longer leave a session with no recorded recovery state.

After three consecutive non-abort flush failures, mark the current compaction cycle as exhausted so later messages can proceed without deleting transcript history. Successful flushes clear the failure metadata, and plugin session-entry slot reservations now protect the new fields.

Release-note: memoryFlush sessions can now fail open after repeated provider-side flush failures instead of retrying indefinitely before normal replies.

Refs #85645

Co-authored-by: 忻役 <xinyi@mininglamp.com>
2026-05-31 17:47:12 +01:00
Peter Steinberger
1af4c035e4 refactor: move delivery queues to SQLite (#88665)
* refactor: move delivery queues to sqlite

* fix: satisfy delivery queue sqlite boundaries

* test: remove stale reasoning replay assertion

* fix: migrate failed delivery queue entries

* test: stabilize exec shell snapshot mocks

* fix: clean legacy delivery queue markers
2026-05-31 17:43:03 +01:00
Yuval Dinodia
be29096081 fix(agents): resolve Codex static-catalog cold start
Fixes Codex/plugin-harness cold starts for exact static-catalog model ids such as openai/gpt-5.3-codex without adding a second resolver retry loop. The embedded runner now performs the normal provider-runtime attempt with agent discovery skipped, then consults the bundled static catalog before falling back to generic configured-provider synthesis when plugin harness owns transport.

The OpenAI static catalog row carries the Codex ChatGPT transport metadata, dynamic provider metadata still wins for runtime-owned models, and focused regression coverage exercises both paths.

Fixes #88510.

Co-authored-by: yetval <yetvald@gmail.com>
2026-05-31 17:38:10 +01:00
litang9
d446c26acb feat(deepseek): show provider balance in usage status
Show DeepSeek API-key account balance in status/auth-status usage surfaces by adding a summary-only provider usage snapshot path, a DeepSeek balance fetcher, SDK/docs coverage, and focused regression tests.

Maintainer verification accepted the additive provider-usage/status contract and the DeepSeek balance visibility boundary for authenticated status surfaces.

Proof:
- Live DeepSeek balance proof via 1Password-backed DEEPSEEK_API_KEY against https://api.deepseek.com/user/balance; key and balance amount redacted.
- GitHub CI run 26717953383 passed on the current head.
- Real behavior proof run 26718215605 passed after the PR body was refreshed.
- Local clean PR clone: git diff --check; node --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check; node scripts/run-vitest.mjs run src/agents/bash-tools.exec.path.test.ts.

Co-authored-by: Alex Tang <tangli1987118@hotmail.com>
Co-authored-by: litang9 <141409885+litang9@users.noreply.github.com>
2026-05-31 17:35:41 +01:00
vortexopenclaw
fa0a323ebd fix(secrets): treat Codex app-server marker as non-secret
Treat the synthetic Codex app-server auth marker as a core non-secret marker so secrets audit does not flag it when bundled plugin discovery is disabled.\n\nVerified with focused model-auth marker tests, isolated secrets-audit CLI proof, autoreview, and green CI.\n\nThanks @vortexopenclaw.
2026-05-31 17:35:13 +01:00
Ron Cohen
5152d8beb4 fix(whatsapp): suppress silent-run typing indicators
Suppress WhatsApp typing indicators only for silent message-tool-only unmentioned group runs. Automatic visible replies and authorized group commands still show composing normally.

Fixes the autoreview regression risk by narrowing suppressTyping and adding coverage for both silent and visible group paths.

Proof:
- pnpm test src/auto-reply/reply/reply-utils.test.ts extensions/whatsapp/src/auto-reply/monitor/inbound-dispatch.test.ts
- .agents/skills/autoreview/scripts/autoreview --mode local
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
- CI run 26717880577 green

Thanks @Bluetegu.
2026-05-31 17:28:58 +01:00
Gavin Zeng
4ab2eb45d0 fix(doctor): repair stale session snapshot paths
Fixes #85689.

Summary:
- Repair stale bundled skill paths in inline prompts, prompt blobs, resolved skill metadata, and resolved skill sourceInfo metadata.
- Keep repair scoped to cached snapshot fields and preserve unrelated session content.
- Replace the root reproduction script with colocated Vitest coverage.

Verification:
- pnpm test src/commands/doctor-session-snapshots.test.ts -- --reporter=verbose
- pnpm check:test-types
- pnpm lint --threads=8
- pnpm dup:check:coverage
- pnpm tsgo:prod
- pnpm check:changed (Testbox tbx_01kszd25ad7x81j0f1r7kfsqc6, Actions run 26717761222)
- PR CI green on 540b1a387e

Co-authored-by: GavinZ <zengganghui@zgh123.space>
2026-05-31 17:24:29 +01:00
samzong
5b310a7b27 fix(agents): release abandoned provider streams
Fix streamed provider cleanup so abandoned managed fetch bodies no longer keep undici sockets open, and cancel Anthropic/Gemini SSE readers deterministically when parsing exits early.

Keep the FinalizationRegistry abort path as a last-resort GC safety net for unmanaged/abandoned responses, while parser-owned paths cancel readers explicitly on thrown errors or malformed events.

Also records the browser-only Control UI redactor alias in the optional deadcode allowlist and keeps mocked exec supervisor tests off shell snapshot wrapping after the branch was rebased onto default shell snapshots.

Fixes #67461

Verification:
- node scripts/run-vitest.mjs src/agents/provider-transport-fetch.test.ts src/agents/anthropic-transport-stream.test.ts extensions/google/transport-stream.test.ts src/agents/bash-tools.test.ts src/agents/bash-tools.exec.path.test.ts test/scripts/test-live-shard.test.ts
- pnpm check:test-types
- node scripts/run-oxlint-shards.mjs --threads=8
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --parallel-tests "node scripts/run-vitest.mjs src/agents/provider-transport-fetch.test.ts src/agents/anthropic-transport-stream.test.ts extensions/google/transport-stream.test.ts src/agents/bash-tools.test.ts src/agents/bash-tools.exec.path.test.ts test/scripts/test-live-shard.test.ts"
- git diff --check origin/main...HEAD
- PR CI on a1db789652

Co-authored-by: samzong <samzong.lu@gmail.com>
Signed-off-by: samzong <samzong.lu@gmail.com>
2026-05-31 17:17:53 +01:00
Peter Steinberger
fbfbe45fc6 fix(agents): use static shell snapshot temp prefix 2026-05-31 17:12:24 +01:00
Peter Steinberger
71a516d644 ci: narrow legacy webchat migration value 2026-05-31 12:07:36 -04:00
Syu
63621eead2 fix(discord): route thread bindings to plugin owners
Route Discord thread follow-up messages to plugin-owned bindings by the raw thread id while retaining parent channel fallback matching. This fixes `/codex bind` follow-ups in Discord threads being claimed by the parent OpenClaw route instead of the bound Codex session.

Verification:
- `node scripts/run-vitest.mjs extensions/discord/src/channel.conversation.test.ts src/hooks/message-hook-mappers.test.ts extensions/discord/src/monitor/message-handler.process.test.ts -t "prefers bound session keys|passes Discord thread parent only|routes Discord thread plugin-owned bindings|passes thread parent ids|thread binding"`
- `node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts -t "routes Discord thread plugin-owned bindings by raw thread id"`
- `pnpm build`
- `pnpm lint --threads=8`
- `CI=true FORCE_COLOR=0 pnpm lint --threads=8`
- `.agents/skills/autoreview/scripts/autoreview --mode local`
- GitHub: Real behavior proof, check-test-types, check-dependencies, check-prod-types, auto-reply dispatch shard, hooks shard, and extension package boundary passed on head 1e896d9835.

Known unrelated CI noise at merge: broad opengrep/test/lint CI failures are outside the touched Discord/session-binding surface and contradicted by focused local proof where applicable.

Co-authored-by: Hex <hex@openclaw.ai>
2026-05-31 17:03:55 +01:00
Peter Steinberger
6f4ba7c80e ci: fix acp spawn defaults lint 2026-05-31 12:00:09 -04:00
Peter Steinberger
d07f508020 fix: retire webchat channel config 2026-05-31 11:58:54 -04:00
Vincent Koc
9850ee65c9 test(doctor): cache default command in e2e 2026-05-31 17:50:38 +02:00
Peter Steinberger
a3c6164a8d test: add ACP spawn defaults live Docker test 2026-05-31 16:46:20 +01:00
Franco Viotti
a71b121c69 fix(googlechat): preserve thread for message tool replies (#80996)
Use the Google Chat thread resource as the ambient message-tool reply target so replies stay in the inbound thread. Normalize the current Google Chat space target and let plugin threading adapters explicitly suppress the generic message-id fallback when a provider needs a thread resource instead of a message resource.

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Franco Viotti <franco-viotti@users.noreply.github.com>
2026-05-31 16:43:46 +01:00
Peter Steinberger
210adf1d11 fix(agents): retry transient stale session locks
Follow-up to #88658. Retries transient stale session-lock acquire failures when diagnostics show the old stale report disappeared, was replaced by a fresh valid lock, or was replaced by a fresh payload-less lock still inside the mtime/orphan grace window.

Preserves typed `SessionWriteLockStaleError` diagnostics for still-present live OpenClaw-owned stale locks.

Proof: 53 focused session-write-lock tests passed locally and in the agents-core CI shard; `pnpm tsgo:test:src`, touched-file oxlint, `git diff --check`, and autoreview passed locally. CI run 26716843811 has unrelated failures in UI deadcode/types and bash-tools tests; session-write-lock tests passed in that run.

Refs #87217.
2026-05-31 16:41:37 +01:00
clawSean
51228aecd4 fix(sms): cover native proof follow-ups (#88601)
Remove the duplicate plain approve command from pairing replies so SMS/native pairing shows one copyable owner approval command in the fenced block.

Add regression coverage for the single approve-command occurrence, plus Twilio guarded-egress release coverage for non-2xx and malformed-success send responses.

Verification:
- pnpm exec oxfmt --check src/pairing/pairing-messages.ts src/pairing/pairing-messages.test.ts extensions/sms/src/twilio.test.ts
- node scripts/run-vitest.mjs src/pairing/pairing-messages.test.ts src/pairing/pairing-challenge.test.ts src/plugin-sdk/channel-pairing.test.ts
- node scripts/run-vitest.mjs extensions/sms/src/twilio.test.ts

Thanks @clawSean.
2026-05-31 16:41:24 +01:00
Peter Steinberger
63de51ab96 refactor(cron): clarify sqlite store internals 2026-05-31 16:38:49 +01:00
Peter Steinberger
b9dc3c3894 perf: trim tui startup and refresh work 2026-05-31 16:30:04 +01:00
Vincent Koc
a52c4d101a perf(agents): avoid full setup registry for runtime aliases 2026-05-31 17:14:09 +02:00
Peter Steinberger
4ef141d525 fix(agents): prevent embedded runtime shadowing 2026-05-31 16:13:01 +01:00
Peter Steinberger
1955f42bfe fix(outbound): route source replies through configured channels 2026-05-31 16:12:52 +01:00
Peter Steinberger
cd3b467f3c refactor(cron): split tool and doctor repair helpers 2026-05-31 16:11:45 +01:00
Peter Steinberger
45ab822918 perf: reduce tui refresh work 2026-05-31 16:10:09 +01:00
Peter Steinberger
6b1b2ff20a feat: default exec shell snapshots 2026-05-31 16:09:43 +01:00
Peter Steinberger
972d2b66d1 fix(cron): guard flat atMs canonicalization 2026-05-31 16:02:06 +01:00
Peter Steinberger
a84819a639 refactor(cron): keep runtime on canonical sqlite rows 2026-05-31 16:02:06 +01:00
Peter Steinberger
7b78941ea5 refactor: clean up ACP package metadata and helpers (#88659)
* refactor: derive acp core package subpath maps

* refactor: split acp manager task and timeout helpers

* refactor: split acp translator presentation helpers

* fix: keep packaged acp core plugin aliases

* ci: split gateway control plane runtime shard
2026-05-31 15:53:14 +01:00
Peter Steinberger
8f941ea0ac fix(telegram): preserve usage footer for tool-only replies
Route implicit message_tool_only current-source sends through the internal source-reply sink for non-webchat transports, preserving the final reply payload path where usage decoration runs. Also keep reply payload metadata when appending usage text so transcript mirror text matches the delivered footer-bearing reply.

Recreated from PR #87425 because the fork branch is draft, dirty against main, and not maintainer-pushable.

Co-authored-by: Gio Della-Libera <giodl73@gmail.com>
2026-05-31 15:51:41 +01:00
Vincent Koc
b334e7ef29 fix(agents): avoid alias setup load for matching refs 2026-05-31 16:48:27 +02:00
Vincent Koc
4d135ae28b fix(agents): preserve runtime tools in lean mode (#88381)
fix(agents): preserve runtime tools in lean mode

Keep runtime-required tools, especially `message`, available when local-model lean filtering is enabled. This preserves `forceMessageTool`, `message_tool_only` source replies, explicit runtime allowlists, and schema projection without disabling lean filtering for ordinary denied tools.

Proof: focused Vitest passed 190 tests; `git diff --check origin/main...HEAD` passed; PR CI had no failing or pending checks.
2026-05-31 15:43:48 +01:00
xiaotian
f547ea7668 fix(messages): use best-effort for implicit tool-only source replies (#84232)
fix(messages): use best-effort for implicit tool-only source replies

Preserve durable required-send semantics for explicit non-current targets while allowing current-source `message_tool_only` replies to be delivered through best-effort outbound sends. This fixes Slack source replies that otherwise fail when the adapter has no `reconcileUnknownSend` hook.

Fixes #84078.
2026-05-31 15:41:30 +01:00