Skip to content

Commit a9a4d55

Browse files
anna239benbrandt
andauthored
docs(rfd): Indicate deletes in diffs (#441)
* Added file-delete.mdx * add json example * Clean up * Update website --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
1 parent 56a23f1 commit a9a4d55

3 files changed

Lines changed: 87 additions & 1 deletion

File tree

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
"rfds/rust-sdk-v1",
120120
"rfds/logout-method",
121121
"rfds/session-delete",
122-
"rfds/message-id"
122+
"rfds/message-id",
123+
"rfds/diff-delete"
123124
]
124125
},
125126
{

docs/rfds/diff-delete.mdx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: "Represent deleted files in diff"
3+
---
4+
5+
Author(s): [anna239](https://github.com/benbrandt)
6+
7+
## Elevator pitch
8+
9+
> What are you proposing to change?
10+
11+
Add flag `deleted` to [Diff](https://agentclientprotocol.com/protocol/tool-calls#diffs) entity type for the case of a deleted file.
12+
13+
## Status quo
14+
15+
> How do things work today and what problems does this cause? Why would we change things?
16+
17+
Currently, in Diff entity type `newText` is not nullable, so it's not possible to distinguish between a deleted file and empty file.
18+
19+
## What we propose to do about it
20+
21+
> What are you proposing to improve the situation?
22+
23+
Add flag `deleted` to [Diff](https://agentclientprotocol.com/protocol/tool-calls#diffs) entity type for the case of a deleted file.
24+
25+
**Current structure (cannot distinguish deleted file from empty file):**
26+
27+
```json
28+
{
29+
"type": "diff",
30+
"path": "/home/user/project/src/config.json",
31+
"oldText": "{\n \"debug\": false\n}",
32+
"newText": ""
33+
}
34+
```
35+
36+
**Proposed structure with `deleted` flag:**
37+
38+
```json
39+
{
40+
"type": "diff",
41+
"path": "/home/user/project/src/config.json",
42+
"oldText": "{\n \"debug\": false\n}",
43+
"newText": "",
44+
"deleted": true
45+
}
46+
```
47+
48+
Note: we would ideally make newText nullable, but that would break existing clients.
49+
50+
## Shiny future
51+
52+
> How will things will play out once this feature exists?
53+
54+
It is possible for the agent to distinguish between a deleted file and an empty file.
55+
56+
## Implementation details and plan
57+
58+
> Tell me more about your implementation. What is your detailed implementation plan?
59+
60+
Adding the new field will be a non-breaking change, and clients that update can better distinguish between deleted and empty files.
61+
62+
## Frequently asked questions
63+
64+
> What questions have arisen over the course of authoring this document or during subsequent discussions?
65+
66+
**Do we need to represent moved files?**
67+
68+
An agent could represent that with a deleted file at the old path and a new file at the new path.
69+
70+
We need to rework the entire diff structure to handle more cases, and binary files, but in the meantime this provides a stop-gap until we can implement a more comprehensive solution.
71+
72+
### What alternative approaches did you consider, and why did you settle on this one?
73+
74+
We considered making newText nullable, but that would break existing clients.
75+
76+
## Revision history
77+
78+
2026-02-20: Initial draft

docs/updates.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ description: Updates and announcements about the Agent Client Protocol
44
rss: true
55
---
66

7+
<Update label="February 20, 2025" tags={["RFD"]}>
8+
## Delete in Diff RFD moves to Draft stage
9+
10+
The RFD for indicating whether a diff resulted in a file deletion has been moved to Draft stage. Please review the [RFD](./rfds/diff-delete) for more information on the current proposal and provide feedback as work on the implementation begins.
11+
12+
</Update>
13+
714
<Update label="February 18, 2025" tags={["Governance"]}>
815
## Sergey Ignatov is now a Lead Maintainer
916

0 commit comments

Comments
 (0)