Commit Graph

31181 Commits

Author SHA1 Message Date
Peter Steinberger
2bbef6caac fix: route nested root help targets 2026-05-27 08:22:01 +01:00
Peter Steinberger
5f6293a902 fix: route root help targets to command help 2026-05-27 08:22:01 +01:00
Peter Steinberger
b31c9e9810 fix: preserve root options in generated help 2026-05-27 08:22:01 +01:00
Peter Steinberger
ec377dd079 fix: support plugin generated help targets 2026-05-27 08:22:01 +01:00
Peter Steinberger
1de98487cc fix: route generated help targets to subcommands 2026-05-27 08:22:01 +01:00
Peter Steinberger
9015d0c582 fix: normalize generated help self-help 2026-05-27 08:22:01 +01:00
Peter Steinberger
f407e4e498 fix: validate gateway call timeouts 2026-05-27 08:22:01 +01:00
Peter Steinberger
84b11237f2 fix: let skills JSON output flush naturally 2026-05-27 08:22:01 +01:00
Peter Steinberger
ef2ebeef89 fix: keep root help plugin descriptor loading quiet 2026-05-27 08:22:01 +01:00
Super Zheng
6790b0f792 perf(secrets): propagate snapshots and eliminate esm side-effects in auth env vars (#86439)
* perf(secrets): propagate snapshots and eliminate esm side-effects in auth env vars

* perf(secrets): reuse provider auth lookup maps

* test(auth): update provider env var mocks

* test(auth): cover rebased provider env mocks

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-27 08:19:07 +01:00
Peter Steinberger
f327df866c test: stabilize main ci lanes 2026-05-27 08:07:13 +01:00
Peter Steinberger
54eca3fb56 perf(gateway): keep agent session working store active-only 2026-05-27 08:00:24 +01:00
Vincent Koc
497685111b fix(doctor): warn on unsupported active tool schemas 2026-05-27 08:55:49 +02:00
Peter Steinberger
368469688b test: fix main ci expectations 2026-05-27 07:55:01 +01:00
Peter Steinberger
3b9fa16862 perf(gateway): borrow agent session lookup safely 2026-05-27 07:44:56 +01:00
Peter Steinberger
8c8162f1f7 perf(gateway): borrow read-only session metadata 2026-05-27 07:32:29 +01:00
xin zhuang
152f68d037 fix(gateway): persist model auth profile suffixes
Persist trailing `/model ...@profile` suffixes through the gateway session patch path so documented per-session credential pinning reaches the session entry. Strip the suffix before model resolution so bare allowlisted model IDs still infer their configured provider, and mark same-model profile-only changes as pending live model switches.

Closes #87099.

Verification:
- `npx oxfmt --check src/sessions/model-overrides.ts src/sessions/model-overrides.test.ts src/gateway/sessions-patch.ts src/gateway/sessions-patch.test.ts`
- `node scripts/run-vitest.mjs src/gateway/sessions-patch.test.ts src/sessions/model-overrides.test.ts`
- `npx oxlint src/sessions/model-overrides.ts src/sessions/model-overrides.test.ts src/gateway/sessions-patch.ts src/gateway/sessions-patch.test.ts`
- `/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/main`
- `gh pr checks 87123 --watch --fail-fast`

Co-authored-by: xin zhuang <65798732+1052326311@users.noreply.github.com>
2026-05-27 07:29:02 +01:00
Josh Avant
3349fe21bb Fix embedded session file ownership race (#87159)
* fix: serialize embedded session file attempts

* test: update reply runtime mock for session file lookup

* fix: thread session files into diagnostic recovery

* fix: attach causes to session owner abort errors
2026-05-26 23:18:27 -07:00
Sanjay Santhanam
1710dac5eb fix(pi-embedded): route Codex OAuth compaction through OpenAI-Codex
Fix Codex OAuth-backed OpenAI compaction routing by separating the configured provider from the runtime auth provider, preserving same-provider fallback auth, and keeping OpenAI context policy lookup intact. Also preserves the original cause when sessions.send reports A2A fallback failure. Fixes #86373.
2026-05-27 07:14:02 +01:00
Coy Geek
ce64d74e5a fix(commands): enforce /allowlist configWrites origin policy
Summary:
- Enforces /allowlist config and pairing-store writes against the real command origin plus the selected target.
- Adds regressions for disabled Telegram-origin commands targeting an enabled Discord allowlist.

Verification:
- node scripts/run-vitest.mjs src/auto-reply/reply/commands-allowlist.test.ts
- pnpm check:changed via Blacksmith Testbox tbx_01ksm06e82dnpxmnj00hrt6xzd
- autoreview --mode local clean, no accepted/actionable findings
- GitHub PR checks green on 42a38d2b00

Closes #72360.
Thanks @coygeek.

Co-authored-by: Coy Geek <65363919+coygeek@users.noreply.github.com>
Co-authored-by: opencode <opencode@users.noreply.github.com>
2026-05-27 07:10:50 +01:00
Dallin Romney
780bc79147 fix(plugin-sdk): stop exporting vitest test helpers (#87120) 2026-05-26 23:10:41 -07:00
Peter Steinberger
9c2a6a8df5 perf(gateway): borrow session reads on turn hot paths 2026-05-27 07:02:00 +01:00
keshavbotagent
455d5e807c fix(reply): keep visible turn admission unbounded (#87044)
Remove the hidden 15s default from reply-run idle waits so visible user turns do not inherit cleanup-settle behavior while waiting behind an active same-session reply operation.

Keep the 15s timeout explicit for queued follow-up retry/defer paths and interrupt/reset cleanup waits, and add reply-admission regressions for both visible and queued follow-up behavior. Also preserve the original cause on a nearby sessions-send fallback error to keep current lint green after rebasing onto main.

Thanks @keshavbotagent.

Co-authored-by: Keshav's Bot <keshavbotagent@gmail.com>
2026-05-27 07:01:46 +01:00
Vincent Koc
798691779b fix(agents): preserve sessions fallback errors 2026-05-27 07:54:24 +02:00
Vincent Koc
e7214efbb7 test(core): isolate provider and approval tests 2026-05-27 07:54:24 +02:00
Vincent Koc
8c644ee611 fix(agents): quarantine unsupported tool schemas 2026-05-27 07:54:24 +02:00
Agustin Rivera
2c88547254 fix(prompt): route untrusted group prompts outside system prompt [AI] (#87144)
* fix(prompt): route untrusted group prompts outside system prompt

* fix(prompt): align untrusted group prompt helpers
2026-05-26 22:47:54 -07:00
Pablo Guardiola
0c867eef75 feat: expose plugin approval action metadata
Expose plugin approval action metadata so plugins can describe richer approval actions across gateway, SDK, channel, and UI surfaces.
2026-05-26 22:46:09 -07:00
Peter Steinberger
b9f6abf5e8 fix: bind plugin command llm auth to host agent 2026-05-27 06:38:35 +01:00
Andy Ye
81e7e8ef24 fix: handle sessions_send active fallback failures (#86638)
Fix run-scoped sessions_send active-run fallback handling.

- surface active queue rejection plus durable fallback admission failures instead of returning accepted too early
- return fallback run/session metadata so normal A2A announcement waits on the fallback run
- retry active steering without transcript-commit waiting when the active runtime does not support it

Thanks @TurboTheTurtle.

Verification:
- node scripts/run-vitest.mjs src/agents/openclaw-tools.sessions.test.ts
- pnpm check:test-types
- git diff --check
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
2026-05-27 06:30:56 +01:00
Agustin Rivera
ae972fe1fe fix(gateway): enable default auth rate limiting (#87148)
* fix(gateway): enable default auth rate limiting

* fix(gateway): update auth rate limit changelog
2026-05-26 22:29:33 -07:00
Dallin Romney
9772cf202c test(media): isolate generation provider registry mocks (#87173) 2026-05-26 22:27:58 -07:00
Peter Steinberger
0762acae86 perf(gateway): skip lifecycle session cache clone 2026-05-27 06:26:53 +01:00
Peter Steinberger
f348284fa9 fix(daemon): avoid workgroup schtasks user prompts 2026-05-27 06:17:27 +01:00
MoerAI
d92a33306e fix(daemon): keep Windows Scheduled Task running on battery power (#59299)
The Windows Gateway daemon crashes (or rather is killed by Task Scheduler) every time the laptop unplugs from AC power. Reporter on Windows 10 22H2 documented a 100% failure rate.

Root cause: `activateScheduledTask` in `src/daemon/schtasks.ts` used `schtasks /Create` with CLI flags (`/SC ONLOGON /RL LIMITED /TR ...`). That CLI surface cannot set `<DisallowStartIfOnBatteries>` or `<StopIfGoingOnBatteries>`, so the task inherits the Task Scheduler defaults (both `true`), which prevent the task from starting on battery and stop it when AC power is lost mid-run.

This change switches `/Create` to `/Create /XML <tempfile>` and emits a Task Scheduler XML payload that mirrors the prior CLI flags (ONLOGON trigger, LeastPrivilege run level, InteractiveToken logon when a `taskUser` is resolved, single-instance policy, no idle restrictions, exec action wired to the existing `gateway.cmd` / `gateway.vbs` launcher) AND sets:

  <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
  <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>

The XML is written as UTF-16 LE with a BOM, which is what `schtasks /XML` expects on all Windows locales. The temp file is cleaned up in a `finally` block.

The same XML re-apply is also issued from `updateExistingScheduledTask` after the existing `/Change /TR` call, so users upgrading from older versions inherit the new battery flags on the next gateway install/refresh instead of staying broken until a full uninstall+reinstall.

This follows clawsweeper's direction on #59299: "Land a narrow Windows Scheduled Task settings repair that lets the Gateway task start and continue on battery while preserving the current Startup-folder fallback, hidden launcher, quoting, and update behavior."

Preserved unchanged:
- Startup-folder fallback when `/Create` is denied or times out
- Hidden launcher (.vbs) selection via `OPENCLAW_WINDOWS_TASK_HIDDEN_LAUNCHER`
- `quoteSchtasksArg` quoting strategy for the script launch path
- `/Change` update path semantics (still updates `/TR` first)
- All `runScheduledTaskOrThrow` and fallback launch behavior downstream

Verification:
- `node scripts/run-vitest.mjs src/daemon/schtasks.install.test.ts` — 12 passed (incl. 2 new battery-flag regression tests)
- `node scripts/run-vitest.mjs src/daemon/schtasks.test.ts src/daemon/schtasks.startup-fallback.test.ts src/daemon/schtasks.stop.test.ts src/daemon/schtasks-exec.test.ts` — 54 passed (sibling daemon coverage)
- `pnpm tsgo:core` — passed (production typecheck)

Closes #59299
2026-05-27 06:17:27 +01:00
Peter Steinberger
b75f70bc04 perf(gateway): avoid cloning live switch store reads 2026-05-27 06:15:18 +01:00
Jesse Merhi
42f0822bfa fix(exec): hide unavailable durable approval actions (#86359)
* fix(macos): align ask always approval actions

* fix(macos): harden approval prompt decisions

* fix(ui): satisfy approval action lint

* fix(infra): settle jsonl sockets on close

* fix(ui): explain unavailable durable approvals

* test(macos): document legacy approval fallback
2026-05-27 14:58:11 +10:00
Alex Knight
2899560a6b fix(reply): derive explicit control command turns
Derive explicit source-reply command turns from authorized control-command bodies when legacy command source metadata is missing.

Preserve native/text structured command semantics, keep unauthorized native commands and structured normal command bodies on plugin-owned fallback paths, and pass bot username normalization through the derived detection.

Co-authored-by: Alex Knight <aknight@atlassian.com>
2026-05-27 05:57:04 +01:00
Andy Ye
2e3b4b58a1 test(agents): cover cold default model alias resolution
Adds regression coverage for provider-qualified default models with aliasless configured model entries.

Refs #86635

Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com>
2026-05-27 05:47:14 +01:00
Peter Steinberger
5371b96af1 fix: prefer trusted argv runtime fallback roots 2026-05-27 05:46:51 +01:00
Peter Steinberger
e71b6f7e57 fix: expand startup argv runtime fallback hints 2026-05-27 05:46:51 +01:00
Peter Steinberger
2b9be22c0b fix: keep plugin runtime fallback on startup root 2026-05-27 05:46:51 +01:00
Peter Steinberger
78b2aeeae4 test: cover plugin runtime diagnostic context 2026-05-27 05:46:51 +01:00
Andy Ye
66a8262028 Fix runtime fallback startup argv default 2026-05-27 05:46:51 +01:00
Andy Ye
41fa603aa8 Fix plugin runtime module resolution diagnostics 2026-05-27 05:46:51 +01:00
Andy Tien
8246e91e92 fix(ui): show config open failure feedback (#87108)
Fixes #87020.

Summary:
- Surface config.openFile failures in the Control UI instead of silently doing nothing.
- Return actionable gateway errors for headless opener failures, including the config path.
- Add gateway and UI controller regression coverage for the failed-open path.

Verification:
- node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-methods.config.ts src/gateway/server-methods/config.test.ts --reporter=dot
- node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/ui/controllers/config.test.ts --reporter=dot
- pnpm check:changed via Blacksmith Testbox tbx_01ksktydqx6mk3n20yevcbkwtn
- autoreview --mode local

Thanks @Linux2010.

Co-authored-by: Linux2010 <35169750+Linux2010@users.noreply.github.com>
2026-05-27 05:45:45 +01:00
Peter Steinberger
8fa4fad3a7 perf(gateway): skip duplicate turn session touch 2026-05-27 05:28:10 +01:00
Peter Steinberger
1c8a11265b test: avoid repeated module reloads in unit tests 2026-05-27 05:24:40 +01:00
zhang-guiping
608fa52c80 fix(media): keep explicit workspace roots scoped
Fixes MEDIA delivery for agent workspaces named `workspace-*` by carrying the explicit resolved workspace directory into scoped outbound media local roots. The unscoped default local media boundary remains closed for `workspace-*` sibling directories.

Proof:
- node scripts/run-vitest.mjs src/media/read-capability.test.ts src/media/local-media-access.test.ts
- pnpm exec oxfmt --write --threads=1 src/media/read-capability.ts src/media/read-capability.test.ts src/media/local-media-access.test.ts
- node scripts/run-vitest.mjs src/media/read-capability.test.ts src/media/local-media-access.test.ts src/auto-reply/reply/reply-media-paths.test.ts
- /Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/main

Fixes #86879.
2026-05-27 05:24:07 +01:00
Sebastien Tardif
4980c32846 fix(agents): recover failed subagent lifecycle completions
Recover failed subagent lifecycle completions through a shared retry/resume recovery path.

Proof:
- node scripts/run-vitest.mjs src/agents/subagent-registry.test.ts src/agents/subagent-registry.lifecycle-retry-grace.e2e.test.ts
- pnpm changed:lanes --json
- pnpm check:changed (Blacksmith Testbox tbx_01ksksytyrfxscxs78e8f3eegk)
- .agents/skills/autoreview/scripts/autoreview --mode local

Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
2026-05-27 05:18:58 +01:00