Repository navigation
Commit 73afe4e
committed
fix(agent-tools): remove read freshness gating
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.1 parent 7a0cdba commit 73afe4e
23 files changed
Lines changed: 503 additions & 1693 deletions
File tree
- scripts/core-boundaries
- rules/source
- src/crates
- assembly/core/src/agentic
- session
- tools
- implementations
- execution
- agent-runtime
- src
- tool-contracts
- src
- tests
- tool-execution/src/fs
Lines changed: 13 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | | - | |
| 1671 | + | |
1672 | 1672 | | |
1673 | | - | |
| 1673 | + | |
1674 | 1674 | | |
1675 | 1675 | | |
1676 | | - | |
| 1676 | + | |
1677 | 1677 | | |
1678 | | - | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1679 | 1684 | | |
1680 | 1685 | | |
1681 | 1686 | | |
1682 | 1687 | | |
1683 | | - | |
| 1688 | + | |
1684 | 1689 | | |
1685 | 1690 | | |
1686 | 1691 | | |
| |||
2715 | 2720 | | |
2716 | 2721 | | |
2717 | 2722 | | |
2718 | | - | |
| 2723 | + | |
2719 | 2724 | | |
2720 | 2725 | | |
2721 | 2726 | | |
2722 | 2727 | | |
2723 | | - | |
| 2728 | + | |
2724 | 2729 | | |
2725 | 2730 | | |
2726 | 2731 | | |
| |||
3047 | 3052 | | |
3048 | 3053 | | |
3049 | 3054 | | |
3050 | | - | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
3059 | | - | |
3060 | 3055 | | |
3061 | 3056 | | |
3062 | 3057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
975 | 975 | | |
976 | 976 | | |
977 | 977 | | |
978 | | - | |
| 978 | + | |
979 | 979 | | |
980 | | - | |
| 980 | + | |
981 | 981 | | |
982 | 982 | | |
983 | | - | |
984 | | - | |
| 983 | + | |
| 984 | + | |
985 | 985 | | |
986 | 986 | | |
987 | | - | |
988 | | - | |
| 987 | + | |
| 988 | + | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
992 | | - | |
| 991 | + | |
| 992 | + | |
993 | 993 | | |
994 | 994 | | |
995 | | - | |
996 | | - | |
| 995 | + | |
| 996 | + | |
997 | 997 | | |
998 | 998 | | |
999 | | - | |
1000 | | - | |
| 999 | + | |
| 1000 | + | |
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| |||
2853 | 2853 | | |
2854 | 2854 | | |
2855 | 2855 | | |
2856 | | - | |
| 2856 | + | |
2857 | 2857 | | |
2858 | | - | |
| 2858 | + | |
2859 | 2859 | | |
2860 | 2860 | | |
2861 | | - | |
2862 | | - | |
2863 | | - | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
2864 | 2867 | | |
2865 | 2868 | | |
2866 | 2869 | | |
| |||
5629 | 5632 | | |
5630 | 5633 | | |
5631 | 5634 | | |
5632 | | - | |
5633 | | - | |
5634 | | - | |
5635 | | - | |
5636 | | - | |
5637 | | - | |
5638 | | - | |
5639 | | - | |
5640 | | - | |
5641 | | - | |
5642 | | - | |
5643 | | - | |
5644 | | - | |
5645 | | - | |
5646 | | - | |
5647 | | - | |
5648 | | - | |
5649 | | - | |
5650 | | - | |
5651 | | - | |
5652 | | - | |
5653 | | - | |
5654 | 5635 | | |
5655 | 5636 | | |
5656 | 5637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2368 | 2368 | | |
2369 | 2369 | | |
2370 | 2370 | | |
2371 | | - | |
2372 | | - | |
| 2371 | + | |
| 2372 | + | |
2373 | 2373 | | |
2374 | | - | |
2375 | | - | |
2376 | | - | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
2377 | 2382 | | |
2378 | 2383 | | |
2379 | 2384 | | |
| |||
3180 | 3185 | | |
3181 | 3186 | | |
3182 | 3187 | | |
3183 | | - | |
| 3188 | + | |
3184 | 3189 | | |
3185 | | - | |
3186 | | - | |
3187 | | - | |
3188 | | - | |
3189 | | - | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
3190 | 3195 | | |
3191 | 3196 | | |
3192 | 3197 | | |
| |||
3643 | 3648 | | |
3644 | 3649 | | |
3645 | 3650 | | |
3646 | | - | |
3647 | | - | |
3648 | | - | |
3649 | | - | |
3650 | | - | |
3651 | | - | |
3652 | | - | |
3653 | | - | |
3654 | | - | |
3655 | 3651 | | |
3656 | 3652 | | |
3657 | 3653 | | |
| |||
Lines changed: 0 additions & 4 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments