fix(agent-tools): remove read freshness gating - #2886
Merged
Conversation
wsp1911
force-pushed
the
rm-read-freshness
branch
from
September 8, 2026 06:36
14d7b5e to
6b9e518
Compare
Remove session-scoped Read freshness checks from Edit and Write, including state recording, mutation backfills, and obsolete contracts. Keep prompt guidance requiring agents to read files before editing. The gate cannot correct an inaccurate old_string. It adds rejection conditions beyond content matching: changes outside the target block can invalidate an otherwise applicable edit, while rollback or context replacement clears cached reads. Since the state is memory-only, restarting also loses Read records even when the restored conversation still contains the relevant file content. This follows established approaches in Codex and OpenCode: - Codex apply_patch reads current file content and matches patch context without requiring session-scoped prior-Read credentials. - OpenCode previously tracked read timestamps, mtime, and size per session and path, rejecting edits and overwrites without a prior Read or after metadata changes. Commit 76a141090, "chore: delete filetime module (#22999)", removed that module, its Read/Edit/Write integration, the disable-check flag, and associated tests. - Current OpenCode edit and apply_patch match against current content; write likewise has no runtime prior-Read gate. Preserve Deep Review range receipts in a separate store, including their session cleanup behavior. Improve old_string mismatch errors to mention external changes or incorrectly copied or generated text, retain nearby-content diagnostics, and direct agents to Read the current target region before correcting the edit and retrying.
wsp1911
force-pushed
the
rm-read-freshness
branch
from
September 8, 2026 06:37
6b9e518 to
7c90f21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove session-scoped Read freshness checks from Edit and Write,
including state recording, mutation backfills, and obsolete contracts.
Keep prompt guidance requiring agents to read files before editing.
The gate cannot correct an inaccurate old_string. It adds rejection
conditions beyond content matching: changes outside the target block
can invalidate an otherwise applicable edit, while rollback or context
replacement clears cached reads. Since the state is memory-only,
restarting also loses Read records even when the restored conversation
still contains the relevant file content.
This follows established approaches in Codex and OpenCode:
without requiring session-scoped prior-Read credentials.
session and path, rejecting edits and overwrites without a prior Read
or after metadata changes. Commit 76a141090, "chore: delete filetime
module (#22999)", removed that module, its Read/Edit/Write integration,
the disable-check flag, and associated tests.
write likewise has no runtime prior-Read gate.
Preserve Deep Review range receipts in a separate store, including
their session cleanup behavior. Improve old_string mismatch errors
to mention external changes or incorrectly copied or generated text,
retain nearby-content diagnostics, and direct agents to Read the
current target region before correcting the edit and retrying.