Launch the picker in the harness browser first.

Name Cursor browser_navigate as the in-IDE viewport, then other in-app tools, then the system opener. Same ladder in serve-question stdout so agents stop using macOS open while the IDE browser works.

AI-assisted.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Abdul Wahab
2026-09-01 10:02:40 +05:00
co-authored by Cursor
parent 72fec2849c
commit 9fbda768e6
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -512,8 +512,12 @@ When more than one surface comes back, DESIGN.md says what each of them does wit
Tell the user in one line that the visual cues are ready at `.impeccable/visual-cues/` (name the count), then run `node {{scripts_path}}/picker-server.mjs` from the project root as a foreground command and parse its `PICKER_URL` line.
- **The harness has a browser tool**: open the URL with it and let the user drive. The tool is a viewport only; never drive the questionnaire yourself, because the answers are the user's.
- **No browser tool**: tell the user *"The design picker is running at [URL]; open it in your browser and finish there."* Then wait on the foreground process.
- **Cursor**: `browser_navigate` to the `PICKER_URL`; that is the in-IDE browser, where the questionnaire belongs. Do not skip this, and do not use the system opener while the tool works. The tab is the user's viewport only; never drive the questionnaire yourself, because the answers are the user's.
- **Another harness with a browser tool**: open the URL with that tool, on the same viewport-only rule.
- **No browser tool, or the tool call failed**: open the URL with the system opener (macOS `open`, Linux `xdg-open`), then tell the user in one line to finish in the opened tab.
- **Even the opener failed**: tell the user *"The design picker is running at [URL]; open it in your browser and finish there."*
Whichever branch ran, wait on the foreground process.
The server process exiting is the completion signal; never poll or watch the answers file while it runs.
+1 -1
View File
@@ -375,7 +375,7 @@ if (hasFlag('start')) {
const state = JSON.parse(fs.readFileSync(stateFile(key), 'utf8'));
console.log(`QUESTION URL: ${state.url}`);
console.log(`QUESTION KEY: ${key}`);
console.log('Open the URL for the user now: in-app browser when the harness has one, otherwise the system opener (macOS `open`, Linux `xdg-open`), otherwise show the URL.');
console.log('Open the URL for the user now: on Cursor with browser_navigate (the in-IDE browser), on another harness with its in-app browser tool, otherwise the system opener (macOS `open`, Linux `xdg-open`), otherwise show the URL.');
console.log(`Then collect the answer with: node ${fileURLToPath(import.meta.url)} --wait --key ${key}`);
process.exit(0);
}