Commit 4fdeeeb
committed
[argus] lead_agent/prompt: add <file_editing> guidance block
The stock system prompt has no edit-vs-rewrite guidance, so models
default to bash heredocs for every file write — including fixes to
files they just wrote in the same conversation. That roughly doubles
wall-time on iterative coding tasks: instead of a 5-line str_replace,
the model emits the entire file again, which has to round-trip through
the LLM and gets persisted in conversation history forever.
The <file_editing> block sits inside <working_directory> (so it's
adjacent to the workspace guidance) and tells the model:
- Prefer targeted edits (str_replace) over rewrites (write_file) over
bash heredocs (cat <<EOF).
- read_file before editing files you wrote earlier in the same
conversation — context drift makes "expected old content" stale.
- For deliverables in /mnt/user-data/outputs, write once with
write_file then str_replace to fix in place; never rewrite.
Adds a test asserting block presence, contents, and placement inside
<working_directory>.
PR-candidate: maybe
Upstream-issue: none
Reason: Opinionated phrasing — upstream may want a more general
sentence rather than the three-pillar block. Worth proposing
in a follow-up issue once we have data on whether it actually
speeds up coding tasks in practice.1 parent a18dc1b commit 4fdeeeb
2 files changed
Lines changed: 44 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
425 | 437 | | |
426 | 438 | | |
427 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
71 | 103 | | |
72 | 104 | | |
73 | 105 | | |
| |||
0 commit comments