← Plugins

Paseo Hook Actions

wvliteam9installs

Configure hook-triggered actions, error recovery chains, tool-permission responses, notifications, and session startup configuration for Paseo agents.

$ paseo plugin add wvliteam/hook-actions
Paseo Hook Actions screenshot 1

Automate ordered hook-triggered actions for Paseo agents, starting with out-of-the-box error recovery for Codex turn limits.

By default, only one rule is enabled: when a Codex turn fails with session_turn_limit_exceeded, the plugin sends /compact in the original session, waits for the compaction event, and submits one continuation prompt. It never forks a session, replays tools, approves permissions, or loops if the limit recurs.

Setup and settings

Requires Paseo 0.17.4 or newer on both the daemon (with plugins enabled) and each Paseo app client. Supported daemon hosts are macOS and Linux (Windows daemon hosts are not covered by ps-based stale lock detection). The settings and status UI follows the host language, supporting Simplified Chinese and English; other languages fall back to English. Chinese control names below are reference labels and appear translated in an English UI.

Open Settings -> Plugins -> Paseo Hook Actions -> 规则配置 (Rule Configuration) to toggle automatic rules, set the compact wait (30–600 seconds, default 600 seconds), and expand 高级执行保护 (Advanced Execution Guards) to adjust recovery and prompt budgets, concurrent compactions, observation and settlement windows. Settings forms keep independent drafts; advanced guards merge disjoint external changes and flag conflicting fields. If the current compaction is observed in progress, recovery waits up to a 30-minute absolute cap.

Manage named actions and webhook/MCP targets, edit failure rules and other event rules, and preview rule matching without executing actions. Rule parameters can be edited inline, and saved-action references can be converted to independent inline copies. Rule copies start disabled with unique IDs. Other event rules support search and filters, with full-list priority selection still available while filtered. Webhook targets support a real daemon-side test of the current unsaved connection; changing the draft invalidates old test results.

Stopped, uncertain, and tripped recoveries add an incident-specific timeline warning. Open the 规则执行状态 (Rule Execution Status) agent panel or run /turn-limit-status, /turn-limit-retry, or /turn-limit-cancel to inspect, manually retry, or cancel pending automatic work. The panel separates confirmed completion from SDK acceptance and manual release, and supports event and result filters.

For completed turns, pure feedback and metadata rules can trigger on ordinary turns with a stable turn ID. Follow-up model prompt, continuation, or compaction rules require selecting at least one workspace and starting the task with /hook-input <task> so the plugin can verify user-input origin.

Capabilities, data access, and limits

All other automation beyond the default Codex turn-limit rule is opt-in. Define reusable named actions in Action Management, then build prioritized rules across lifecycle and derived hooks (turn start, completion, failure, or cancellation; permission requests and resolutions; tool failures; context usage thresholds; wait timers; and session open, close, or archive), or start from built-in rule presets for common scenarios. Supported actions include error recovery chains, timeline notes, webhook notifications, custom session metadata updates for passing state across hooks, automatic tool-permission responses, and workspace-scoped session startup configuration (system instructions, session environment variables, built-in agent tools, and MCP servers).

The plugin reads agent status, timeline events, session lifecycle events, permission requests, tool failures, and context usage on interactive agents. Background agents are skipped.

When a recovery or follow-up rule triggers, the plugin sends /compact or the configured prompt text to the agent's active provider in the original session; that provider processes the submitted text under its own policies.

Automatic permission responses apply only to tool permission requests (never question, plan, or mode requests). Before submitting a response, the plugin re-validates the live request snapshot, available options, workspace, and rule. Invalid or oversized permission request payloads block automatic responses.

Webhook notification targets send HTTP or HTTPS requests directly from the daemon to the URL you configure, without following redirects. Requests with a body use JSON by default, with plain text and URL-encoded form formats also available; the default JSON payload contains text, event, agentId, and deliveryId. GET/HEAD requests send no body. Requests carry configured headers and an idempotency-key header.

Startup rules apply only to interactive session launch requests for configured workspaces. They can append system prompt instructions, set session environment variables, attach built-in agent tools (session_context for agent/workspace/provider IDs, hook_metadata_get and hook_metadata_set scoped to this plugin's custom metadata namespace, hook_notify for sending text to registered webhook targets with a 20-per-hour limit without exposing target URLs or headers, and read-only hook_status for recovery state and recent execution summaries), and attach configured HTTP, SSE, or stdio MCP server definitions. Target headers and stdio environment variables can reference daemon environment variables by name. For stdio MCP servers, the agent session starts the configured command; the plugin does not download or install external packages or binaries.

The plugin writes recovery status projections and user-configured custom key-value pairs into the current session's plugin metadata namespace (paseo-turn-limit-recovery.custom.*). Recovery journals, workflow locks, and recent execution history are stored locally on the daemon host under plugin-data/paseo-turn-limit-recovery/ with mode-0600 files (mode-0700 directories). Journals record matched rule snapshots (including configured prompts) and selected request facts such as commands, paths, URLs, and option labels, so avoid placing secrets in those fields. Full chat history, raw permission input objects, and resolved connection credentials are not written to disk by the plugin.

The panel shows the latest 20 executions by default; 加载更多记录 loads older pages, and 重新读取原始记录 bypasses the display cache and restarts from the first page. Filters apply to loaded records. Periodic maintenance retains up to 100 recent unprotected terminal records within 30 days in each agent's hook and recovery history. Pending and uncertain work and hook records referenced by active model work or live receipts are protected. Hook execution identities remain in a separate deduplication ledger after detailed logs are removed.

An uncertain send is never retried automatically; the plugin stops and asks you to inspect the session. Third-party provider turn-counter reset behavior after compaction has not been verified, so if the limit appears again, automatic recovery stops.

Related plugins

Browse all plugins →