Commit Graph

31682 Commits

Author SHA1 Message Date
Peter Steinberger
ed62aefeee refactor(gateway): centralize handshake timeout parsing 2026-05-29 05:56:21 -04:00
Peter Steinberger
82a16d2fee fix: alias net policy in plugin loader 2026-05-29 10:47:27 +01:00
Peter Steinberger
7d76e54f2b fix: honor cron backoff from run end 2026-05-29 05:36:50 -04:00
Peter Steinberger
8ac0c35462 fix(prompts): reject unsafe template indexes 2026-05-29 05:36:15 -04:00
Vincent Koc
49807ac1f1 refactor: share plugin http dispatch helpers 2026-05-29 11:32:14 +02:00
Peter Steinberger
75c011b606 fix(subagents): ignore unsafe log limits 2026-05-29 05:29:50 -04:00
Vincent Koc
c7127c7c34 test(doctor): satisfy legacy migration lint 2026-05-29 11:28:32 +02:00
拐爷&&老拐瘦
f634062f35 fix(cron): quarantine malformed persisted jobs
Quarantine malformed persisted cron rows before sanitizing active jobs.json.
Preserve raw malformed rows plus split runtime metadata in jobs-quarantine.json so later cron writes cannot silently delete recoverable data.
Doctor now reports quarantine sidecars for manual review.

Closes #51871.
Thanks @yfge.

Verification:
- pnpm test src/cron/service/store.test.ts src/cron/service/store.load-missing-session-target.test.ts src/cron/store.test.ts src/commands/doctor-cron-store-migration.test.ts src/commands/doctor-cron.test.ts ui/src/ui/controllers/cron-filters.test.ts ui/src/ui/controllers/cron.test.ts ui/src/ui/app-render.helpers.node.test.ts ui/src/ui/app-settings.refresh-active-tab.node.test.ts
- node scripts/run-tsgo.mjs -p tsconfig.core.json --files src/cron/store.ts src/cron/service/store.ts src/cron/service/state.ts src/commands/doctor-cron.ts && node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --files src/cron/store.test.ts src/cron/service/store.test.ts src/cron/service/store.load-missing-session-target.test.ts src/commands/doctor-cron.test.ts src/commands/doctor-cron-store-migration.test.ts
- node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/cron/store.ts src/cron/service/store.ts src/cron/service/state.ts src/commands/doctor-cron.ts src/cron/store.test.ts src/cron/service/store.test.ts src/cron/service/store.load-missing-session-target.test.ts src/commands/doctor-cron.test.ts src/commands/doctor-cron-store-migration.test.ts
- git diff --check
- pnpm docs:list
- autoreview clean: no accepted/actionable findings reported
- GitHub CI: cron, doctor, docs, lint/type/build/security/quality, real behavior proof, and Windows rerun green; checks-node-agentic-agents remains red on current PR and recent main with unrelated pre-existing module/mock failures outside touched files.

Co-authored-by: yfge <geyunfei@gmail.com>
2026-05-29 10:27:45 +01:00
Peter Steinberger
c3e02d9fd4 fix(models): ignore unsafe page tokens 2026-05-29 05:22:55 -04:00
Peter Steinberger
57a3dbe736 perf: avoid jiti for built plugin startup paths 2026-05-29 10:17:43 +01:00
兰之
6950e85605 fix(agents): allow hyphenated subagent task names
Allow `sessions_spawn.taskName` to accept lowercase hyphenated task slugs while keeping the existing underscore support and invalid-name rejection. Update the tool schema, system prompt wording, docs, focused tests, and generated prompt snapshots so the user/model-facing contract matches the validator.

Verification:
- `pnpm prompt:snapshots:check`
- `node scripts/run-vitest.mjs src/agents/tools/sessions-spawn-tool.test.ts src/agents/system-prompt.test.ts`
- Real behavior proof gate: https://github.com/openclaw/openclaw/actions/runs/26628449324/job/78470916945
- PR CI: https://github.com/openclaw/openclaw/actions/runs/26628441940, with failures matching current `main` at https://github.com/openclaw/openclaw/actions/runs/26628128225

