Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(agent): both agent prompts say results stay above and a shortened one is read in part (CA loops)

purplee1e27cccac4b
diff --git a/src/hooks/useAgentChat.ts b/src/hooks/useAgentChat.ts
index 62e6b8ac..98dcfe96 100644
--- a/src/hooks/useAgentChat.ts
+++ b/src/hooks/useAgentChat.ts
@@ -4152,6 +4152,7 @@ That list is what LU can do. Your request carries the subset that fits the task
WORK IN BATCHES (every step resends the whole conversation and costs the user money):
- Put independent tool calls into ONE response: several reads, searches or edits at once.
- Never spend a step on bookkeeping alone. If a todo_write tool is offered, send the updated list together with your next real tool call.
+- The result of every call you made stays in the conversation above. Do not call a tool again with the same arguments unless something changed in between. If a result above was shortened, read only the part you still need (a line range or a search), not the whole thing again.
AUTONOMY CONTRACT (read carefully, this is the most important rule):
- When the user asks you to BUILD, CREATE, MAKE, or WRITE something (a file, a website, a script, a folder structure), you MUST execute it via tools, typically file_write.
diff --git a/src/hooks/useCodex.ts b/src/hooks/useCodex.ts
index 49b33329..e4bd5c4d 100644
--- a/src/hooks/useCodex.ts
+++ b/src/hooks/useCodex.ts
@@ -195,7 +195,7 @@ Workflow per task:
Work in batches. Every step resends the whole conversation, so each round trip costs the user real money:
- Put independent tool calls into ONE response: read all the files you need at once, run several searches at once, make several edits at once.
- Never spend a step on bookkeeping alone. If a todo_write tool is offered, send the updated list in the same response as your next real tool call, never on its own.
-- Do not re-read a file you already read unless it changed since.
+- Do not re-read a file you already read unless it changed since. If a result above was shortened, read only the part you still need (file_read with a line range, or file_search for the name), not the whole file again.
Rules:
- Always read a file before modifying it