Repository navigation
Conversation
Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
| throw new Error(`${ERR_API}: Protected-file fallback issue search returned an invalid response`); | ||
| } | ||
| const targetPullRequestUrl = `${githubServer}/${repoParts.owner}/${repoParts.repo}/pull/${pullNumber}`; | ||
| const existingIssue = searchResults.items.find(item => !item.pull_request && item.body?.includes(`](${targetPullRequestUrl})`)); |
There was a problem hiding this comment.
@copilot search can be expensive in gh api points and is likely to fail at scale. Try to use a more efficient REST/graphql API. Handle throttling as not found.
There was a problem hiding this comment.
Replaced Search API with a label- and state-filtered REST issue listing, paginated to find existing matches. Rate-limit errors are treated as not found; other lookup failures still fail closed. Added coverage for throttling. Commit: 15384d7.
Co-authored-by: pelikhan <[email protected]>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🚀 PR Specification Reviewer has started processing this pull request |
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one blocking correctness issue: reusing an existing fallback issue discards the current run's report and evidence, leaving maintainers with potentially stale instructions and artifact links. Please preserve the current report when reusing the issue and add regression coverage.
The specialist review completed; its rate-limit concern was not retained because this PR explicitly treats throttled lookup as not found, and other candidates were either already covered by existing review comments or lower-confidence robustness concerns.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| if (!Array.isArray(response?.data)) { | ||
| throw new Error(`${ERR_API}: Protected-file fallback issue lookup returned an invalid response`); | ||
| } | ||
| existingIssue = response.data.find(item => !item.pull_request && item.body?.includes(`](${targetPullRequestUrl})`)); |
There was a problem hiding this comment.
[P1] Preserve the current run's report when reusing an issue
issueReport is built from this run's patch/artifact and expiration, but the reuse branch never appends or updates it. The activation comment is redirected to an older issue that may contain stale apply instructions, protected-file lists, or run URLs, so this fallback can direct maintainers to apply the wrong change. Please add the current report as a comment (or update the issue) before reusing it, and cover that behavior with a test.
There was a problem hiding this comment.
Reused issues now receive the current run’s rendered report as a comment before activation is redirected; commit 0f23482.
There was a problem hiding this comment.
🟡 Changes recommended
Issue reuse lacks trusted provenance and current-proposal validation, allowing unrelated issues to suppress the review report, while rate-limited lookups can lead to duplicate issue creation.
2 open issues
What changed in this PR
This PR adds issue reuse to gh-aw’s protected-file fallback path, aiming to reduce repeated review issues for the same pull request.
Changes:
- Scan open fallback issues and reuse one linking to the target PR.
- Add reuse and lookup-error tests, including rate-limit handling.
- Export the rate-limit helper and add an index-search documentation reference.
| File | Description |
|---|---|
actions/setup/js/push_to_pull_request_branch.test.cjs |
Adds lookup mocks and tests for reuse and lookup failures. |
actions/setup/js/push_to_pull_request_branch.cjs |
Adds paginated lookup before creating a fallback issue. |
actions/setup/js/error_recovery.cjs |
Exports isRateLimitError for lookup error handling. |
.github/skills/agentic-workflows/SKILL.md |
Adds the index-search reference to the documentation list. |
Review effort: Balanced (auto)
| if (!Array.isArray(response?.data)) { | ||
| throw new Error(`${ERR_API}: Protected-file fallback issue lookup returned an invalid response`); | ||
| } | ||
| existingIssue = response.data.find(item => !item.pull_request && item.body?.includes(`](${targetPullRequestUrl})`)); |
| if (!isRateLimitError(lookupError)) { | ||
| throw lookupError; | ||
| } | ||
| core.warning(`Protected-file fallback issue lookup was rate limited; treating it as not found`); | ||
| break; |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd, requesting changes. The REST-based lookup is a real improvement over the search API, but the dedup match is still unauthenticated and one new doc reference is dangling.
📋 Key Themes & Highlights
Key Themes
- Trust boundary in dedup: reuse matches any open
pull-request-fallbackissue whose body contains the PR link, with no author check. This is the GHAS prompt-injection finding and it is still unaddressed in code. - Fail-closed contract mismatch: the PR description says a failed lookup must not create another issue, but rate-limited lookups fall through to creation.
- Dangling reference:
.github/aw/index-search.mdis added toSKILL.mdbut the file does not exist at this head and nothing generates it. - Test gaps: no coverage for the invalid-response branch, multi-page matching, or a non-matching or different-PR issue.
- Unbounded pagination: the
for (;;)lookup has no page ceiling.
Positive Highlights
- ✅ Matching on
](${targetPullRequestUrl})is correct: the template renders[#N](pr_url). - ✅ Using
isRateLimitErrorand filtering by label and state is a clean fix for the search API cost issue. - ✅ Non-rate-limit lookup failures rethrow and fail closed, with a test.
Verification Note
I could not run the test suite: vitest is not installed here and the npm registry rejected the TLS certificate. I checked the syntax of both changed .cjs files and reviewed the test assertions by reading them. Please run push_to_pull_request_branch.test.cjs in CI.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.3K
Comment /matt to run again
| if (!Array.isArray(response?.data)) { | ||
| throw new Error(`${ERR_API}: Protected-file fallback issue lookup returned an invalid response`); | ||
| } | ||
| existingIssue = response.data.find(item => !item.pull_request && item.body?.includes(`](${targetPullRequestUrl})`)); |
There was a problem hiding this comment.
[/diagnosing-bugs] Reuse trusts any open pull-request-fallback issue whose body contains the PR link, and the issue author is never checked. The GHAS prompt-injection finding on this line is still unaddressed in code; the REST switch only changes how issues are listed.
💡 Suggested fix
Compare the author against the identity this workflow creates issues as (for example item.user?.login), and add a test where a same-link issue from another author is ignored and a new issue is created.
@copilot please address this.
There was a problem hiding this comment.
Reuse now requires the exact PR URL, both gh-aw execution provenance markers, and an author matching the authenticated GitHub App or user token; commit 0f23482.
| - `.github/aw/github-mcp-server-tools.md` | ||
| - `.github/aw/github-mcp-server.md` | ||
| - `.github/aw/harbor.md` | ||
| - `.github/aw/index-search.md` |
There was a problem hiding this comment.
[/codebase-design] This adds a reference to .github/aw/index-search.md, which does not exist in the repo at this head and is not generated anywhere. Agents following this index would hit a missing doc.
💡 Suggested fix
Drop the line, or add the document in this PR.
@copilot please address this.
There was a problem hiding this comment.
The requested merge brought in .github/aw/index-search.md, so the reference now resolves; merge commit fbc322b.
| if (!isRateLimitError(lookupError)) { | ||
| throw lookupError; | ||
| } | ||
| core.warning(`Protected-file fallback issue lookup was rate limited; treating it as not found`); |
There was a problem hiding this comment.
[/diagnosing-bugs] A rate-limited lookup now falls through to creating a new issue, so throttled repeat runs can still produce duplicates. This follows the requested "treat as not found" behaviour, but the PR description says a failed lookup must not create another issue.
💡 Suggested fix
Update the PR description to call out this exception, so the fail-closed claim is accurate.
@copilot please address this.
There was a problem hiding this comment.
Rate-limited lookup calls now propagate to the fallback failure path and never create another issue; commit 0f23482.
| core.info(`Created manifest-protection review issue #${issue.number}: ${issue.html_url}`); | ||
| const targetPullRequestUrl = `${githubServer}/${repoParts.owner}/${repoParts.repo}/pull/${pullNumber}`; | ||
| let existingIssue; | ||
| for (let page = 1; ; page++) { |
There was a problem hiding this comment.
[/codebase-design] for (let page = 1; ; page++) has no page ceiling, so a repo with many open fallback issues makes every fallback run scan without limit under throttling.
💡 Suggested fix
Add a small max-page constant. Treat reaching it as a lookup failure and fail closed rather than creating a duplicate.
@copilot please address this.
There was a problem hiding this comment.
Lookup is capped at five pages and fails closed if all five pages are full without a match; commit 0f23482.
| expect(issueBody).not.toContain("refs/bundles/"); | ||
| }); | ||
|
|
||
| it("should reuse an open protected-file fallback issue for the same pull request", async () => { |
There was a problem hiding this comment.
[/tdd] Coverage gaps for the new lookup logic: (1) the invalid-response branch (!Array.isArray(response?.data)) has no test; (2) there is no multi-page case, so the match-on-page-2 path and the < 100 stop condition are unverified; (3) there is no negative case, so an issue linking a different PR (for example /pull/12 vs /pull/123) or a real pull request is not shown to be skipped.
💡 Suggested tests
Add one test per gap. Each should assert that issues.create is called only when no same-PR issue exists, and that an invalid response fails without creating an issue.
@copilot please address this.
There was a problem hiding this comment.
Added coverage for invalid and malformed responses, page-2 matches, short-page termination, and PR/author/provenance false matches; commit 0f23482.
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 15384d7
|
…act-log-timestamps Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>


Compact log reports preserve source timestamps and report untimed evidence, but repeated protected-file fallback runs could still create duplicate review issues for the same pull request.
pull-request-fallbackissues and reuse one whose body links to the same target PR.