Summary
The hooks reference (https://docs.poolside.ai/hooks) says the UserPromptSubmit event adds a prompt field ("which reflects any earlier hook's rewrite"). Under pool exec on pool 1.0.16 the payload delivered to the hook has no prompt key at all, whether the prompt is passed with -p "..." or on stdin with -p -.
Reproduce
.poolside/settings.local.yaml in the workspace:
hooks:
UserPromptSubmit:
- name: capture
matcher: "*"
command: /abs/path/capture.sh
capture.sh:
#!/bin/sh
in=$(cat); printf '%s\n' "$in" >> /abs/path/events.jsonl; exit 0
Then:
pool exec --unsafe-auto-allow -d "$PWD" -p "Reply with exactly the word ok and use no tools."
printf 'Reply with exactly the word ok and use no tools.\n' | pool exec --unsafe-auto-allow -d "$PWD" -p -
Both runs deliver this payload (keys only; values elided):
{"hook_api_version": "1.0", "hook_event_name": "UserPromptSubmit", "event_id": "evt-2", "session_id": "...", "cwd": "...", "trajectory_path": "..."}
No prompt. Every other event matched the docs (PreToolUse/PostToolUse carry tool_name, tool_input, tool_call_id, tool_output; Stop carries reason; SessionStart carries source).
Why it matters
A UserPromptSubmit hook that injects additional_context based on what the user asked has nothing to key on. The query is recoverable by parsing the <user_query> block out of the latest tool_call.inference.start record in trajectory_path, which is what we do as a fallback, but that is a workaround on an undocumented file format.
Environment
- pool 1.0.16 (latest per the update check), Linux x86_64
- Observed under
pool exec. Not yet checked under the interactive TUI or pool acp, so this may be exec-specific.
Context
Found while wiring omind's memory/guard hooks into pool: CryptoJones/omind#312. The rest of the hook protocol worked as documented on the first try, including both deny paths on PreToolUse.
Summary
The hooks reference (https://docs.poolside.ai/hooks) says the
UserPromptSubmitevent adds apromptfield ("which reflects any earlier hook's rewrite"). Underpool execon pool 1.0.16 the payload delivered to the hook has nopromptkey at all, whether the prompt is passed with-p "..."or on stdin with-p -.Reproduce
.poolside/settings.local.yamlin the workspace:capture.sh:Then:
Both runs deliver this payload (keys only; values elided):
{"hook_api_version": "1.0", "hook_event_name": "UserPromptSubmit", "event_id": "evt-2", "session_id": "...", "cwd": "...", "trajectory_path": "..."}No
prompt. Every other event matched the docs (PreToolUse/PostToolUsecarrytool_name,tool_input,tool_call_id,tool_output;Stopcarriesreason;SessionStartcarriessource).Why it matters
A
UserPromptSubmithook that injectsadditional_contextbased on what the user asked has nothing to key on. The query is recoverable by parsing the<user_query>block out of the latesttool_call.inference.startrecord intrajectory_path, which is what we do as a fallback, but that is a workaround on an undocumented file format.Environment
pool exec. Not yet checked under the interactive TUI orpool acp, so this may be exec-specific.Context
Found while wiring omind's memory/guard hooks into pool: CryptoJones/omind#312. The rest of the hook protocol worked as documented on the first try, including both deny paths on
PreToolUse.