ワンクリックで
test-agent-hooks
Exercise a real agent hook turn that drives Zedra Running, WaitingApproval, and Completed state.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Exercise a real agent hook turn that drives Zedra Running, WaitingApproval, and Completed state.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | test-agent-hooks |
| description | Exercise a real agent hook turn that drives Zedra Running, WaitingApproval, and Completed state. |
| allowed-tools | Bash |
| argument-hint | codex | opencode | pi |
Exercise a real agent turn and confirm its hooks drive Zedra state and Delta notifications. Installs nothing and does not send synthetic hooks.
Argument: $1 is the provider under test: codex, opencode, or pi. If omitted, use the agent currently running this skill.
ZEDRA_TERMINAL_ID is set; Delta notifications require it.zedra agent hook install --provider <provider> writes them):
codex: .codex/hooks.json must register UserPromptSubmit, PermissionRequest, PostToolUse, and Stop hooks that call the Zedra hook script.opencode: .opencode/plugins/zedra.js in this repo, or the global ~/.config/opencode/plugins/zedra-agent-hooks.js.pi: ~/.pi/agent/extensions/zedra-agent-hooks.ts.codex (Claude-style hook events):
| Event | Expected Zedra state |
|---|---|
UserPromptSubmit | Running |
PermissionRequest | WaitingApproval |
PostToolUse | Running |
Stop | Completed |
opencode (native plugin events):
| Event | Expected Zedra state |
|---|---|
session.status (busy/retry) | Running |
permission.asked | WaitingApproval |
permission.replied | Running |
session.idle | Completed |
pi (extension normalizes native events to Claude-style names):
| Event | Expected Zedra state |
|---|---|
before_agent_start → UserPromptSubmit | Running |
tool_execution_end → PostToolUse | Running (no state change) |
agent_end / session_shutdown → Stop | Completed |
Pi has no permission approval event, so there is no WaitingApproval transition for pi.
Delta notifies on approval (codex/opencode) and completion when the app is backgrounded or quit.
Codex accepts either no stdout with exit code 0, plain text context on stdout, or the documented JSON shape for UserPromptSubmit:
{
"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"additionalContext": "Optional context for this turn."
}
}
Do not print ad hoc JSON from a UserPromptSubmit hook. If Codex reports UserPromptSubmit hook (failed): error: hook returned invalid user prompt submit JSON output, fix the hook command output before using this skill. The Zedra hook script should normally run quiet and print nothing.
Codex and OpenCode expose approval events, but a denied approval or a tool path that emits no follow-up event may leave the card in WaitingApproval until the turn ends. Codex has no documented permission-resolved hook; the approved path returns to Running through PostToolUse.
Perform these actions now using only real tool calls from the provider under test:
For codex and opencode:
~/.ssh/config in a way that requires approval.For pi (no approval step):
Do not call zedra agent hook receive, zedra agent hook test, or manually emit hook events.
Do not attempt to verify the Zedra UI or notifications yourself. The user will verify:
Foreground app path:
codex/opencode: the agent asks for approval to read ~/.ssh/config and the terminal card shows the WaitingApproval indicator. Approve or deny; if approved, the card returns to Running after the read tool completes. pi: the card stays Running after the first tool completes.Background or quit app path:
codex/opencode: confirm a Delta notification arrives for the approval request, open the app from it, and approve or deny. Background or quit the app again while the second 5-second wait is running.zedra agent hook receive or zedra agent hook test; this skill validates only naturally emitted provider hooks and extension events.~/.ssh/config unless the user chooses another file the provider will require approval to access.