Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

perf(mcp): send tool results as compact JSON, because indentation was a third of every result the agent read

Shahriar42da2ab5469b
diff --git a/src/daemon/server.test.ts b/src/daemon/server.test.ts
index eb6be9f..a678c94 100644
--- a/src/daemon/server.test.ts
+++ b/src/daemon/server.test.ts
@@ -118,7 +118,7 @@ describe('a tool call', () => {
test('fencing can be turned off in config', async () => {
writeFileSync(configPath, JSON.stringify({ guardrails: { fence: false } }));
const client = await connect(fakeBridge({ 'page.extractText': success({ content: 'Pricing' }) }).bridge);
- expect(texts(await call(client, 'page_extractText'))).toEqual([JSON.stringify({ content: 'Pricing' }, null, 2)]);
+ expect(texts(await call(client, 'page_extractText'))).toEqual([JSON.stringify({ content: 'Pricing' })]);
});
test('a failure comes back as an error that reads CODE: message, unfenced', async () => {
@@ -153,7 +153,7 @@ describe('a screenshot', () => {
test('a result with no image in it is shown as it is', async () => {
const client = await connect(fakeBridge({ 'page.screenshot': success({ skipped: true }) }).bridge);
- expect(texts(await call(client, 'page_screenshot'))).toEqual([JSON.stringify({ skipped: true }, null, 2)]);
+ expect(texts(await call(client, 'page_screenshot'))).toEqual([JSON.stringify({ skipped: true })]);
});
});
diff --git a/src/daemon/server.ts b/src/daemon/server.ts
index 8b6c4cd..3cfb9c3 100644
--- a/src/daemon/server.ts
+++ b/src/daemon/server.ts
@@ -342,7 +342,7 @@ function splitDataUrl(dataUrl: string): [mimeType: string, base64: string] {
*/
function render(result: ActionResult, fenceWith?: string) {
if (result.ok) {
- const body = sealSecrets(JSON.stringify(result.data, null, 2));
+ const body = sealSecrets(JSON.stringify(result.data));
return { content: [{ type: 'text' as const, text: fenceWith ? fence(body, fenceWith) : body }] };
}
return {