Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
copilot(SKY-9277): tighten planner-decomposition with concrete syntactic triggers (#5682)
Andrew Neilson2b0d322db307
diff --git a/skyvern/forge/prompts/skyvern/workflow-copilot-agent.j2 b/skyvern/forge/prompts/skyvern/workflow-copilot-agent.j2index c05916d59..7f7a6a152 100644--- a/skyvern/forge/prompts/skyvern/workflow-copilot-agent.j2+++ b/skyvern/forge/prompts/skyvern/workflow-copilot-agent.j2@@ -122,7 +122,7 @@ IMPORTANT WORKFLOW RULES:- "wait" for explicit pauses between blocks.- "goto_url" for direct URL navigation and grounded URL-state shortcuts.* Prefer a `goto_url` URL-parameter shortcut over a click-driven `navigation` block when requested state (dates, destination, filters, search terms) maps to a URL that is supplied by the user, observed on the site, present in a link/form/action URL, or follows a same-site pattern visible in context. Do NOT invent website-specific paths or query parameters from memory — when the URL shape is uncertain, use a narrow `navigation` block instead. Put any follow-up actions in subsequent blocks, and follow URL-state shortcuts with extraction or validation that checks the visible page state.-* Keep `navigation_goal` narrow. The verifier checks every sub-condition after each step, so bundling 3+ sub-tasks (input + multi-step picker + filters + confirm) returns "continue" until the budget exhausts. When one request maps to several sub-tasks and no `goto_url` shortcut applies, decompose into one block per sub-task chained via `next_block_label`. The final stage of search → click → extract should be an `extraction` block, not another `navigation`.+* Keep `navigation_goal` to ONE atomic action per block. You MUST split into separate blocks if your `navigation_goal` would cover more than one of: (a) a search-form input, (b) a date or filter selection, (c) a results-page click into a detail view, (d) a final extraction. Conjunctions like "and"/"then"/commas separating distinct UI actions inside a single `navigation_goal` are a strong signal you are bundling — decompose. The verifier checks every sub-condition after each step, so bundled goals return "continue" until the budget exhausts. When one request maps to several sub-tasks and no `goto_url` shortcut applies, decompose into one block per sub-task chained via `next_block_label`. The final stage of search → click → extract should be an `extraction` block, not another `navigation`.* Set `complete_criterion` on every decomposed `navigation` block to the observable post-action page state — without it, smaller blocks still return vague "continue" verdicts.* Use descriptive, unique labels for blocks (snake_case format).* Reference parameters using Jinja2 syntax: {% raw %}{{ parameters.param_key }}{% endraw %}