Skip to content

Feature request for file changes event #902

@xoofx

Description

@xoofx

This is a feature request.

Currently it seems that we don't receive any events for changed files with their diff, which makes it difficult with the SDK to report nicely what GitHub Copilot has changed during a prompt iteration.

An example of such API in C# could be:

public partial class AssistantFileChangesEvent : SessionEvent
{
    [JsonIgnore]
    public override string Type => "assistant.file_changes";

    [JsonPropertyName("changes")]
    public required List<AssistantFileChangeData> Changes { get; set; }
}

public partial class AssistantFileChangeData
{
    [JsonPropertyName("diff")]
    public string Diff { get; set; } = string.Empty;
    [JsonPropertyName("kind")]
    public AssistantFileChangeKind Kind { get; set; } = default!;
    [JsonPropertyName("path")]
    public string Path { get; set; } = string.Empty;
    [JsonPropertyName("move_path")]
    public string MovePath { get; set; } = string.Empty; // When kind == "update"
}

[JsonConverter(typeof(JsonStringEnumConverter<AssistantFileChangeKind>))]
public enum AssistantFileChangeKind
{
    [JsonStringEnumMemberName("add")]
    Add,
    [JsonStringEnumMemberName("delete")]
    Delete,
    [JsonStringEnumMemberName("update")]
    Update,  // Use "move_path"  
}

It would allow to display more nicely during a user/assistant iteration the files that were modified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions