Skip to content

fix(delight): pre-read sampled files to eliminate view/read tool denials - #48989

Merged
pelikhan merged 2 commits into
mainfrom
copilot/aw-delight-tool-denial-fix
Jul 29, 2026
Merged

fix(delight): pre-read sampled files to eliminate view/read tool denials#48989
pelikhan merged 2 commits into
mainfrom
copilot/aw-delight-tool-denial-fix

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The Delight workflow was hitting guard.tool_denials_exceeded (3/3) because the Copilot SDK agent used its built-in view/read tool on sampled file paths (absolute paths), which is not in the --allow-tool allowlist. The existing xargs -a ... cat bash entries were not used — the agent preferred the SDK-native file reader.

Changes

  • pre-agent-steps: After sampling file paths, immediately read their contents into *-content.txt files (doc-samples-content.txt, workflow-samples-content.txt, validation-sample-content.txt) so the agent receives content directly via the already-allowed cat /tmp/gh-aw/agent/*.

    # Pre-read file contents (eliminates view/read tool denials)
    xargs -a /tmp/gh-aw/agent/doc-samples.txt cat > /tmp/gh-aw/agent/doc-samples-content.txt 2>/dev/null || echo "(no doc samples found)" > /tmp/gh-aw/agent/doc-samples-content.txt
  • Prompt: Updated the three analysis sections (Documentation, AI-Generated Messages, Error Messages) to reference the pre-loaded *-content.txt files instead of xargs ... cat commands.

  • Bash allowlist: Removed the three xargs -a ... cat entries — superseded by the DataOps pre-step.

  • Lock file: Recompiled delight.lock.yml.

Copilot AI linked an issue Jul 29, 2026 that may be closed by this pull request
…ool denials

The Delight workflow was hitting the tool-denial guardrail (3/3) because
the agent used the built-in view/read tool to open sampled files via
absolute paths, which is not in the Copilot SDK allowlist.

Fix (DataOps pattern):
- Extend pre-agent-steps to pre-read sampled file contents into
  *-content.txt files so the agent can access them via the already-
  allowed `cat /tmp/gh-aw/agent/*` bash command.
- Update prompt references to use the pre-loaded content files.
- Remove the xargs bash allowlist entries (no longer needed).
- Recompile delight.lock.yml.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Delight exceeded tool denial limit fix(delight): pre-read sampled files to eliminate view/read tool denials Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 22:22
@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 22:27
Copilot AI review requested due to automatic review settings July 29, 2026 22:27
@pelikhan
pelikhan merged commit 8d982ba into main Jul 29, 2026
@pelikhan
pelikhan deleted the copilot/aw-delight-tool-denial-fix branch July 29, 2026 22:27

Copilot AI 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.

Pull request overview

Preloads sampled workflow content to reduce denied SDK-native file reads in Delight.

Changes:

  • Materializes sampled files under /tmp/gh-aw/agent/.
  • Updates prompts and removes obsolete xargs allowlist entries.
  • Recompiles the generated workflow.
Show a summary per file
File Description
.github/workflows/delight.md Adds preloading and updates prompt commands.
.github/workflows/delight.lock.yml Regenerates the compiled workflow.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment on lines +64 to +67
# Pre-read file contents (eliminates view/read tool denials)
xargs -a /tmp/gh-aw/agent/doc-samples.txt cat > /tmp/gh-aw/agent/doc-samples-content.txt 2>/dev/null || echo "(no doc samples found)" > /tmp/gh-aw/agent/doc-samples-content.txt
xargs -a /tmp/gh-aw/agent/workflow-samples.txt cat > /tmp/gh-aw/agent/workflow-samples-content.txt 2>/dev/null || echo "(no workflow samples found)" > /tmp/gh-aw/agent/workflow-samples-content.txt
xargs -a /tmp/gh-aw/agent/validation-sample.txt cat > /tmp/gh-aw/agent/validation-sample-content.txt 2>/dev/null || echo "(no validation sample found)" > /tmp/gh-aw/agent/validation-sample-content.txt
@github-actions github-actions Bot mentioned this pull request Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.1

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.

[aw] Delight exceeded tool denial limit

3 participants