From 5cfa7ccc8f4082db111bc0186c5fa3d44b767ad3 Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Tue, 28 Jul 2026 00:01:32 +0530 Subject: refactor(tools): declare concurrency in the tool definition serialized: true was applied in registry.ts, away from the tools it describes. Now a required concurrency field on each definition, with a test pinning the serialized set so the classes cannot drift. The lock check defaults to taking the mutex for any class that is not explicitly "parallel", so a definition that bypasses defineBrowserTool at runtime fails safe rather than racing on shared CDP state. The test script gains --conditions=import: pi-coding-agent publishes no "require" condition, so importing any tool definition from a CJS-loaded test could not resolve it. Co-Authored-By: Claude Opus 5 (1M context) --- src/domains/readpage/read-page.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/domains/readpage') diff --git a/src/domains/readpage/read-page.ts b/src/domains/readpage/read-page.ts index c21b264..453c347 100644 --- a/src/domains/readpage/read-page.ts +++ b/src/domains/readpage/read-page.ts @@ -109,6 +109,7 @@ export const readPageTool = defineBrowserTool({ "Boilerplate-heavy or structure-less pages fall back to bounded body text rather than erroring.", ], parameters: ReadPageArgs, + concurrency: "parallel", async handler(args, { client, signal }): Promise> { if (args.url !== undefined && args.url.length > 0) return readOpenedUrl(client, args.url, signal); if (args.targetId !== undefined && args.targetId.length > 0) return readOwnedTab(client, args.targetId); -- cgit v1.2.3