Commit Graph

151 Commits

Author SHA1 Message Date
Peter Steinberger 760c4be438 feat(agents): add provider-owned system prompt contributions 2026-04-05 14:05:41 +01:00
Vincent Koc 4613f121ad fix(agents): preserve native Anthropic replay tool ids (#61254)
* fix(agents): preserve native Anthropic replay tool ids

* docs(changelog): note native Anthropic replay ids

* fix(agents): preserve native Anthropic replay ids selectively
2026-04-05 09:53:52 +01:00
Peter Steinberger e3ac0f43df feat(qwen): add qwen provider and video generation 2026-04-04 19:34:56 +01:00
Peter Steinberger fb0d60d7f3 fix: resolve MiniMax portal usage auth 2026-04-04 12:42:30 +01:00
Peter Steinberger bbb0b574c4 refactor: centralize gateway method policy helpers 2026-04-04 20:07:18 +09:00
Peter Steinberger b167ad052c refactor(providers): move defaults and error policy into plugins 2026-04-04 07:43:14 +01:00
Peter Steinberger ae7942bf5e fix: prefer Claude CLI in Anthropic onboarding 2026-04-04 14:49:55 +09:00
Peter Steinberger eb9051cc7c refactor(openai): move native transport policy into extension 2026-04-04 04:27:14 +01:00
Peter Steinberger a23ab9b906 refactor: move voice-call realtime providers into extensions 2026-04-04 12:07:23 +09:00
Peter Steinberger 58d2b9dd46 fix: add runtime model contextTokens caps 2026-04-04 09:36:53 +09:00
Peter Steinberger a38cb20177 feat(openai): add default prompt overlay 2026-04-04 09:27:07 +09:00
Peter Steinberger ab96520bba refactor(plugins): move channel behavior into plugins 2026-04-03 19:09:20 +01:00
Vincent Koc ed297eb8b9 fix(providers): align cache-ttl anthropic semantics (#60375) 2026-04-04 00:22:32 +09:00
Josh Lehman 799c6f40aa refactor: move provider replay runtime ownership into plugins (#60126)
* refactor: move provider replay runtime ownership into plugins

* fix(provider-runtime): address review followups

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-03 23:14:37 +09:00
Peter Steinberger 49936f6066 refactor: move ollama synthetic auth precedence into extension 2026-04-03 21:25:02 +09:00
Josh Lehman 2b28e75822 fix: enrich session_end lifecycle hooks (#59715)
Merged via squash.

Prepared head SHA: b3ef62b97358d2d6aa52a0512f081174caf4ed7b
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-03 00:16:14 -07:00
Josh Lehman ed8d5b3797 fix: add Telegram native progress placeholder opt-in for plugin commands (#59300)
Merged via squash.

Prepared head SHA: 4f5bc22a89b29a407ec8c317a3aedd860ab2579a
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-02 15:55:46 -07:00
Vincent Koc b0f94a227b refactor(providers): normalize transport policy wiring (#59682)
* refactor(providers): normalize transport policy wiring

* fix(providers): address transport policy review

* fix(providers): harden transport overrides

* fix(providers): keep env proxy tls separate

* fix(changelog): note provider transport policy hardening
2026-04-02 22:54:34 +09:00
Vincent Koc 6eca1949d5 refactor(plugins): tighten web fetch provider boundary (#59646)
* refactor(plugins): tighten web fetch provider boundary

* fix(config): sync fetch secret parity and baseline

* fix(ci): enforce web fetch boundary guard
2026-04-02 20:53:57 +09:00
Vincent Koc 38d2faee20 !feat(plugins): add web fetch provider boundary (#59465)
* feat(plugins): add web fetch provider boundary

* feat(plugins): add web fetch provider modules

* refactor(web-fetch): remove remaining core firecrawl fetch config

* fix(web-fetch): address review follow-ups

* fix(web-fetch): harden provider runtime boundaries

* fix(web-fetch): restore firecrawl compare helper

* fix(web-fetch): restore env-based provider autodetect

* fix(web-fetch): tighten provider hardening

* fix(web-fetch): restore fetch autodetect and compat args

* chore(changelog): note firecrawl fetch config break
2026-04-02 20:25:19 +09:00
joshavant c22233d96c Revert "refactor(plugins): remove before_install hook" 2026-04-01 19:57:07 -05:00
Josh Lehman 71346940ad refactor: add provider replay runtime hook surfaces (#59143)
Merged via squash.

Prepared head SHA: 56b41e87a5d6d6df4d0a978c3b44d536790d036b
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-01 13:45:41 -07:00
Joshua Lelon Mitchell 7cb323d84f feat(plugins): add before_agent_reply hook (claiming pattern) (#20067)
Merged via squash.

Prepared head SHA: e40dfbdfb9a66debccb3ef80c7092f76d1db97a5
Co-authored-by: JoshuaLelon <23615754+JoshuaLelon@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-01 13:31:11 -07:00
Josh Lehman 90eb5b073f fix: pass session identity to plugin commands (#59044)
Merged via squash.

Prepared head SHA: 0f7a23f139437ac549519f137054a6fb77a3bf4e
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-01 13:07:17 -07:00
Vincent Koc fcb802e826 refactor(plugins): remove before_install hook 2026-04-01 02:28:06 +09:00
Peter Steinberger 8bf8baef87 Revert "refactor: move tasks into bundled plugin"
This reverts commit c75f4695b7.
2026-04-01 01:30:22 +09:00
Peter Steinberger c75f4695b7 refactor: move tasks into bundled plugin 2026-03-31 15:22:08 +01:00
Vincent Koc 8dfbcaa200 fix(ci): default local low-memory checks 2026-03-31 15:05:04 +09:00
fuller-stack-dev 235908c30e fix: support multi-kind plugins for dual slot ownership (#57507) (thanks @fuller-stack-dev)
* feat(plugins): support multi-kind plugins for dual slot ownership

* fix: address review feedback on multi-kind plugin support

- Use sorted normalizeKinds() for kind-mismatch comparison in loader.ts
  (fixes order-sensitive JSON.stringify for arrays)
- Derive slot-to-kind reverse mapping from SLOT_BY_KIND in slots.ts
  (removes hardcoded ternary that would break for future slot types)
- Use shared hasKind() helper in config-state.ts instead of inline logic

* fix: don't disable dual-kind plugin that still owns another slot

When a new plugin takes over one slot, a dual-kind plugin that still
owns the other slot must not be disabled — otherwise context engine
resolution fails at runtime.

* fix: exempt dual-kind plugins from memory slot disablement

A plugin with kind: ["memory", "context-engine"] must stay enabled even
when it loses the memory slot, so its context engine role can still load.

* fix: address remaining review feedback

- Pass manifest kind (not hardcoded "memory") in early memory gating
- Extract kindsEqual() helper for DRY kind comparison in loader.ts
- Narrow slotKeyForPluginKind back to single PluginKind with JSDoc
- Reject empty array in parsePluginKind
- Add kindsEqual tests

* fix: use toSorted() instead of sort() per lint rules

* plugins: include default slot ownership in disable checks and gate dual-kind memory registration
2026-03-31 10:06:48 +05:30
Gustavo Madeira Santana e5dac0c39e CLI: keep root help plugin descriptors non-activating (#57294)
Merged via squash.

Prepared head SHA: c8da48f689080b2991670df90f95ce856e112d97
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-03-29 18:49:57 -04:00
Gustavo Madeira Santana 9b4f26e70a Plugins/CLI: add descriptor-backed lazy root command registration (#57165)
Merged via squash.

Prepared head SHA: ad1dee32eb35ede76adfda2add63227ed62a0d51
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-03-29 16:02:59 -04:00
George Zhang 2607191d04 refactor(plugins): centralize before_install context shaping 2026-03-29 12:35:01 -07:00
George Zhang 150faba8d1 plugins: enrich before_install policy context 2026-03-29 12:35:01 -07:00
George Zhang 7cd9957f62 plugins: add before_install hook for install scanners 2026-03-29 12:35:01 -07:00
Peter Steinberger c664b67796 fix: apply Mistral compat across proxy transports 2026-03-29 16:32:31 +09:00
Peter Steinberger 5872f860c9 feat(xai): add plugin-owned x_search onboarding 2026-03-29 00:12:37 +00:00
Peter Steinberger 2a950157b1 refactor(xai): move x_search into plugin 2026-03-28 21:35:13 +00:00
huntharo df61660a26 xAI: centralize fallback auth resolution 2026-03-28 21:35:13 +00:00
huntharo 9dd08a49a4 xAI: reuse fallback auth for runtime and discovery 2026-03-28 21:35:13 +00:00
Peter Steinberger d042192c7c refactor(plugins): move provider policy hooks into plugins 2026-03-28 06:11:13 +00:00
Peter Steinberger c7883fe892 refactor(plugins): register provider model id hooks 2026-03-28 05:42:46 +00:00
Tak Hoffman b598cdf968 fix(regression): preserve discord thread bindings for plugin commands 2026-03-27 20:24:14 -05:00
Peter Steinberger 44defeb71b fix: unify plugin tool thread defaults via delivery context 2026-03-27 23:58:04 +00:00
Peter Steinberger d73dbb6753 fix: restore provider auth and build checks 2026-03-27 20:20:31 +00:00
Peter Steinberger e25f634d50 refactor: move oauth profile repair metadata into providers 2026-03-27 17:23:40 +00:00
Peter Steinberger ef1784d264 refactor: move bundled plugin policy into manifests 2026-03-27 16:40:27 +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
junpei.o be0e994cf0 feat(plugins): expose runId in agent hook context (#54265) 2026-03-27 10:47:13 -04:00
Peter Steinberger 64bf80d4d5 refactor: move provider runtime into extensions 2026-03-27 05:38:58 +00:00
Peter Steinberger dbf78de7c6 refactor: move memory engine behind plugin adapters 2026-03-27 00:47:01 +00:00