-
Notifications
You must be signed in to change notification settings - Fork 1.5k
read before write rules are broken #1005
Copy link
Copy link
Open
Labels
P2-importantDevrait être fixé bientôtDevrait être fixé bientôteffort-largePlusieurs jours, nouveau modulePlusieurs jours, nouveau moduleenhancementNew feature or requestNew feature or requestfilter-qualityFilter produces incorrect/truncated signalFilter produces incorrect/truncated signal
Metadata
Metadata
Assignees
Labels
P2-importantDevrait être fixé bientôtDevrait être fixé bientôteffort-largePlusieurs jours, nouveau modulePlusieurs jours, nouveau moduleenhancementNew feature or requestNew feature or requestfilter-qualityFilter produces incorrect/truncated signalFilter produces incorrect/truncated signal
Hi,
ClaudeCode, OpenCode have a strict read before write policy. That policy is broken when Read tool is rewritten by RTK to rtk read. The agent sees the file and the optimized content wants to edit the file but there is no rtk edit command so the agent calls the native tool. But there is no native read tool calls before the edit and the edit fails.
The agent needs to issue an another read to make able the edit the file. It means the agent loosing time and tokens when rereads the file. But there is a catch if the rewrite hooks work then the agent even cannot issue a native read command because it will be rewritten again.
I disabled the read command in the rtk config and instruct the agent to use rtk cat for explore, but disabling the read disabled the cat too. So now rtk read and rtk cat returns the raw file content. At least the Edit works.
This is suboptimal and I think it would be optimal solution if RTK implements Edit and Write too, which is bypassing the read before write policy or better tracking the reads can enforce the policy on its own.