Co-authored-by: chenhaoqiang <chenhaoqiang@xiaomi.com>
Co-authored-by: Lanzhi <lizhan3@xiaomi.com>
2026-05-29 10:10:12 +01:00
兰之
30c1ca5c7b fix: match slash commands case-insensitively
Match text slash command names case-insensitively across the reset/new fallback paths and the shared registry/control detection contract while preserving command argument casing.

Add regression coverage for uppercase and mixed-case reset/new commands plus registered non-reset commands such as `/STATUS`, `/Model`, `/T`, and `/COMPACT`.

Co-authored-by: zhangtong26 <zhangtong26@xiaomi.com>
Co-authored-by: Lanzhi <lizhan3@xiaomi.com>
2026-05-29 10:06:53 +01:00
Peter Steinberger
274a8116af fix(session): reject unsafe lifecycle durations 2026-05-29 05:06:26 -04:00
Peter Steinberger
c951867a21 test(release): satisfy doctor migration lint 2026-05-29 10:04:42 +01:00
litang9
18f9310844 fix(gateway): clear stale chat stream buffers (#75089)
Merged via squash.

Prepared head SHA: 05ca0e30ac

Verification:
- gh pr checks 75089 --required --watch --fail-fast: dependency-guard passed.
- node scripts/run-vitest.mjs src/gateway/chat-abort.test.ts src/gateway/server-maintenance.test.ts src/gateway/server-close.test.ts src/gateway/server-methods/models-auth-status.test.ts src/gateway/server-methods/chat.abort-authorization.test.ts: 9 files, 136 tests passed on the rebased clean head.
- pnpm build and pnpm check passed after the rebase.
- Local live-style Gateway WebSocket RPC proof passed with a mock OpenAI Responses SSE provider.

Co-authored-by: litang9 <tangli1987118@hotmail.com>
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
Reviewed-by: @osolmaz
2026-05-29 17:01:42 +08:00
Peter Steinberger
d506e9e666 fix(subagents): keep numeric log targets from shrinking history 2026-05-29 05:00:18 -04:00
Vincent Koc
9e002c12ac fix(video): bound generated video downloads 2026-05-29 11:00:06 +02:00
兰之
b620c58e65 fix: remove telegram-only reasoning stream copy
Remove stale Telegram-only wording from the reasoning stream acknowledgement and docs so channel-neutral behavior is reflected.

Fixes #68305.

Co-authored-by: Lanzhi <lizhan3@xiaomi.com>
2026-05-29 09:54:37 +01:00
Peter Steinberger
2e015ab124 test(release): fix beta live release checks 2026-05-29 09:54:00 +01:00
Rajvardhan Patil
5518ac998f fix(agents): add CLI turn output digests
Adds content-safe output fingerprints to CLI backend turn logs so repeated byte-identical responses can be detected from gateway logs without exposing response text.

Covers Claude live-session turns, synthetic cron before_agent_reply short-circuits, and ordinary CLI subprocess turns with shared outBytes/outHash fields.

Verification:
- pnpm test src/agents/cli-runner.spawn.test.ts src/agents/cli-runner.before-agent-reply-cron.test.ts -- --reporter=verbose
- pnpm check:changed (Blacksmith Testbox tbx_01kssdqes22wqhas0v7h339zr7)
- .agents/skills/autoreview/scripts/autoreview --mode local
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
- GitHub PR checks passed for e130c1acbf

Fixes #81004

Co-authored-by: Rajvardhan Patil <raj@Rajvardhans-MacBook-Air.local>
2026-05-29 09:50:56 +01:00
Peter Steinberger
25b3c8ef71 refactor: remove old net policy sources 2026-05-29 09:45:14 +01:00
Peter Steinberger
f4c6c0aec4 refactor: extract net policy package 2026-05-29 09:45:14 +01:00
Phil
00ca654c74 fix(plugins): persist resolved npm install specs
Preserve npm install selectors while recording resolved npm provenance for plugin and hook install/update records. Active `record.spec` stays the requested selector unless explicitly pinned, while resolved npm fields remain available for audit and diagnostics.

Adds focused coverage for hook-pack npm fallback provenance after the maintainer review found that path worth pinning down.

Co-authored-by: Phil <99397913+GitHoubi@users.noreply.github.com>
2026-05-29 09:42:46 +01:00
Chunyue Wang
fb6f2c61bf fix(auto-reply): deliver compact replies in room events
Restore visible terminal command replies for explicit command turns that are otherwise source-suppressed in room-event/message-tool-only delivery. Also keep compaction notifyUser notices independent from internal callbacks while preserving hook-message de-duplication.

Fixes #87107

Verification:
- git diff --check origin/main...HEAD
- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/get-reply-inline-actions.skip-when-config-empty.test.ts src/auto-reply/reply/agent-runner-execution.test.ts
- GitHub required check dependency-guard passed on d3aaad90fc
- Relevant GitHub auto-reply/build/lint/type/security checks passed on d3aaad90fc

Co-authored-by: openperf <16864032@qq.com>
2026-05-29 09:35:19 +01:00
Peter Steinberger
def11c0978 fix(plugins): bound config contract array indexes 2026-05-29 04:29:14 -04:00
Peter Steinberger
d4a17477b0 fix(schema): reject noncanonical array refs 2026-05-29 04:25:10 -04:00
Peter Steinberger
b78ebacb18 refactor: centralize plugin model discovery 2026-05-29 09:24:08 +01:00
Jayesh Betala
189a7962b2 fix(cli): reject empty config path segments
Reject malformed dot-notation config paths before `openclaw config get/set/unset` reads or mutates config. Empty, leading, trailing, whitespace-only, and dot-before-bracket segments now fail closed instead of normalizing to a different key, while valid bracket paths and escaped dots continue to work.

Thanks @jbetala7 for the fix.

Verification:
- `git diff --check`
- `node scripts/run-vitest.mjs run src/cli/config-cli.test.ts` (111 passed)
- GitHub exact-head checks on `116254ba414bff6a0c3881e34fad30baca95ef0a`: 76 success, 23 skipped, 1 neutral, 0 failures

Fixes #87564

Co-authored-by: Jayesh Betala <jayesh.betala7@gmail.com>
2026-05-29 09:23:32 +01:00
Peter Steinberger
5ff0c75da7 fix(config): preserve large numeric schema keys 2026-05-29 04:20:42 -04:00
Ninty
ee6eab8143 fix(agents): clean up exec abort listener after completion (#83022)
Clean up completed exec tool-call abort listeners so normal foreground completion and background-yield no longer retain the exec run/session context through AbortSignal listener state.

The listener cleanup now lives beside the exec listener registration and runs when the foreground process settles, rejects, or the tool returns a background running result. Existing abort/timeout/background behavior remains owned by the process supervisor and process registry.

Verification:
- gh pr checks 83022
- gh api repos/openclaw/openclaw/commits/fe86528ecb2043b6febef5c2eec53f9124be5543/check-runs
- git merge-tree --write-tree origin/main refs/remotes/pr/83022
- git diff --check origin/main...refs/remotes/pr/83022
- node AbortSignal add/remove listener probe

Thanks @c19354837.

Co-authored-by: Ninty <c19354837@hotmail.com>
2026-05-29 09:15:07 +01:00
Syu
843577f69a test(tasks): cover legacy flow run migration edge cases
Add regression coverage for legacy and hybrid flow_runs SQLite migrations, including post-rebuild managed writes and canonical owner_key schema assertions.\n\nVerification:\n- node scripts/run-vitest.mjs src/tasks/task-flow-registry.store.test.ts\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
2026-05-29 09:15:01 +01:00
Jayesh Betala
2990c00cb5 fix(skills): tolerate BOM-prefixed frontmatter
Fixes #66479.

Workspace skills whose SKILL.md starts with a UTF-8 BOM now keep their shared markdown frontmatter metadata, so they remain discoverable through skills list. The fix strips one leading BOM at the parser boundary and adds parser plus workspace discovery regression coverage.

Thanks @jbetala7 for the fix.

Co-authored-by: Jayesh Betala <jayesh.betala7@gmail.com>
2026-05-29 09:10:21 +01:00
Peter Steinberger
35cdd40182 fix(cli): reject unsafe duration values 2026-05-29 04:06:56 -04:00
Pavan Kumar Gondhi
9497629c1e fix(msteams): pin attachment fetch DNS
Route Microsoft Teams attachment downloads through the shared SSRF guarded fetch path so DNS validation is pinned into the dispatcher used for the actual request.

Keep Teams auth fallback and allowlisted HTTPS Authorization redirect behavior while failing closed for custom fetch hooks that cannot accept dispatcher injection.

Verification:
- CI=1 OPENCLAW_VITEST_MAX_WORKERS=1 timeout 300 node scripts/run-vitest.mjs run extensions/msteams/src/attachments/shared.test.ts extensions/msteams/src/attachments/bot-framework.test.ts src/infra/net/fetch-guard.ssrf.test.ts
- gh pr checks 87567 --repo openclaw/openclaw --watch=false

PR: #87567
2026-05-29 09:03:50 +01:00
Vincent Koc
0fbd975fe8 test(infra): avoid host-specific exec path fixtures 2026-05-29 09:49:49 +02:00
Abdel Gomez-Perez
9de6abd8d7 fix(agents): bridge CLI tool progress events 2026-05-29 13:04:31 +05:30
Vincent Koc
d78b0814d5 fix(gateway): avoid cold-loading providers for MCP inventory 2026-05-29 08:48:35 +02:00
Peter Steinberger
8e56c024df fix(gateway): cap handshake timer delays 2026-05-29 02:38:45 -04:00
Peter Steinberger
4829d30cf0 fix(mattermost): bound slash callback env port 2026-05-29 02:31:53 -04:00
ZC
7a381b807e fix(cron): preflight model fallbacks before skip (#82887)
Fix cron local-model preflight fallback handling so scheduled runs try configured fallback candidates before skipping when the local primary is unavailable.

Verification:
- GitHub CI on PR head fe884dab90: passing required CI checks.
- Local focused cron/model fallback tests passed earlier for the touched surface.
- Local merge-wrapper build and check passed on the prepared candidate.
- Local full pnpm test reported unrelated failures outside this PR's touched files; touched files are limited to cron docs, src/agents/model-fallback.ts, and src/cron/isolated-agent/*.

Co-authored-by: chen-zhang-cs-code <chenzhangcode@163.com>
Co-authored-by: Onur Solmaz <2453968+osolmaz@users.noreply.github.com>
2026-05-29 14:29:26 +08:00
Ayaan Zaidi
c559776c51 fix(channels): preserve room event progress suppression 2026-05-29 11:56:58 +05:30
Ayaan Zaidi
f9b1132bbb test(channels): cover suppressed group progress callbacks 2026-05-29 11:56:58 +05:30
Peter Lindsey
85b6f91bd7 fix(dispatch): forward channel-owned progress callbacks in all chat types when verbose is off
Remove the chatType === 'direct' guard from
shouldAllowQuietChannelOwnedProgressCallbacks so that channel-owned native
progress callbacks (onToolStart, onItemEvent, onPlanUpdate,
onApprovalEvent, onCommandOutput, onPatchSummary, onCompactionStart/End)
are forwarded in group and group-channel sessions when verbose is off.

Previously the guard required chatType === 'direct', which meant that
/verbose off would suppress all progress callbacks in group sessions
while direct sessions continued to relay them. Message-level tool
summary suppression is handled separately; native channel relay hooks
should not be gated on chat type.

Closes #87612
2026-05-29 11:56:58 +05:30
Peter Steinberger
0f0c744517 fix(config): bound gateway env ports 2026-05-29 02:26:01 -04:00
Peter Steinberger
625b793635 fix(daemon): centralize tcp port bounds 2026-05-29 02:22:03 -04:00
YEEE
aa53823981 fix(whatsapp): resolve auth dir from active profile (#82492)
Merged via squash.

Prepared head SHA: 82b1404905
Co-authored-by: lidge-jun <243035832+lidge-jun@users.noreply.github.com>
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Reviewed-by: @mcaxtr
2026-05-29 03:20:26 -03:00
Rob Pierson
b474f429ee feat(plugin-sdk): add reply payload sending hook (#82823)
* feat(plugin-sdk): add reply payload sending hook

* fix(dispatch): compose caller beforeDeliver with plugin hooks instead of nullish-coalescing

ClawSweeper review identified that Telegram's identity beforeDeliver
would skip reply_payload_sending and message_sending hooks entirely.
Now we always compose caller-provided hooks with global plugin hooks
so plugins get a chance to run even when the caller already supplies
a beforeDeliver hook.

Also adds regression test for composition case.

* test(dispatch): align beforeDeliver hook assertion with current context

* fix(plugin-sdk): remove leftover merge markers from hook types

* feat(plugin-sdk): add reply payload sending hook

* fix(plugin-sdk): protect reply payload media trust

* fix(auto-reply): honor suppressed routed ACP blocks

* fix(auto-reply): avoid double message sending hooks

* fix(auto-reply): require routed reply kind

* test(auto-reply): type routed suppression mock

* fix(auto-reply): honor reply payload hooks in followups

* fix(auto-reply): suppress empty hooked dispatcher replies

* fix(auto-reply): wire reply payload hooks at dispatcher boundary

* fix(plugins): preserve reply payload metadata in hooks

* fix(auto-reply): defer reply hook availability checks

* fix(auto-reply): preserve message hook order for routed payloads

* fix(auto-reply): persist routed payload hook decisions

* fix(auto-reply): run routed payload hooks inside delivery

* fix(auto-reply): enforce message hooks after payload edits

* fix(auto-reply): gate source reply mirrors on delivery

* fix(auto-reply): scope hook-mutated media delivery

* chore(plugin-sdk): refresh reply hook api baseline

* fix(auto-reply): mirror delivered source replies

---------

Co-authored-by: Rob via OpenClaw <noreply@openclaw.local>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-29 07:15:10 +01:00
Peter Steinberger
8d63d466b8 fix(infra): preserve inline option values 2026-05-29 02:12:59 -04:00
Galin Iliev
8124fb4aa4 fix(gateway): cache single session row child indexes
Cache single-row gateway session child indexes without hiding live subagent registry changes.

Summary:
- Reuses store-derived child-session candidates for repeated single-row session loads.
- Keeps runtime subagent registry reads live per row so moved child sessions do not stay attached to stale parents.
- Versions the session-store cache and includes that version in the single-row cache key so same-object store rewrites cannot reuse stale child candidates.
- Adds focused regression coverage for cache reuse, live registry refresh, and same-object session-store writes.

Verification:
- git diff --check
- pnpm tsgo:prod
- pnpm test src/gateway/session-utils.single-row-cache.test.ts src/gateway/session-utils.subagent.test.ts -- --reporter=verbose
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
- GitHub CI run 26620265206: passing
- Azure Crabbox cbx_a58389e50f49: single-row-loads 13.622240 ms before vs 1.869456 ms after, 7.29x speedup, 86.3% reduction
2026-05-28 23:09:10 -07:00
Peter Steinberger
f212176e91 fix(azure): preserve equals in deployment maps 2026-05-29 02:03:03 -04:00