Summary
Add a first-class/native code edit event in the session transcript so clients can render file edits directly without reconstructing them from tool output text.
Problem
Today, code edits are mostly inferred from tool output and post-hoc diffs. This is brittle and provider-dependent.
Proposal
Introduce a dedicated session event/item shape for code edits (or an equivalent normalized event) that includes structured edit metadata.
Suggested minimum fields:
- file path
- operation (create/update/delete/rename)
- before/after hashes (if available)
- patch/diff payload (or structured hunks)
- tool/source attribution
- timestamps / sequencing compatible with existing
item.started -> item.delta -> item.completed model
Why
- Makes UI rendering of edits deterministic
- Avoids parsing free-form tool text
- Improves parity across providers and event consumers
- Simplifies downstream integrations that need edit timelines
Acceptance criteria
- Session events expose a structured code-edit event for actual file mutations
- Event shape is documented in
docs/session-transcript-schema.mdx
- Conversion docs are updated (
docs/conversion.mdx)
- HTTP/SSE tests cover the new event end-to-end
Related: #102
Summary
Add a first-class/native code edit event in the session transcript so clients can render file edits directly without reconstructing them from tool output text.
Problem
Today, code edits are mostly inferred from tool output and post-hoc diffs. This is brittle and provider-dependent.
Proposal
Introduce a dedicated session event/item shape for code edits (or an equivalent normalized event) that includes structured edit metadata.
Suggested minimum fields:
item.started -> item.delta -> item.completedmodelWhy
Acceptance criteria
docs/session-transcript-schema.mdxdocs/conversion.mdx)Related: #102