Commit Graph

22633 Commits

Author SHA1 Message Date
Peter Steinberger
910cb9f1af refactor: simplify provider auth storage setters 2026-03-27 17:23:40 +00:00
Peter Steinberger
67f609ea9a refactor: remove core provider model definitions compat 2026-03-27 17:23:40 +00:00
Peter Steinberger
3628451aa3 refactor: move provider default model refs into extension apis 2026-03-27 17:23:40 +00:00
Peter Steinberger
94780dde5d refactor: reduce provider auth storage boilerplate 2026-03-27 17:23:40 +00:00
Peter Steinberger
b568ccee7c refactor: route litellm sdk through public api barrel 2026-03-27 17:23:40 +00:00
Peter Steinberger
3702409427 refactor: trim remaining plugin sdk extension seams 2026-03-27 17:23:40 +00:00
Peter Steinberger
e599cb26de refactor: route provider catalogs through public api barrels 2026-03-27 17:23:40 +00:00
Altay
4693813503 fix: re-format exec-approval view 2026-03-27 19:51:36 +03:00
Altay
c352a018f1 chore: add lockfile entry for extensions 2026-03-27 19:50:46 +03:00
Peter Steinberger
ef1784d264 refactor: move bundled plugin policy into manifests 2026-03-27 16:40:27 +00:00
Peter Steinberger
ed055f44ae refactor: route plugin runtime through bundled seams 2026-03-27 16:40:27 +00:00
Peter Steinberger
e425056aa3 refactor: route plugin runtime media through sdk wrappers 2026-03-27 16:39:42 +00:00
Peter Steinberger
425032ed4d refactor: move public artifact metadata into plugins 2026-03-27 16:39:42 +00:00
Peter Steinberger
07df59287a refactor: share plugin capability provider resolution 2026-03-27 16:39:41 +00:00
Peter Steinberger
f1503bd5c7 refactor: route bundled capability providers through plugin runtime 2026-03-27 16:39:41 +00:00
Peter Steinberger
8d054e7892 test: move shared seams into contract suites 2026-03-27 16:33:53 +00:00
Peter Steinberger
09f2832670 test: split contract seams from unit lane 2026-03-27 16:28:23 +00:00
Peter Steinberger
89267f4273 test: finish reply seam cleanup 2026-03-27 16:22:27 +00:00
Radek Sienkiewicz
ce5b0577d4 docs: fix Browserless and broken doc links (#55881)
Merged via squash.

Prepared head SHA: 528d04e070
Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com>
Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com>
Reviewed-by: @velvet-shark
2026-03-27 17:11:57 +01:00
Peter Steinberger
8ff39007c4 test: remove moved core duplicates 2026-03-27 16:08:57 +00:00
Peter Steinberger
cd92549119 test: split extension-owned core coverage 2026-03-27 16:08:57 +00:00
Josh Avant
6ade9c474c feat(hooks): add async requireApproval to before_tool_call (#55339)
* Plugins: add native ask dialog for before_tool_call hooks

Extend the before_tool_call plugin hook with a requireApproval return field
that pauses agent execution and waits for real user approval via channels
(Telegram, Discord, /approve command) instead of relying on the agent to
cooperate with a soft block.

- Add requireApproval field to PluginHookBeforeToolCallResult with id, title,
  description, severity, timeout, and timeoutBehavior options
- Extend runModifyingHook merge callback to receive hook registration so
  mergers can stamp pluginId; always invoke merger even for the first result
- Make ExecApprovalManager generic so it can be reused for plugin approvals
- Add plugin.approval.request/waitDecision/resolve gateway methods with
  schemas, scope guards, and broadcast events
- Handle requireApproval in pi-tools via two-phase gateway RPC with fallback
  to soft block when the gateway is unavailable
- Extend the exec approval forwarder with plugin approval message builders
  and forwarding methods
- Update /approve command to fall back to plugin.approval.resolve when exec
  approval lookup fails
- Document before_tool_call requireApproval in hooks docs and unified
  /approve behavior in exec-approvals docs

* Plugins: simplify plugin approval code

- Extract mergeParamsWithApprovalOverrides helper to deduplicate param
  merge logic in before_tool_call hook handling
- Use idiomatic conditional spread syntax in toolContext construction
- Extract callApprovalMethod helper in /approve command to eliminate
  duplicated callGateway calls
- Simplify plugin approval schema by removing unnecessary Type.Union
  with Type.Null on optional fields
- Extract normalizeTrimmedString helper for turn source field trimming

* Tests: add plugin approval wiring and /approve fallback coverage

Fix 3 broken assertions expecting old "Exec approval" message text.
Add tests for the /approve command's exec→plugin fallback path,
plugin approval method registration and scope authorization, and
handler factory key verification.

* UI: wire plugin approval events into the exec approval overlay

Handle plugin.approval.requested and plugin.approval.resolved gateway
events by extending the existing exec approval queue with a kind
discriminator. Plugin approvals reuse the same overlay, queue management,
and expiry timer, with branched rendering for plugin-specific content
(title, description, severity). The decision handler routes resolve calls
to the correct gateway method based on kind.

* fix: read plugin approval fields from nested request payload

The gateway broadcasts plugin approval payloads with title, description,
severity, pluginId, agentId, and sessionKey nested inside the request
object (PluginApprovalRequestPayload), not at the top level. Fix the
parser to read from the correct location so the overlay actually appears.

* feat: invoke plugin onResolution callback after approval decision

Adds onResolution to the requireApproval type and invokes it after
the user resolves the approval dialog, enabling plugins to react to
allow-always vs allow-once decisions.

* docs: add onResolution callback to requireApproval hook documentation

* test: fix /approve assertion for unified approval response text

* docs: regenerate plugin SDK API baseline

* docs: add changelog entry for plugin approval hooks

* fix: harden plugin approval hook reliability

- Add APPROVAL_NOT_FOUND error code so /approve fallback uses structured
  matching instead of fragile string comparison
- Check block before requireApproval so higher-priority plugin blocks
  cannot be overridden by a lower-priority approval
- Race waitDecision against abort signal so users are not stuck waiting
  for the full approval timeout after cancelling a run
- Use null consistently for missing pluginDescription instead of
  converting to undefined
- Add comments explaining the +10s timeout buffer on gateway RPCs

* docs: document block > requireApproval precedence in hooks

* fix: address Phase 1 critical correctness issues for plugin approval hooks

- Fix timeout-allow param bug: return merged hook params instead of
  original params when timeoutBehavior is "allow", preventing security
  plugins from having their parameter rewrites silently discarded.

- Host-generate approval IDs: remove plugin-provided id field from the
  requireApproval type, gateway request, and protocol schema. Server
  always generates IDs via randomUUID() to prevent forged/predictable
  ID attacks.

- Define onResolution semantics: add PluginApprovalResolutions constants
  and PluginApprovalResolution type. onResolution callback now fires on
  every exit path (allow, deny, timeout, abort, gateway error, no-ID).
  Decision branching uses constants instead of hard-coded strings.

- Fix pre-existing test infrastructure issues: bypass CJS mock cache for
  getGlobalHookRunner global singleton, reset gateway mock between tests,
  fix hook merger priority ordering in block+requireApproval test.

* fix: tighten plugin approval schema and add kind-prefixed IDs

Harden the plugin approval request schema: restrict severity to
enum (info|warning|critical), cap timeoutMs at 600s, limit title
to 80 chars and description to 256 chars. Prefix plugin approval
IDs with `plugin:` so /approve routing can distinguish them from
exec approvals deterministically instead of relying on fallback.

* fix: address remaining PR feedback (Phases 1-3 source changes)

* chore: regenerate baselines and protocol artifacts

* fix: exclude requesting connection from approval-client availability check

hasExecApprovalClients() counted the backend connection that issued
the plugin.approval.request RPC as an approval client, preventing
the no-approval-route fast path from firing in headless setups and
causing 120s stalls. Pass the caller's connId so it is skipped.
Applied to both plugin and exec approval handlers.

* Approvals: complete Discord parity and compatibility fallback

* Hooks: make plugin approval onResolution non-blocking

* Hooks: freeze params after approval owner is selected

* Gateway: harden plugin approval request/decision flow

* Discord/Telegram: fix plugin approval delivery parity

* Approvals: fix Telegram plugin approval edge cases

* Auto-reply: enforce Telegram plugin approval approvers

* Approvals: harden Telegram and plugin resolve policies

* Agents: static-import gateway approval call and fix e2e mock loading

* Auto-reply: restore /approve Telegram import boundary

* Approvals: fail closed on no-route and neutralize Discord mentions

* docs: refresh generated config and plugin API baselines

---------

Co-authored-by: Václav Belák <vaclav.belak@gendigital.com>
2026-03-27 09:06:40 -07:00
Peter Steinberger
351a931a62 fix(ci): restore runtime-api guardrails 2026-03-27 15:56:54 +00:00
Sally O'Malley
df5b9ef0c6 update podman setup and docs (#55388)
* update podman setup and docs

Signed-off-by: sallyom <somalley@redhat.com>

* podman: persist runtime env defaults

Co-authored-by: albertxos <kickban3000@gmail.com>
Signed-off-by: sallyom <somalley@redhat.com>

* podman: harden env and path handling, other setup updates

Signed-off-by: sallyom <somalley@redhat.com>

* podman: allow symlinked home path components

Signed-off-by: sallyom <somalley@redhat.com>

* update podman docs

Signed-off-by: sallyom <somalley@redhat.com>

---------

Signed-off-by: sallyom <somalley@redhat.com>
Co-authored-by: albertxos <kickban3000@gmail.com>
2026-03-27 11:47:35 -04:00
Ayaan Zaidi
5e8db468ff fix(agents): preserve embedded auth on HTTP fallback 2026-03-27 21:15:15 +05:30
Peter Steinberger
9098e948ac fix(ci): route extension tests through public test bridges 2026-03-27 15:20:01 +00:00
Peter Steinberger
833636f0b2 style(ui): normalize control-ui formatting 2026-03-27 15:15:40 +00:00
Peter Steinberger
6a0f9afc4e style: normalize test and sdk formatting 2026-03-27 15:15:04 +00:00
Peter Steinberger
8ddeada97d test: move extension-owned coverage into plugins 2026-03-27 15:11:33 +00:00
Peter Steinberger
97297049e7 fix(ci): restore boundary and test seams 2026-03-27 15:08:33 +00:00
Ayaan Zaidi
454f094c36 fix: avoid source imports in cli startup metadata build 2026-03-27 20:31:28 +05:30
junpei.o
be0e994cf0 feat(plugins): expose runId in agent hook context (#54265) 2026-03-27 10:47:13 -04:00
Peter Steinberger
87dddb818d fix(ci): restore plugin runtime boundaries 2026-03-27 14:38:40 +00:00
bottenbenny
f9b8499bf6 fix(chat): send button should use system theme variables (#55075)
Merged via squash.

Prepared head SHA: eb3e197874
Co-authored-by: bottenbenny <270688955+bottenbenny@users.noreply.github.com>
Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com>
Reviewed-by: @velvet-shark
2026-03-27 15:12:19 +01:00
Peter Steinberger
66a2e72bee fix: restore CI runtime seams 2026-03-27 14:07:01 +00:00
Ping
a6f5e57f46 fix(plugins): apply bundled allowlist compat in plugin status report (#55267)
* fix(plugins): apply bundled allowlist compat in plugin status report

`buildPluginStatusReport` (used by `openclaw plugins list` and
`openclaw doctor`) was calling `loadOpenClawPlugins` without applying
`withBundledPluginAllowlistCompat`. When `plugins.allow` is set, the
allowlist check in `resolveEffectiveEnableState` runs before the
bundled-default-enable check, causing all bundled plugins not explicitly
in the allowlist to be reported as "disabled".

The gateway runtime already applies this compat via
`providers.runtime.ts`, so the actual loaded state differs from what
CLI diagnostics report.

Apply the same `withBundledPluginAllowlistCompat` transform so the
status report matches gateway runtime behavior.

* add regression test for bundled allowlist compat wiring

Address review feedback: the previous mocks were identity stubs that
did not exercise the compat wiring. Now the mocks are spies, and a new
test verifies that:
1. loadPluginManifestRegistry is called to discover bundled plugin IDs
2. withBundledPluginAllowlistCompat receives only bundled IDs (not workspace)
3. loadOpenClawPlugins receives the compat-adjusted config

* scope compat to bundled providers only (address codex review)

Use resolveBundledProviderCompatPluginIds instead of injecting all
bundled plugin IDs. This matches the runtime compat surface in
providers.runtime.ts — non-provider bundled plugins (device-pair,
phone-control, etc.) are not auto-added to the allowlist, keeping
the status report consistent with gateway startup behavior.
2026-03-27 10:00:25 -04:00
Tak Hoffman
c2ca99aa0b fix(test-planner): keep exit fallback timer referenced 2026-03-27 09:00:09 -05:00
Val Alexander
bb932beeac Media: respect umask and clean failed downloads 2026-03-27 08:55:06 -05:00
Val Alexander
206c29514c Media: enforce file mode after writes 2026-03-27 08:55:06 -05:00
助爪
b1c982bb2d fix(agents): fail over and sanitize Codex server_error payloads (#42892)
Merged via squash.

Prepared head SHA: 6db9a5f02d
Co-authored-by: xaeon2026 <264572156+xaeon2026@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-03-27 16:51:39 +03:00
Peter Steinberger
546a1aad98 refactor: replace plugin-sdk dist env hacks with loader option 2026-03-27 13:46:17 +00:00
Peter Steinberger
ad89fa669c fix: unstick provider contract tests 2026-03-27 13:46:17 +00:00
Peter Steinberger
b5a8d5a230 fix: stabilize plugin-sdk test loading 2026-03-27 13:46:17 +00:00
Peter Steinberger
9d10a2e242 refactor: shrink remaining test seam reach-ins 2026-03-27 13:46:17 +00:00
Peter Steinberger
f217a10780 refactor: route more runtime-boundary tests through public seams 2026-03-27 13:46:17 +00:00
Peter Steinberger
9917f3b3a1 refactor: route ollama sdk through public barrels 2026-03-27 13:46:17 +00:00
Peter Steinberger
858b1dffb8 refactor: route zalouser payload mocks through test api 2026-03-27 13:46:17 +00:00
Peter Steinberger
b70b99d46d refactor: route telegram gateway test through test api 2026-03-27 13:46:17 +00:00
Peter Steinberger
e42b4afd39 refactor: route reply plumbing test through slack entry 2026-03-27 13:46:17 +00:00
Peter Steinberger
d0c77c9dfd refactor: narrow outbound payload runtime mock reach-ins 2026-03-27 13:46:17 +00:00