You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9b77d51
Browse filesBrowse the repository at this point in the historyBrowse files
fix(hook-to-otlp): subshell hook guard for heredoc payloads; quiet failures (TH-8229)
Cursor's bundled headless agent host passes the hook payload as a trailing
heredoc (`<command> <<'CURSOR_HOOK_EOF'`, commandHookPayloadTransport
argv_heredoc). With `python3 ... 2>/dev/null || true` the heredoc binds to
`true` and the emitter reads nothing. Every shipped command, the shared page,
the Cursor page and the README now use the subshell form
`(python3 -B <path>/emit.py cursor <Event> 2>/dev/null || true)`, which works
for stdin and heredoc and still exits 0 with no output when the emitter or
python3 is missing.
- tests/test_cursor_hooks_config.py runs every shipped command (project and
user hooks) through sh, zsh, bash and dash with the payload on stdin and as
a trailing heredoc: emitter missing, python3 missing, and installed (exit 0,
expected stdout, payload received verbatim, no __pycache__). A regression
test shows the unparenthesized form loses a heredoc payload.
- emit.py prints nothing (instead of "{}") when the adapter cannot be loaded,
respond() raises, or run() fails, so a misregistered permission hook never
gets schema-invalid "{}".
- Home-path scrub handles user names with spaces (when a separator follows),
~name paths, and this machine's own home directory anywhere in the text.
- replay.py --hooks-json/--cwd/--transport and run_e2e.sh HOOK_TRANSPORT run
the installed hooks.json commands the way Cursor does.
- cursor.mdx: CLI section no longer claims a CLI session was traced (it was
not run); troubleshooting covers tools directly under the session (no
marker) separately from coding_agent.turn.inferred.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
0 commit comments