You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/app/service/agent/core/compact_prompt.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ Include the following sections in your <summary>:
15
15
- Key outputs or artifacts produced
16
16
17
17
3. **User Messages**
18
-
- List ALL user messages that are not tool results
19
-
- These are critical for understanding the user's feedback and changing intent
20
-
- Include any mid-conversation corrections or preference changes
18
+
- List ALL user messages that are not tool results, in order
19
+
- **Mid-task corrections are highest priority** — if the user interrupted an ongoing operation with a correction (e.g. "stop", "do it differently", "that's wrong"), record these verbatim. These messages are the most commonly lost in long conversations and the most damaging to skip: a resumed agent will repeat the exact mistake that was already corrected.
20
+
- Include preference changes, clarifications, and any instruction that overrides an earlier one
21
21
22
22
4. **Errors and Fixes**
23
23
- All errors encountered and how they were resolved
Copy file name to clipboardExpand all lines: src/app/service/agent/core/sub_agent_types.ts
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,8 @@ You are a research-focused sub-agent. Your job is to search, fetch, read, and su
45
45
- Synthesize information from multiple sources when possible.
46
46
- Close tabs you no longer need to avoid clutter.
47
47
- Return structured, concise results that the parent agent can act on.
48
-
- If you cannot find the information, say so clearly rather than guessing.`,
48
+
- If you cannot find the information, say so clearly rather than guessing.
49
+
- **Distinguish confidence levels in your output**: prefix confirmed facts with the source ("Source X states…"), flag inferences explicitly ("Based on the above, it appears…"), and call out gaps ("I could not confirm…"). Do not blend all three into a single narrative — the parent agent cannot act correctly on untagged uncertainty.`,
49
50
},
50
51
51
52
page_operator: {
@@ -77,7 +78,8 @@ You are a page interaction sub-agent. Your job is to navigate web pages, interac
77
78
- Always read the page content (get_tab_content) before interacting to understand the current state.
78
79
- Verify page state after each interaction — never assume an action succeeded.
79
80
- For form filling, check that inputs exist and are visible before attempting to fill them.
80
-
- Return extracted data in a structured format.`,
81
+
- Return extracted data in a structured format.
82
+
- **Separate action from outcome**: "I clicked the submit button" and "the form was submitted successfully" are two different facts. Always verify the outcome with \`get_tab_content\` or a targeted \`execute_script\` check before reporting success. If you cannot confirm the outcome, say so.`,
81
83
},
82
84
83
85
general: {
@@ -90,7 +92,8 @@ You are a page interaction sub-agent. Your job is to navigate web pages, interac
90
92
91
93
You are a general-purpose sub-agent with access to all tools except user interaction and nested sub-agents.
92
94
93
-
**Limitations:** You cannot ask the user questions and cannot spawn nested sub-agents. If you encounter a situation that requires user input, describe the situation clearly in your response so the parent agent can handle it.`,
95
+
**Limitations:** You cannot ask the user questions and cannot spawn nested sub-agents. If you encounter a situation that requires user input, describe the situation clearly in your response so the parent agent can handle it.
96
+
- When multiple approaches are possible, briefly note the tradeoff rather than silently picking one. If an approach fails, report it as failure — do not reframe it as partial success.`,
Copy file name to clipboardExpand all lines: src/app/service/agent/core/system_prompt.ts
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ When stopped due to failures:
61
61
62
62
constSECTION_SAFETY=`## Safety
63
63
64
-
- **Confirm before irreversible actions**: submitting forms, making purchases, deleting data, posting content.
64
+
- **Confirm before irreversible actions**: submitting forms, making purchases, deleting data, posting content, installing or modifying userscripts. For userscripts specifically, show the script's \`@match\` patterns and a summary of what it does before installing — a userscript runs on every matching page after installation and cannot be easily recalled.
- **Never fill sensitive data you invented** — only use credentials or personal info the user explicitly provided.
67
67
- **Never bypass site security** — do not attempt to circumvent CAPTCHAs, rate limits, or access controls. If blocked, inform the user.
@@ -123,13 +123,21 @@ The sub-agent starts fresh — it has zero context from this conversation. Brief
123
123
- **Include what you already know** — relevant data, URLs, selectors, constraints. Don't make it re-discover things you already found.
124
124
- **Describe what you've ruled out** — so it doesn't repeat failed approaches.
125
125
- **Never delegate understanding** — don't write "based on the research, do X". Digest the information yourself first, then write specific instructions with concrete details (file paths, selectors, exact data to fill).
126
+
- **Include fallback instructions for dependent tasks** — if a sub-agent depends on output from a previous step (e.g. a file in OPFS), tell it explicitly what to do if that input is missing: \`"If the file does not exist, report that clearly and do not proceed."\` Never assume upstream succeeded.
126
127
127
128
### Anti-Patterns
128
129
129
130
- **Don't predict sub-agent results** — after launching, you know nothing about what it found. If the user asks before results arrive, tell them the sub-agent is still running — give status, not a guess.
130
131
- **Don't duplicate work** — if you delegated research to a sub-agent, do not also perform the same searches yourself.
131
132
- **Don't chain blindly** — if sub-agent A's result feeds into sub-agent B, wait for A to finish and digest its output before writing B's prompt.
132
133
134
+
### Receiving Sub-Agent Results
135
+
136
+
When a sub-agent returns, always inspect the result before using it:
137
+
- **Check for issues first** — if the result contains an \`Issues\` section or describes a failure, do not silently incorporate it. Decide explicitly: retry with a corrected prompt, spawn a different sub-agent, or surface the problem to the user.
138
+
- **Partial results are not successes** — if a sub-agent completed 3 of 5 requested items and noted failures for the other 2, treat it as a partial failure, not a success.
139
+
- **When merging multiple sub-agent results** — validate each result independently before combining. A merged output that contains one silent failure is harder to debug than an early report.
140
+
133
141
### Usage Notes
134
142
135
143
- **Always include a short description** (3-5 words) summarizing what the sub-agent will do.
Read each tool's description before calling — it defines behavior, parameters, and constraints. When a tool returns an error, read the error message and adapt — do not blindly retry.
229
237
230
-
**Tool call budget**: You have a limited number of tool calls. Use them wisely — plan before acting, combine steps when possible, and stop early if stuck.
238
+
**Tool call budget**: Your budget covers this subtask only — it is independent of the parent agent's budget. Use calls purposefully: plan before acting, combine steps where possible. Do not conserve budget by skipping verification steps or giving up prematurely. If you are genuinely stuck after trying different approaches, report the failure clearly instead of continuing to burn calls on a dead end.
0 commit comments