fix(agent): instruct background review fork to call skill_view before patching skills (#62397) - #62428
Conversation
Duplicate of #60331 (earliest open, 2026-07-07) — same file ( |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the background-review guard to the prompts; the current-main mismatch is real.
Problems
- The new wording says
skill_view(name)before all listed writes, but that is insufficient for existing supporting files.tools/skill_manager_tool.py:1167-1172and:1228-1232require the exact file path to have been read;tests/tools/test_skill_manager_tool.py:1330-1348verifies that readingSKILL.mddoes not authorize overwritingreferences/workflow.md. - The PR changes both prompt constants without extending the existing behavior-level prompt suite in
tests/run_agent/test_review_prompt_class_first.py.
Suggested changes
- Teach the retry path to use
skill_view(name, file_path=...)when the rejected mutation targets an existing supporting file, while retainingskill_view(name)forSKILL.md. - Add focused assertions for both review prompts covering that distinction and the
_read_before_write_requiredretry instruction.
Automated hermes-sweeper review.
| "skill that governs that task needs to carry the lesson.\n\n" | ||
| "If you notice two existing skills that overlap, note it in your " | ||
| "reply — the background curator handles consolidation at scale.\n\n" | ||
| "Read-before-write requirement (MANDATORY — the tool enforces this): " |
There was a problem hiding this comment.
This must distinguish SKILL.md from supporting files. The guard requires the exact target to be read, so skill_view(name) will still reject an overwrite/remove/patch of an existing references/... file; instruct skill_view(name, file_path=...) for that case.
|
Closing as duplicate — another PR already addressed this. Appreciate the contribution! |
Summary
The background self-improvement review fork is instructed to patch skills, but the prompt never tells the model to call
skill_view(name)first. The guard_background_review_write_guardintools/skill_manager_tool.pyenforces a read-before-write requirement and refuses the patch because the current SKILL.md hasn't been loaded. Net effect: corrections are silently dropped.Change
Updated
_SKILL_REVIEW_PROMPTand_COMBINED_REVIEW_PROMPTinagent/background_review.pywith a "Read-before-write requirement" instruction that tells the model to:skill_view(name)BEFORE anyskill_managewrite operation_read_before_write_required: true, read first then retryAlso improved the deny message format to tell the model which tools are available, reducing trial-and-error.
Verification
76 background review tests pass.