You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a680425
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/air-extensions.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -864,6 +864,7 @@ It returns `{ "stopped": true }` after app-server accepts the termination.
864
864
865
865
Standard ACP describes a change from one tool call. It has no complete file list for one prompt turn.
866
866
The version 1 `agentFileChangeReport` extension adds that list.
867
+
A client that is not AIR can opt in without the AIR namespace, see [Client-neutral agent file-change report](#client-neutral-agent-file-change-report).
867
868
868
869
### Request
869
870
@@ -937,6 +938,57 @@ The client must match the request id.
937
938
It must ignore a duplicate, stale, malformed, or unavailable report.
938
939
Rollback is outside this extension. The adapter advertises no `undo` or `rollback` command.
939
940
941
+
### Client-neutral agent file-change report
942
+
943
+
A client that is not AIR can get the same report without the `_meta.jetbrains.air` namespace.
944
+
It opts in with `initialize.clientCapabilities._meta`:
945
+
946
+
```json
947
+
{ "agentFileChangeReport": { "version": 1 } }
948
+
```
949
+
950
+
- Accepted only when `agentFileChangeReport` is an object whose `version` is an integer of at least 1. Anything else
951
+
enables nothing.
952
+
- The opt-in is an ACP v1 extension. The `initialize` answer of an opted-in client has the top-level
953
+
`_meta.agentFileChangeReport: {"version": 1}`.
954
+
- ACP v2 ignores the opt-in.
955
+
956
+
The client asks for a report with the top-level `_meta` of `session/prompt`:
The [request](#request) rules apply: a malformed request is ignored.
963
+
The adapter retains the turn diffs of a prompt only when it has a valid request.
964
+
965
+
The report goes in the top-level `_meta.agentFileChangeReport` of the `session_info_update`:
966
+
967
+
```json
968
+
{
969
+
"sessionUpdate": "session_info_update",
970
+
"_meta": {
971
+
"agentFileChangeReport": {
972
+
"version": 1,
973
+
"requestId": "a-unique-request-id",
974
+
"status": "reported",
975
+
"paths": ["/workspace/src/App.ts"],
976
+
"declaredComplete": false,
977
+
"truncated": false,
978
+
"uncertainty": "Codex turn diffs may omit same-content renames and changes made outside apply_patch, including shell commands, version-control commands, generators, and child processes."
979
+
}
980
+
}
981
+
}
982
+
```
983
+
984
+
The report object, its limits, its timing, the [Codex source](#codex-source) and the [unavailable reasons](#unavailable-report) are those of the AIR form.
985
+
986
+
- A client that declares both the AIR `agentFileChangeReport` capability and the client-neutral opt-in gets only the
987
+
client-neutral form: the adapter reads only the top-level request and ignores one in the AIR namespace.
988
+
Its AIR capability list still names `agentFileChangeReport`.
989
+
- AIR clients that do not send the client-neutral opt-in use the AIR form, unchanged. They get no report for a
990
+
top-level request.
991
+
940
992
## Session failure
941
993
942
994
The `sessionFailure` extension sends warnings and errors as durable transcript entries.
* How a client asks for and gets the report: not at all, in the AIR namespace, or in the client-neutral top-level
28
+
* `_meta`. Both forms use the same request validation, builders, limits and timing.
29
+
*/
30
+
export type AgentFileChangeReportFormat = "none" | "air" | "neutral";
31
+
17
32
const TURN_DIFF_UNCERTAINTY = "Codex turn diffs may omit same-content renames and changes made outside apply_patch, including shell commands, version-control commands, generators, and child processes.";
18
33
19
34
export interface AgentFileChangeReportRequest {
@@ -72,12 +87,72 @@ export function captureAgentFileChangeWorkspace(
72
87
};
73
88
}
74
89
90
+
/** The `initialize` answer `_meta.agentFileChangeReport` for a client that opted into the client-neutral form. */
91
+
export function neutralAgentFileChangeReportCapability(): {version: number} {
0 commit comments