From 792336dfef913291358f2312cd82c55944d18199 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Sun, 13 Sep 2026 18:30:51 +0100 Subject: feat(prompt): say which Chrome browser_* drives The prompt told the model it drives "the user's running instance". With this fork's default that is wrong: it is castle's shared Chrome, signed out of every account. It now matters which is which, because pi-chrome's chrome_* tools drive the user's signed-in Brave, and the model has to route between the two. getBrowserSystemPrompt() takes the resolved target and describes it: castle's shared browser for the built-in default, the user's own Chrome for local, the endpoint otherwise. --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 152c94d..e4d23f8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -261,8 +261,9 @@ export default function browserHarnessExtension(pi: ExtensionAPI): void { }); pi.on("before_agent_start", async (event) => { + const target = resolveCdpTarget(process.env, await readTarget()); return { - systemPrompt: event.systemPrompt + getBrowserSystemPrompt(client?.status().alive ?? false), + systemPrompt: event.systemPrompt + getBrowserSystemPrompt(client?.status().alive ?? false, target), }; }); } -- cgit v1.2.3