Repository navigation
fix(alpha): scan agent PR drafts by target repo visibility - #341
Open
tbhb-agent wants to merge 1 commit into
Open
tbhb-agent wants to merge 1 commit into
tbhb-agent wants to merge 1 commit into
Conversation
Generated-by: LLM effort=medium;harness=claude-code:2.1.322;model=anthropic:claude-sonnet-5-5;session=sha-256-64:24ed779d56b187de;started_at=2026-11-15T16:51:11Z;surface=cli
This branch has not been deployed
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.
Why
The driver's draft scan refused drafts that
tbhbdev alpha pr checkaccepted, which ended runs with status 5 and sent owners to open pull requests by hand. For a private repository,pr checkskips the host-name rules and the driver applied them.Behavior change
Before the driver scans the draft, it reads the visibility of the repository the PR opens in, using the run's push token. A
PRIVATEanswer skips the name rules, aspr checkdoes. Any other answer applies them, including an unreadable repository, a failed request, a non-JSON reply, and an unexpected value. A failed read scans as a public repository. Secret rules apply in every case.Risk
The driver makes one extra GitHub read per pull request. If the token can't read the repository, the scan runs as for a public repository, which matches the previous behavior.
Verification
tests/test_alpha_agent_open_pr.pypasses 54 tests with 100% line and branch coverage foropen_pr.py, andruffpasses. The tests cover private, public, and internal answers, a non-string value, a non-object body, a 404, a connection failure, and invalid JSON. The failing run's draft was unreadable. Scanning the body of github-metrics#94 with both visibility values passed, so the reproduction didn't settle the cause, and the difference in rule configuration and the shim-refusing binary lookup remain unchecked. The scan's refusal message now names the cause of the next failure.Opened-by: LLM effort=medium;harness=claude-code:2.1.322;model=anthropic:claude-sonnet-5-5;session=sha-256-64:24ed779d56b187de;surface=cli
Generated-by: LLM effort=medium;harness=claude-code:2.1.322;model=anthropic:claude-sonnet-5-5;session=sha-256-64:24ed779d56b187de;started_at=2026-11-15T16:51:11Z;surface=cli