Skip to content

fix(cursor): return valid responses from trace hooks - #161

Merged
Abhijeet Prasad (AbhiPrasad) merged 3 commits into
mainfrom
cursor-hook-debug-1f9f1dae
Oct 7, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 3 commits into
mainfrom
cursor-hook-debug-1f9f1dae

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

AI Summary

Cursor's beforeSubmitPrompt hook expects a JSON response such as {"continue":true}. The tracing hook called bt trace hook directly, so when bt printed CLI help or an error, Cursor treated that text as the hook response and blocked the prompt. Users saw “Hook blocked” followed by the bt help output.

How users hit it

It happens when Cursor runs the tracing hook and the CLI writes non-JSON output to stdout. Wrapping the command in a POSIX shell script fixes that case on Unix, but marketplace installs use the packaged hooks.json verbatim on Windows, where the Windows hook runner cannot execute the .sh launcher.

Fix

Keep the packaged hook commands as direct, cross-platform bt trace hook invocations. For Cursor events, the daemon now emits the expected protocol response after capture, including when capture fails: {"continue":true} for beforeSubmitPrompt and {} for other events. Each command passes its event explicitly so bt can select the right response. This keeps CLI diagnostics from becoming Cursor policy output and works for direct marketplace installs on Windows as well as Unix.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T20:17:09.301825Z f103063 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 744c80b75e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread src/plugins/cursor/content/hooks/hooks.json Outdated
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 021ea30 into main Oct 7, 2026
22 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the cursor-hook-debug-1f9f1dae branch October 7, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants