Skip to content

fix(trace): attribute shell changes in a mixed Copilot pre-tool batch #3803

Open

Description

@migmartri

Copilot CLI sends the preToolUse hook as a batch of calls (toolCalls[]). The Trace pre-tool handler takes one kind of snapshot for each hook input: a worktree snapshot for a shell tool, or file snapshots for a file tool. When one batch holds both a file tool (create, edit, apply_patch) and a shell tool (bash, powershell), the Copilot provider snapshots only the files, so the changes of the shell command are not attributed to the AI.

In 52 real batches of Copilot CLI 1.0.109, no batch mixed the two kinds. The fix needs the shared pre-tool handler to take both snapshots for one hook.

Follow-up of #3800.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions