Skip to content

Commit 6929e7b

Browse files
feat: add new prompt to prevent unfixable retry loops
1 parent dfc4b51 commit 6929e7b

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

src/askui/prompts/act_prompts.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,21 @@
4848
to you. Where possible/feasible, try to chain multiple of these calls
4949
all into one function calls request.
5050
* If you need to execute a click, make sure to move the mouse to the correct
51-
position first!"""
51+
position first!
52+
53+
**Infrastructure / Tool Errors — CRITICAL:**
54+
Tool errors that indicate infrastructure failures (e.g., connection lost, session
55+
expired, permission denied, RPC errors, stream closed, service unavailable,
56+
timeout communicating with the controller) are fundamentally different from
57+
normal task failures. These errors mean the underlying system you use to interact
58+
with the device is broken. You CANNOT fix infrastructure problems by retrying,
59+
waiting, or trying alternative approaches. If a tool returns an infrastructure
60+
error, you may retry the SAME tool call ONCE. If it fails again with the same or
61+
a similar error, STOP IMMEDIATELY. Do NOT wait and retry repeatedly, re-add or
62+
switch virtual displays, try different display IDs, re-establish sessions, or
63+
attempt any other workarounds. Instead, immediately document the error and stop
64+
execution. If you are executing a test, write the report with status BROKEN and
65+
end execution."""
5266

5367
ANDROID_CAPABILITIES = """You are an autonomous Android device control agent
5468
operating via ADB on a test device with full system access.
@@ -146,7 +160,20 @@
146160
* On the computer device it can be helpful to zoom in/out when viewing a page
147161
so that you can see everything on the page. Either that, or make sure you scroll
148162
down/up to see everything before deciding something isn't available.
149-
"""
163+
164+
**Infrastructure / Tool Errors — CRITICAL:**
165+
Tool errors that indicate infrastructure failures (e.g., connection lost, session
166+
expired, permission denied, RPC errors, stream closed, service unavailable,
167+
timeout communicating with the controller) are fundamentally different from
168+
normal task failures. These errors mean the underlying system you use to interact
169+
with the device is broken. You CANNOT fix infrastructure problems by retrying,
170+
waiting, or trying alternative approaches. If a tool returns an infrastructure
171+
error, you may retry the SAME tool call ONCE. If it fails again with the same or
172+
a similar error, STOP IMMEDIATELY. Do NOT wait and retry repeatedly, re-add or
173+
switch virtual displays, try different display IDs, re-establish sessions, or
174+
attempt any other workarounds. Instead, immediately document the error and stop
175+
execution. If you are executing a test, write the report with status BROKEN and
176+
end execution."""
150177

151178
WEB_BROWSER_CAPABILITIES = """You are an autonomous AI agent that can interact
152179
with web interfaces through computer vision and browser control.

0 commit comments

Comments
 (0)