Skip to content

fix(background-review): curator no longer refused for skipping the pre-read it was never told about (#62397, direction from #60331) - #94530

Merged
teknium1 merged 1 commit into
mainfrom
fix/62397-review-prompt-read-before-write
Aug 25, 2026
Merged

fix(background-review): curator no longer refused for skipping the pre-read it was never told about (#62397, direction from #60331)#94530
teknium1 merged 1 commit into
mainfrom
fix/62397-review-prompt-read-before-write

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

The background-review fork no longer walks blind into the read-before-write guard — both review prompts (_SKILL_REVIEW_PROMPT and _COMBINED_REVIEW_PROMPT) now teach the enforced handshake, so the model calls skill_view on the exact target before patching instead of issuing the write, getting refused, and burning review iterations. Fixes #62397.

Root cause: #55906 shipped the enforcing guard in skill_manage, but neither review prompt ever mentioned it — the model had no way to know the pre-read was required.

Direction follows #60331 by @kkwills13, with the scope corrections requested in that PR's review: existing-target-only wording, no claim that delete-skill is guarded (it isn't), bounded one-view-one-retry recovery, and contract tests for both prompt variants.

Changes

  • agent/background_review.py: Read-before-write section added to both prompts, scoped to the guard's actual contract — skill_view(name) before patch/edit of an existing SKILL.md, skill_view(name, file_path=...) before overwrite/removal of an existing support file, transcript quotes don't count, new skills/new support files exempt, refusal recovery bounded to one view + one retry. Preference-order item 1 in each prompt points at the rule.
  • tests/run_agent/test_review_prompt_class_first.py: behavior-contract tests (not snapshots) asserting both prompts carry the rule, the exact call forms, the new-target exemption, and the no-loop bound.

Validation

Check Result
test_review_prompt_class_first.py (all 7) pass
Sabotage run (prompt edits reverted) both new tests FAIL — red without fix
Prompt claims vs guard code verified against _background_review_read_before_write_guard call sites: edit/patch on SKILL.md, write_file only when target exists, remove_file; _delete_skill unguarded, so prompt makes no delete claim

Cluster

Infographic

Curator now knows the read-before-write rule

…-write handshake

The skill_manage guard (added in #55906) refuses any patch/edit of an
existing SKILL.md, or overwrite/removal of an existing support file,
unless the exact target was loaded via skill_view during the review.
Neither _SKILL_REVIEW_PROMPT nor _COMBINED_REVIEW_PROMPT ever mentioned
this, so models routinely issued the write without the pre-read, got
refused, and burned review iterations (#62397).

Both prompts now carry a Read-before-write section scoped to the
guard's actual contract: existing targets only, exact-path pre-read for
support files, transcript quotes don't count, new skills/new support
files exempt, and a bounded one-view-one-retry recovery instead of a
loop. Direction follows #60331 by @kkwills13 with the scope corrections
requested in review (existing-target-only wording, no delete claim,
bounded retry, contract tests for both prompt variants).

Fixes #62397.
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 15b2723 — fix(background-review): teach review prompts the enforced re

⚠️ Warnings

OSV vulnerability scan · View job

7 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 3m53s vs 4m16s (-9.0%). 3 job(s) slower, 7 faster, 2 unchanged.

  • OS-specific tests / Windows-only tests: +21.0s
  • Python tests / Run tests: -18.0s
  • Python lints / Windows footguns (blocking): -8.0s
  • OSV scan / Scan lockfiles / osv-scan: -5.0s
  • Python lints / ruff enforcement (blocking): -3.0s

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/skills Skills system (list, view, manage) P2 Medium — degraded but workaround exists labels Aug 25, 2026
@teknium1
teknium1 merged commit a70d2ff into main Aug 25, 2026
38 checks passed
@teknium1
teknium1 deleted the fix/62397-review-prompt-read-before-write branch August 25, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Background review fork can't patch skills: prompt never calls skill_view, guard refuses the write (read-before-write mismatch)

2 participants