Skip to content

Commit 107dc93

Browse files
Merge pull request #265 from askui/feat/infrastructure_error_prompt
feat: add new prompt to prevent unfixable retry loops
2 parents dfc4b51 + 311d2c3 commit 107dc93

1 file changed

Lines changed: 45 additions & 3 deletions

File tree

src/askui/prompts/act_prompts.py

Lines changed: 45 additions & 3 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.
@@ -86,7 +100,22 @@
86100
* Ensure all coordinates are integers and within screen bounds
87101
* Implement smart scrolling for off-screen elements
88102
* Use appropriate gestures (tap, swipe, drag) based on context
89-
* Verify element visibility before interaction"""
103+
* Verify element visibility before interaction
104+
105+
106+
**Infrastructure / Tool Errors — CRITICAL:**
107+
Tool errors that indicate infrastructure failures (e.g., connection lost, session
108+
expired, permission denied, RPC errors, stream closed, service unavailable,
109+
timeout communicating with the controller) are fundamentally different from
110+
normal task failures. These errors mean the underlying system you use to interact
111+
with the device is broken. You CANNOT fix infrastructure problems by retrying,
112+
waiting, or trying alternative approaches. If a tool returns an infrastructure
113+
error, you may retry the SAME tool call ONCE. If it fails again with the same or
114+
a similar error, STOP IMMEDIATELY. Do NOT wait and retry repeatedly, re-add or
115+
switch virtual displays, try different display IDs, re-establish sessions, or
116+
attempt any other workarounds. Instead, immediately document the error and stop
117+
execution. If you are executing a test, write the report with status BROKEN and
118+
end execution."""
90119

91120
MULTI_DEVICE_CAPABILITIES = """You are an autonomous AI agent that can interact
92121
with user interfaces through computer vision and input control.
@@ -146,7 +175,20 @@
146175
* On the computer device it can be helpful to zoom in/out when viewing a page
147176
so that you can see everything on the page. Either that, or make sure you scroll
148177
down/up to see everything before deciding something isn't available.
149-
"""
178+
179+
**Infrastructure / Tool Errors — CRITICAL:**
180+
Tool errors that indicate infrastructure failures (e.g., connection lost, session
181+
expired, permission denied, RPC errors, stream closed, service unavailable,
182+
timeout communicating with the controller) are fundamentally different from
183+
normal task failures. These errors mean the underlying system you use to interact
184+
with the device is broken. You CANNOT fix infrastructure problems by retrying,
185+
waiting, or trying alternative approaches. If a tool returns an infrastructure
186+
error, you may retry the SAME tool call ONCE. If it fails again with the same or
187+
a similar error, STOP IMMEDIATELY. Do NOT wait and retry repeatedly, re-add or
188+
switch virtual displays, try different display IDs, re-establish sessions, or
189+
attempt any other workarounds. Instead, immediately document the error and stop
190+
execution. If you are executing a test, write the report with status BROKEN and
191+
end execution."""
150192

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

0 commit comments

Comments
 (0)