Double Popup Issue with beforeSubmitPrompt Hook

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When a beforeSubmitPrompt hook returns continue: false with a user_message, Cursor displays the error popup twice instead of once.

Steps to Reproduce

1-Configure a beforeSubmitPrompt hook in hooks.json:

{
  "version": 1,
  "hooks": {
    "beforeSubmitPrompt": [
      {
        "command": "node ./hooks/test-block.js"
      }
    ]
  }
}
  1. Create a simple test hook that always blocks:
// test-block.js
async function getStdin() {
  let result = '';
  process.stdin.setEncoding('utf8');
  for await (const chunk of process.stdin) {
    result += chunk;
  }
  return result;
}

async function main() {
  await getStdin();
  process.stdout.write(JSON.stringify({
    continue: false,
    user_message: 'Test block - checking for double popup'
  }));
  process.exit(0);
}

main();

Expected Behavior

A single error popup should be displayed with the message from user_message.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Version: 2.3.34 (user setup)
VSCode Version: 1.105.1
Commit: 643ba67cd252e2888e296dd0cf34a0c5d7625b90
Date: 2026-01-10T21:17:10.428Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

The issue is reproduced with multiple models, I think it’s not related to models. You can use opus-4.5 or gpt-5.2

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report and repro steps, that really helps.

I can see the issue in the screenshot. I’ll pass it to the team, your test code is a perfect demo of the bug.