Skip to content

Linter Miner: have discussion-miner read GitHub through the github bridge instead of gh - #73871

Merged
SivaKesava1 merged 3 commits into
mainfrom
copilot/fix-discussion-miner-access
Nov 1, 2026
Merged

SivaKesava1 merged 3 commits into
mainfrom
copilot/fix-discussion-miner-access

Conversation

Copilot AI commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

The discussion-miner sub-agent was told to query GitHub with gh, which isn't logged in inside the sandbox. In the routed runs, both gh issue list and gh api graphql failed authentication, the sub-agent returned [], and the main agent correctly ended with noop. The workflow already configures the GitHub MCP server, which the agent reaches through a github command on PATH. The main agent uses that command successfully; this PR points the sub-agent at it too.

Changes (## agent: discussion-miner section only)

  • How it reaches GitHub: the sub-agent runs the github command from bash. It is told not to use gh, not to set or ask for a GH_TOKEN, and not to assume a built-in GitHub tool call exists.
  • Check parameters first: it runs github --help and github <tool> --help before querying, and uses only the parameters that help shows. If a call fails, it corrects the arguments from --help instead of switching to gh.
  • Tools it uses (from the mcp-logs/tools.json cited in the issue): search_issues, list_issues, list_discussions, get_discussion, get_discussion_comments, all scoped to github/gh-aw. It follows pagination until the window is covered, filters discussions by createdAt, and reads bodies and comments before citing an item.
  • Unchanged: the 14-day window with a 30-day fallback when fewer than 5 relevant items turn up, the name/description/source output format, and the limit of 5 candidates.
  • One new rule: never invent candidates. If GitHub can't be read, return [] and state the error. The main agent's noop rule is untouched.
SINCE="$(date -u -d '14 days ago' +%Y-%m-%d)"   # '30 days ago' for the fallback
github search_issues --owner github --repo gh-aw --query "repo:github/gh-aw is:issue created:>=${SINCE}" --perPage 100
github list_issues --owner github --repo gh-aw --since "${SINCE}T00:00:00Z" --perPage 100
github list_discussions --owner github --repo gh-aw --orderBy CREATED_AT --direction DESC --perPage 100
github get_discussion --owner github --repo gh-aw --discussionNumber <number>
github get_discussion_comments --owner github --repo gh-aw --discussionNumber <number>

Generated file

  • linter-miner.lock.yml: only the prompt hash changes (in the metadata header and GH_AW_ADMISSION_WORKFLOW_HASH), because the prompt text is loaded when the workflow runs.

Notes for review

  • The parameter names in the examples follow the GitHub MCP server's schemas but were not checked against real github --help output in the sandbox. That is why the prompt makes --help the first step.
  • Whether discussion-miner can actually read GitHub this way (acceptance cases 1 and 2) still needs the authorized dispatch of this branch.
  • No changes to the frontmatter, models, toolsets, code-pattern-scanner, linter-writer, or the protected-file fallback.

…MCP CLI bridge

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix discussion-miner access to GitHub through unauthenticated gh Linter Miner: have discussion-miner read GitHub through the github bridge instead of gh Nov 1, 2026
Copilot AI requested a review from SivaKesava1 November 1, 2026 19:18
Comment thread .github/workflows/linter-miner.md Resolved
@SivaKesava1
SivaKesava1 marked this pull request as ready for review November 1, 2026 19:24
Copilot AI dynamic review requested due to automatic review settings November 1, 2026 19:24
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

Generated from Design Decision Gate 🏗️ · routed: opus55 medium · ~11 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · haiku45 · ~8 AIC · ⌖ ~7 AIC · ◇ ~4 AIC · ⊞ 9.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated from Ponytail Reviewer · gpt56 · ~6 AIC · ⌖ ~6 AIC · ⊞ 15.2K · ◷

Generated by Ponytail Reviewer for #73871

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-01T19:29:00Z
review_event: COMMENT
top_themes:
  - issue-state filtering may omit closed issues
  - unbounded discussion hydration can exhaust bridge/context budget
files_reviewed:
  - .github/workflows/linter-miner.md
  - .github/workflows/linter-miner.lock.yml
comment_count: 2

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.7K · ◷
Comment /review to run again

@github-actions github-actions 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.

Review summary

Two non-blocking correctness/operability concerns were identified and commented inline. The new bridge examples may omit closed issues depending on the documented default, and discussion hydration has no explicit budget for high-volume windows. No critical or high-severity blocker was found in the changed lines.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again

Comment thread .github/workflows/linter-miner.md Resolved
Comment thread .github/workflows/linter-miner.md Resolved

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.

🔵 Needs a closer look

The required fixed-branch run remains unvalidated for discussion-miner’s own GitHub reads and downstream progress, while existing evidence predates the fix and proves only parent bridge access.

No open issues 🎉

What changed in this PR

Updates Linter Miner’s discussion-miner sub-agent to use the configured github CLI bridge instead of unauthenticated gh, addressing the access failure described in #73870.

Changes:

  • Requires tool discovery through --help, repository-scoped queries, pagination, and reading supporting evidence.
  • Preserves the 14-day window, 30-day fallback, five-candidate limit, and main-agent noop rule; explicitly prohibits invented candidates.
  • Refreshes generated prompt and admission hashes without changing workflow configuration.

Successful GitHub access from the sub-agent still requires authorized runtime validation.

File Description
.github/​workflows/​linter-miner.md Replaces gh instructions with bridge discovery, querying, and error-handling guidance.
.github/​workflows/​linter-miner.lock.yml Updates body and admission hashes to match the revised prompt.

Review effort: Balanced (auto)

@github-actions github-actions 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs to the discussion-miner prompt change. Requesting changes on scope, budget, and output-contract gaps.

📋 Key Themes & Highlights

Key Themes

  • Scope drift: the list_issues call drops the old gh issue list --state all, so closed issues may be skipped while the PR says the window is unchanged.
  • Unbounded reads: pagination and per-discussion comment reads have no budget, which risks the engine-step timeout pattern in #66819.
  • Output contract: the error-reporting sentence sits next to a JSON array the main agent parses.
  • Unresolved security alert: the existing code-scanning comment on line 209 (prompt injection from issue and discussion bodies) still applies. This change makes the sub-agent read more untrusted content, so it should be addressed in this PR, for example with an explicit rule to treat fetched text as data, not instructions.

Positive Highlights

  • ✅ Forbidding gh and GH_TOKEN and requiring --help before calls is a clear, testable fix.
  • ✅ "Never invent candidates" tightens grounding.
  • ✅ The lock change is limited to the prompt hash, as the PR states.

@copilot please address the inline comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

Comment thread .github/workflows/linter-miner.md Resolved
Comment thread .github/workflows/linter-miner.md Resolved
Comment thread .github/workflows/linter-miner.md Resolved
…ean [] JSON block

Co-authored-by: SivaKesava1 <11771739+SivaKesava1@users.noreply.github.com>
Comment thread .github/workflows/linter-miner.md Resolved
@SivaKesava1
SivaKesava1 dismissed github-actions[bot]’s stale review November 1, 2026 22:05

Findings addressed: the read budget and clean [] output are fixed in 1147b57; the list_issues state/since point doesn't apply (the upstream github-mcp-server schema returns open and closed issues by default and supports since); prompt injection is pre-existing and answered in the thread.

@SivaKesava1
SivaKesava1 merged commit 52d9aa1 into main Nov 1, 2026
40 checks passed
@SivaKesava1
SivaKesava1 deleted the copilot/fix-discussion-miner-access branch November 1, 2026 22:05
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.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.

Linter Miner: discussion-miner cannot access GitHub through unauthenticated gh

4 participants