[q] Enforce safe-output fallback for Q when tool permissions are blocked#36915
Merged
Conversation
Closed
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Debug Q workflow failure to generate safe outputs
[q] Enforce safe-output fallback for Q when tool permissions are blocked
Jun 4, 2026
pelikhan
reviewed
Jun 4, 2026
| @@ -0,0 +1,34 @@ | |||
| //go:build !integration | |||
Contributor
Author
There was a problem hiding this comment.
Done in dfbaf1f: I removed pkg/cli/q_workflow_contract_test.go from the PR.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens the Q workflow’s prompt contract to ensure it always emits a safe-output action, even when tool permissions are repeatedly denied, and adds a regression test to prevent the contract from drifting.
Changes:
- Added “Safe Output Reliability” rules to
.github/workflows/q.md, including areport_incompletefallback on repeated permission denials and a “must end with safe output” requirement. - Added a workflow contract test (
pkg/cli/q_workflow_contract_test.go) asserting the presence of the new reliability language and safe-output expectations. - Regenerated
.github/workflows/q.lock.ymlto propagate the updated prompt contract into the compiled workflow.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/q_workflow_contract_test.go | Adds a contract test to guard Q’s prompt against missing safe-output fallback requirements. |
| .github/workflows/q.md | Documents explicit handling for repeated permission denials and mandates ending with a safe-output call. |
| .github/workflows/q.lock.yml | Updates compiled metadata/hash to reflect the prompt contract change at runtime. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Q workflow was succeeding at the job level but producing no safe outputs, which triggered
[aw] Q failedincidents. In the failing run, the agent encountered repeated non-interactive permission denials and exited with plain text instead of a safe-output action.Prompt contract hardening (
.github/workflows/q.md)Permission denied and could not request permission from usererrors occurreport_incompletewith blocked tool/command + exact errorcreate-pull-request,add-comment,add-labels,noop, orreport_incomplete)Compiled workflow update (
.github/workflows/q.lock.yml)