From 03a8cb95d07627a34981670060c8472d723e6cfe Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Wed, 11 Feb 2026 19:18:48 -0600 Subject: [PATCH] fix write file (#421) * fix write file * fix typo --- docs/src/app/api/docs-chat/route.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/app/api/docs-chat/route.ts b/docs/src/app/api/docs-chat/route.ts index e771580..ab43afc 100644 --- a/docs/src/app/api/docs-chat/route.ts +++ b/docs/src/app/api/docs-chat/route.ts @@ -23,6 +23,7 @@ You have access to the full agent-browser documentation via the bash and readFil When answering questions: - Use the bash tool to list files (ls /workspace/) or search for content (grep -r "keyword" /workspace/) - Use the readFile tool to read specific documentation pages (e.g. readFile with path "/workspace/index.md") +- Do NOT use bash to write, create, modify, or delete files (no tee, cat >, sed -i, echo >, cp, mv, rm, mkdir, touch, etc.) — you are read-only - Always base your answers on the actual documentation content - Be concise and accurate - If the docs don't cover a topic, say so honestly @@ -99,14 +100,16 @@ export async function POST(req: Request) { const { messages }: { messages: UIMessage[] } = await req.json(); const docsFiles = await loadDocsFiles(); - const { tools } = await createBashTool({ files: docsFiles }); + const { + tools: { bash, readFile }, + } = await createBashTool({ files: docsFiles }); const result = streamText({ model: DEFAULT_MODEL, system: SYSTEM_PROMPT, messages: await convertToModelMessages(messages), stopWhen: stepCountIs(5), - tools, + tools: { bash, readFile }, prepareStep: ({ messages: stepMessages }) => ({ messages: addCacheControl(stepMessages), }),