Skip to content

Automate browser based workflows with AI

feat(task_v2): make the final answer the deliverable + stop synthesis wheel-spinning (#6574)

Trevor Cheungefda3e7323bd
diff --git a/skyvern/forge/prompts/skyvern/task_v2.j2 b/skyvern/forge/prompts/skyvern/task_v2.j2
index 17c92d7dc..4a7b6be0a 100644
--- a/skyvern/forge/prompts/skyvern/task_v2.j2
+++ b/skyvern/forge/prompts/skyvern/task_v2.j2
@@ -40,6 +40,11 @@ CRITICAL - Do not declare success on a partially-complete multi-part goal:
- A required part that needs information is satisfied ONLY when an extract task has actually captured that information. A completed navigate/goto step that merely reached the relevant page does NOT satisfy it; plan an extract task instead.
- Setting user_goal_achieved to false does NOT fail the task — it lets the agent keep working on the missing part. Only set should_terminate to true if a required part is genuinely IMPOSSIBLE per the termination rules above.
+CRITICAL - The agent's own final answer is composed at completion, not by a task:
+- The final summary, comparison, recommendation, brief, or decision returned to the user is written automatically once you set user_goal_achieved to true. No task type authors it — extract only scrapes the current page and cannot synthesize across the task history.
+- Once the underlying DATA each required part needs has been captured by extract tasks, set user_goal_achieved to true. Do NOT plan extract or navigate tasks whose only purpose is to author the agent's own response — e.g. "summarize the findings", "combine the results into a recommendation", "present the comparison". That loops forever, because extract keeps returning page data instead of the synthesis, and it is the single most common way these runs exhaust their step budget.
+- Exception — required on-page actions still count: entering content INTO a web page the goal asks you to fill (a form, document, or post), and completing terminal actions the goal requires (submit, confirm, place order, send), are real navigate tasks and must still be done. This carve-out is only about the agent's own returned answer — do NOT set user_goal_achieved to true while a required final action is still pending.
+
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
diff --git a/skyvern/forge/prompts/skyvern/task_v2_summary.j2 b/skyvern/forge/prompts/skyvern/task_v2_summary.j2
index 239187de1..5dfb0ac29 100644
--- a/skyvern/forge/prompts/skyvern/task_v2_summary.j2
+++ b/skyvern/forge/prompts/skyvern/task_v2_summary.j2
@@ -1,10 +1,11 @@
The AI assistant has helped the user achieve the user goal in the web.
-Given the user goal, the latest screenshot of the page and the mini tasks that have been completed by the user along the way, summarize what has been achieved and output structured data related to the user goal in json format.
-You want to present the response in a clear way so that user can clearly understand what has been achieved.
+Given the user goal, the latest screenshot of the page, and the mini tasks completed along the way, produce the final answer to the user goal — the deliverable the user actually asked for — plus any structured data, in JSON format.
+
+If the user goal asks for a summary, comparison, recommendation, brief, decision, or other written deliverable, the "description" field MUST be that deliverable, stated in full: give the actual answer with its specific items, values, and reasoning, synthesized across the entire task history. Do not merely describe what was done or what was extracted — state the result the user can act on directly. Keep it to the result itself — include every item the answer requires, but no recap of the steps taken and no filler; stay as concise as completeness allows.
Reply in JSON format with the following keys:
{
- "description": str, // Summarize what has been achieved and describe the information extracted related to the user goal if any. Be precise and concise.
+ "description": str, // The final answer / deliverable for the user goal, stated in full — the recommendation, comparison, summary, or the extracted information itself, synthesized across the entire task history. Not a recap of the steps taken.
"output": json, // Structured data related to the user goal if any.{% if extracted_information_schema %} Use the data schema for the output field.{% endif %}
}