Skip to content

Parse Copilot SDK tool-denial logs in permission issue extraction#37261

Merged
pelikhan merged 1 commit into
mainfrom
copilot/fix-permission-tool-parser
Jun 6, 2026
Merged

Parse Copilot SDK tool-denial logs in permission issue extraction#37261
pelikhan merged 1 commit into
mainfrom
copilot/fix-permission-tool-parser

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 6, 2026

The workflow failed with repeated tool denials, but the permission parser did not extract denied tool calls from Copilot SDK driver log format. As a result, missing-tool reporting lost actionable denial details.

  • Problem focus

    • Extend denied-command extraction beyond pipe-formatted output to SDK-driver denial lines emitted during permission gating.
  • Parser changes (permission_denied_helpers.cjs)

    • Added pattern matching for:
      • permission denied by workflow tool permissions: <summary>
      • tool denial N/M: permission denied: <summary>
    • Preserved existing fallback that scans nearby pipe-marked command lines.
    • Continued deduplication via Set so repeated denials collapse to unique entries.
  • Test coverage (permission_denied_helpers.test.cjs)

    • Added a case with real SDK-driver-style denial lines (shell(...), read) to verify extraction and deduplication behavior.
const output = [
  "[copilot-sdk-driver] [sdk-driver] permission denied by workflow tool permissions: shell(agenticworkflows --help 2>&1 | head -60)",
  "[copilot-sdk-driver] [sdk-driver] tool denial 1/5: permission denied: shell(agenticworkflows --help 2>&1 | head -60)",
  "[copilot-sdk-driver] [sdk-driver] permission denied by workflow tool permissions: read",
].join("\n");

extractDeniedCommands(output);
// => ["shell(agenticworkflows --help 2>&1 | head -60)", "read"]

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review June 6, 2026 05:48
Copilot AI review requested due to automatic review settings June 6, 2026 05:48
@pelikhan pelikhan merged commit 12aac84 into main Jun 6, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/fix-permission-tool-parser branch June 6, 2026 05:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves missing-tool/permission issue extraction by teaching the permission-denied parser to recognize Copilot SDK driver “tool denial” log formats, so workflows that fail due to repeated tool permission denials surface actionable denied-command details.

Changes:

  • Extended extractDeniedCommands() to parse SDK-driver denial summaries (in addition to the existing pipe-marker fallback).
  • Added a Vitest case that validates extraction + deduplication for SDK-driver style denial lines.
Show a summary per file
File Description
actions/setup/js/permission_denied_helpers.cjs Adds regex-based parsing for SDK-driver “permission denied by workflow tool permissions” and “tool denial N/M” lines while preserving the existing pipe-marker fallback.
actions/setup/js/permission_denied_helpers.test.cjs Adds test coverage for SDK-driver denial log extraction and deduplication behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

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.

3 participants