Skip to content

Lightpanda: the headless browser designed for AI and automation

Merge pull request #2702 from lightpanda-io/save_system_prompt

Adrià Arrufata1bd1a483448
diff --cc src/agent/Agent.zig
index 0746354ff,2c6e3fdd1..7f57440dc
--- a/src/agent/Agent.zig
+++ b/src/agent/Agent.zig
@@@ -169,21 -169,8 +169,21 @@@ const script_skill
// Sytem prompt of the `/save` command
// With the save instructions and the skill-like agent script documentation.
- const save_system_prompt = browser_tools.save_synthesis_prompt ++ "\n" ++ script_skill;
+ const save_system_prompt = browser_tools.save_synthesis_prompt ++ "\n\n" ++ script_skill;
+// Swapped in instead of `save_system_prompt` when the user message carries a
+// previously saved script: the "this session" framing above would otherwise
+// make the model discard it as out-of-scope.
+const save_revision_note =
+ \\This save REVISES an existing script, included in the user message. Its
+ \\goal spans every session that contributed to it, not just this one. Use
+ \\it as the base: keep its steps, structure, and output shape unchanged
+ \\except where this session's commands or the user's instruction require
+ \\a change, and add what this session contributes. Output the complete
+ \\updated script — never a fragment, diff, or continuation.
+;
+const save_revision_system_prompt = browser_tools.save_synthesis_prompt ++ "\n" ++ save_revision_note ++ "\n" ++ script_skill;
+
const synthesis_prompt =
\\You have used your tool budget or cannot finish the exploration.
\\Give your best final answer NOW based ONLY on what you actually observed