From 69c34b7439d2ebff5528e2216e7cb52f4e5b5966 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Mon, 10 Aug 2026 17:55:10 -0700 Subject: [PATCH] [eric] agents: CreateApp is offer-first; track/organize/plan asks answer in chat instead of scaffolding an app --- backend/apps/agents/apps_mcp_server.py | 11 +++++++---- .../manager/prompt/compose_turn_system_prompt.py | 10 +++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/apps/agents/apps_mcp_server.py b/backend/apps/agents/apps_mcp_server.py index e112f734..532652f7 100644 --- a/backend/apps/agents/apps_mcp_server.py +++ b/backend/apps/agents/apps_mcp_server.py @@ -26,10 +26,13 @@ TOOLS = [ "description": ( "Create a new OpenSwarm App: a real React 18 + TypeScript + Vite web app " "(optional FastAPI backend) that appears as a live preview card on the " - "user's dashboard, next to you. Use this whenever the user asks you to " - "build/make an app, tool, game, dashboard, tracker, visualizer, or any " - "interactive UI. Returns the workspace path to write code in plus the " - "App Builder reference (stack, layout, rules) — follow it. To EDIT an " + "user's dashboard, next to you. HARD RULE: call this only when the user's " + "message explicitly says to build/make/create an app, tool, game, or " + "dashboard. A question, plan, list, comparison, or a wish to track or " + "organize something is NOT an app request: answer it in chat (rich " + "components beat prose), then offer to build an app and wait for a yes. " + "Returns the workspace path to write code in plus " + "the App Builder reference (stack, layout, rules) — follow it. To EDIT an " "app that already exists, don't call this; edit its workspace files " "directly (the path is in your context when the user selects the app, " "and the preview hot-reloads on save)." diff --git a/backend/apps/agents/manager/prompt/compose_turn_system_prompt.py b/backend/apps/agents/manager/prompt/compose_turn_system_prompt.py index 61582d46..4c949788 100644 --- a/backend/apps/agents/manager/prompt/compose_turn_system_prompt.py +++ b/backend/apps/agents/manager/prompt/compose_turn_system_prompt.py @@ -84,9 +84,13 @@ def compose_turn_system_prompt( # Every other mode gets one line of discovery instead of the whole reference: CreateApp's result carries the reference when actually used, so the base prompt stays cheap. apps_note = ( "\n" - "You can build real web apps for the user: when they ask for an app, tool, game, or dashboard, " - "call the CreateApp tool — it seeds a workspace and puts a live preview card on their dashboard, " - "then you write the code. To change an existing app, have the user select its card (or use the " + "You can build real web apps for the user: CreateApp seeds a workspace and puts a live preview " + "card on their dashboard, then you write the code. HARD RULE: call CreateApp only when the user " + "explicitly says to build/make/create an app, tool, game, or dashboard. Wanting to track, " + "organize, plan, or compare something is NOT that ask: answer it in chat with rich components, " + "then ask one short question offering to build an app for it, and only build after a yes. This " + "offer-first rule intentionally overrides the act-don't-ask default, because an unwanted app is " + "expensive to undo. To change an existing app, have the user select its card (or use the " "workspace path in your context) and edit the files directly.\n" "" )