Repository navigation
[Repo Assist] Label review_threads responses from get_review_comments - #15846
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write or mutation leaked in this run. Part B is Full detail:
|
There was a problem hiding this comment.
🟡 Changes recommended
Structured-only MCP responses can incorrectly deny trusted threads, while collection filtering drops pagination metadata needed to fetch subsequent pages.
2 open issues
What changed in this PR
Extends the GitHub guard to recognize nested review-thread responses from pull_request_read(get_review_comments), addressing #15838 while retaining the fail-closed behavior introduced by #14930.
Changes:
- Labels each thread using its lowest comment integrity, restricting mixed-trust threads as a whole.
- Supports plain-string author logins and reuses shared integrity ranking.
- Adds regression coverage for trusted and blocked authors and thread label paths.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/response_paths.rs |
Adds thread-level provenance labeling and regression coverage. |
guards/github-guard/rust-guard/src/labels/helpers.rs |
Supports string author logins and exposes integrity ranking. |
Review effort: Max (auto)
| if let Some(threads) = actual_response | ||
| .get("review_threads") | ||
| .and_then(Value::as_array) |
| secrecy, | ||
| none_integrity(&repo_full, ctx), | ||
| )), | ||
| items_path: Some("/review_threads"), |
|
@copilot address review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Addressed the structuredContent and pagination-envelope feedback, with regression coverage. Commit: |

🤖 Repo Assist here — automated AI assistant.
Closes #15838
Root cause:
pull_request_read(get_review_comments)returnsreview_threads[].comments[]with stringauthorlogins;extract_items_arrayonly knewreview_comments, so no fine-grained labels were produced and the gateway (correctly, per #14930) fell back to the coarsenone:publicdenial.Fix (rust-guard):
label_author_itemsnow recognises areview_threadsenvelope and labels each thread (path/review_threads/N,items_path=/review_threads).user_authored_integrity, so blocked users, trusted users and collaborator elevation apply). The gateway labels one collection element at a time, so a thread containing a low-integrity comment is restricted as a whole — fail-closed is preserved.extract_author_loginnow acceptsauthoras a plain string login.Trade-offs: granularity is per thread, not per nested comment. Author trust for logins lacking
author_associationis resolved via the existing collaborator-permission elevation path. Per-comment filtering would need gateway changes.Test Status
cargo test: 692 passed (new testreview_threads_use_lowest_comment_integritycovers trusted thread, mixed thread, blocked author, pagination metadata).cargo fmtapplied; clippy shows only a pre-existing warning elsewhere.make agent-finishednot run (Rust-only change).Add this agentic workflow to your repo
To install this agentic workflow, run