Skip to content

Commit 87a580c

Browse files
IlyaasKclaude
andcommitted
Use stable pool id in acquire release hint
The acquire next_actions echoed the caller's id_or_name (possibly a display name) in the release hint, while create/update use the stable pool id. Prefer browser.pool.id, falling back to id_or_name only when the SDK omits the pool ref, so follow-ups survive a pool rename. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 33b5e58 commit 87a580c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/lib/mcp/tools/browser-pools.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,14 @@ export function registerBrowserPoolCapabilities(server: McpServer) {
433433
);
434434
if (!browser)
435435
return errorResponse("Failed to acquire browser from pool");
436+
// Prefer the stable pool id for the release hint (acquire may have
437+
// been called by name); fall back to the caller's identifier.
438+
const poolId = browser.pool?.id ?? params.id_or_name;
436439
return jsonResponse({
437440
browser: summarizeAcquiredBrowser(browser),
438441
next_actions: [
439442
`Use computer_action with session_id "${browser.session_id}" to control this browser.`,
440-
`When finished, use manage_browser_pools with action "release", id_or_name "${params.id_or_name}", and session_id "${browser.session_id}".`,
443+
`When finished, use manage_browser_pools with action "release", id_or_name "${poolId}", and session_id "${browser.session_id}".`,
441444
`Use manage_browsers with action "get" and session_id "${browser.session_id}" for full browser details.`,
442445
],
443446
});

0 commit comments

Comments
 (0)