Commit Graph

617 Commits (64da91659037a61124dbb549c2000c75efc404da)

Author SHA1 Message Date
jnuyao f93ccc3443
fix(ui): prevent marked from auto-linking adjacent CJK characters (openclaw#48410)
Verified:
- ui: pnpm test -- --run src/ui/markdown.test.ts
- local full gate relaxed for this run; no required GitHub checks reported on the branch

Co-authored-by: jnuyao <2928523+jnuyao@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
8 months ago
Tak Hoffman f32f7d0809
Improve dashboard setup command copy UX (#56551) 8 months ago
Peter Steinberger f3ecd9ca9c test: guard ui session storage access in node runs 8 months ago
Peter Steinberger 5302aa8947 test: use safe storage helpers in app mount hooks 8 months ago
Peter Steinberger e999f2aae3 test: silence lit dev-mode warnings in ui suite 8 months ago
Peter Steinberger 8c4cc61656 test: avoid raw localStorage access in chat view test 8 months ago
Peter Steinberger 9b0b962f8c test: silence ui localstorage warning 8 months ago
YTjungle cb802afcbb fix(control-ui): size grouped chat bubbles by content 8 months ago
Peter Steinberger 024f2cf6e6 style: apply oxfmt drift 8 months ago
Tak Hoffman e4538a2a70
fix(regression): classify toolcall content as tool output 8 months ago
Peter Steinberger 8ab8f2c461
fix: center skills detail modal 8 months ago
Peter Steinberger d0cd645b4a style: format exec approval prompt template 8 months ago
Peter Steinberger 4505987b9c style(ui): format control views 8 months ago
Peter Steinberger 894f57a4ce
style(ui): apply formatter output 8 months ago
Peter Steinberger d35f37a58c style: format ui views 8 months ago
Altay 4693813503 fix: re-format exec-approval view 8 months ago
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>
8 months ago
Peter Steinberger 833636f0b2 style(ui): normalize control-ui formatting 8 months ago
bottenbenny f9b8499bf6
fix(chat): send button should use system theme variables (#55075)
Merged via squash.

Prepared head SHA: eb3e197874b1c9ff82f176bb8436855405625e6b
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
8 months ago
Peter Steinberger f625a0b106 style: apply current oxfmt output to ui views 8 months ago
Peter Steinberger f86765cba3 style: refresh ui formatting 8 months ago
Tak Hoffman 417024f9ad
style(ui): apply formatting cleanup 8 months ago
Ayaan Zaidi 9368f834c0
style(ui): format view templates 8 months ago
Peter Steinberger 8cf1e46a94 style: format ui sources 8 months ago
Peter Steinberger be6b841334
fix: align skill and compaction API usage 8 months ago
Peter Steinberger a331270f8a
fix: restore green build after upstream API drift 8 months ago
Peter Steinberger 10527ff8a3 build: refresh deps and vitest cache lanes 8 months ago
Peter Steinberger f0c1057f68
fix: restore reveal-to-edit raw config flow 8 months ago
Peter Steinberger 0106b0488a refactor: share config section card rendering 8 months ago
Peter Steinberger 8df6134a1b refactor: share usage metrics timeslice walker 8 months ago
Peter Steinberger ff47ad58fc refactor: share config path traversal helper 8 months ago
Peter Steinberger 00aedb3414
refactor: split claude cli history import pipeline 8 months ago
Peter Steinberger 672a24cbde
fix: unify claude cli imported tool messages 8 months ago
Peter Steinberger d6f7de392c test: dedupe ui chat seams 8 months ago
Peter Steinberger c12623a857 test: share plugin auth and ui storage fixtures 8 months ago
Peter Steinberger d5acd7dee5 test: share ui reconnect and storage helpers 8 months ago
w-sss 0bdb8ac7ad fix(ui): add width/height to context-notice SVG icon
- Fixes #47924
- Prevents SVG icon from expanding and covering entire chat window
- Adds explicit 24x24px dimensions to context-notice__icon SVG

Root cause:
The SVG element lacked explicit width and height attributes,
causing it to expand to fill the parent container when the context
usage warning appears (at ~85% token limit).
8 months ago
Peter Steinberger 23a4932997
refactor: share channel card selectors and layout 8 months ago
ted 4d41b8664c fix(ui): return null when default account ID is stale instead of falling back to first account 8 months ago
ted dc85235bf0 UI: derive channel configured state from default account 8 months ago
Tak Hoffman f3eb620824
fix: refresh available tools when the session model changes (#54184) 8 months ago
Tak Hoffman 9c7823350b
feat: add /tools runtime availability view (#54088)
* test(memory): lock qmd status counts regression

* feat: make /tools show what the agent can use right now

* fix: sync web ui slash commands with the shared registry

* feat: add profile and unavailable counts to /tools

* refine: keep /tools focused on available tools

* fix: resolve /tools review regressions

* fix: honor model compat in /tools inventory

* fix: sync generated protocol models for /tools

* fix: restore canonical slash command names

* fix: avoid ci lint drift in google helper exports

* perf: stop computing unused /tools unavailable counts

* docs: clarify /tools runtime behavior
8 months ago
Peter Steinberger 398d58fb8a fix: stabilize logging config imports 8 months ago
Val Alexander b61a875d56
fix: widen installer regex allowlists and deduplicate safeExternalHref calls
- SAFE_GO_MODULE: allow uppercase in module paths (A-Z)
- SAFE_BREW_FORMULA: allow @ for versioned formulas (python@3.12)
- SAFE_UV_PACKAGE: allow extras [standard] and equality pins ==
- Cache safeExternalHref result in skills detail API key section
8 months ago
Val Alexander cb58e45130
fix(security): resolve Aisle findings — skill installer validation, terminal sanitization, URL scheme allowlisting (#53471) thanks @BunsDev
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Nova <nova@openknot.ai>
8 months ago
Val Alexander a710366e9e
feat(ui): Control UI polish — skills revamp, markdown preview, agent workspace, macOS config tree (#53411) thanks @BunsDev
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Nova <nova@openknot.ai>
8 months ago
Peter Steinberger ecb3aa7fe0 test: sync app chat model override expectation 8 months ago
Peter Steinberger ff2e9a52ff fix: preserve deferred TUI history sync (#53130) (thanks @joelnishanth) 8 months ago
Peter Steinberger 9082795b10
refactor(ui): extract chat model resolution state 8 months ago
Peter Steinberger 013385e5c2
refactor: polish trigger and manifest seams 8 months ago