Skip to content

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

Draft
jay23606 wants to merge 2 commits into
chainloop-dev:mainfrom
jay23606:pr-go/3803-fix-trace-attribute-shell-changes-in-a-m
Draft

jay23606 wants to merge 2 commits into
chainloop-dev:mainfrom
jay23606:pr-go/3803-fix-trace-attribute-shell-changes-in-a-m

Conversation

@jay23606

@jay23606 jay23606 commented Dec 6, 2026 •

Copy link
Copy Markdown

Bug

Copilot CLI can send a pre-tool batch that holds both a file tool (create, edit, apply_patch) and a shell tool (bash, powershell). Trace kept only the file tool, so the file changes of the shell command were not attributed to the AI.

Change

  • The Copilot provider keeps the shell command of a mixed batch, while the file tool stays the tool name.
  • The shared pre-tool handler takes a worktree snapshot for the shell command of such a batch, then snapshots the files one by one.

Testing

  • go test ./app/cli/internal/trace/copilot/ -run TestReadHookInput -count=1 passes, with a new case for a batched file and shell call.

Regression test: fails on base twice (/Command:"",/), passes on fix twice (go test ./app/cli/internal/trace/copilot/ -run TestReadHookInput -count=1)

Fixes #3803

View guided diff

Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
@chainloop-platform

chainloop-platform Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ⚠️ 1 failing

Status Policy Material Messages
⚠️ Failed pr-min-approvals pr-info PR/MR #3890 has 0 approving reviews, 1 required.
✅ Passed pr-description-required pr-info -
✅ Passed pr-user-story-linked pr-info -

View attestation ↗

AI Session Checks — ⚠️ no AI session found

Missing AI Coding Sessions

This organization requires every PR to be backed by a Chainloop Trace AI coding session, and none was found for this one.

Please make sure the AI coding session evidence has been sent by the Chainloop CLI, or add the skip-ai-session label to this PR to bypass this check.

Learn more about Chainloop Trace.

Security Checks — ✅ 6 passing

✅ AI Security Analysis

Reviewed this change against the project's security context (4 concerns hunted) — no introduced risk found.

View in Chainloop ↗ · How this works ↗

✅ Secret Scan

Status Policy Messages
✅ Passed secrets-detection -

✅ SAST Scan

Status Policy Messages
✅ Passed owasp-top10-2025 -
✅ Passed sast -
✅ Passed cwe-top25 -
✅ Passed cwe-top26-40-cusp -
Scans not applied (3)
Scan Reason
Vulnerability Scan no manifest/lockfile changed
GitHub Actions Scan no workflow files changed
IaC Scan no IaC files changed

View attestation ↗


Powered by Chainloop and Chainloop Trace

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread app/cli/pkg/action/trace_agent_hook.go Resolved
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
@jay23606
jay23606 marked this pull request as draft December 6, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant