Skip to content

refactor(pr): delete the Copilot pass budget and the review-thread filing command #1936

Closed

Description

@dan-petty

Friction

devops pr copilot-pass and devops pr threads file-issues exist for the release pull request alone. They serve one rule. Copilot reviews the release pull request. Its passes stop at the count in release_copilot_passes. A comment that remains after the last pass becomes a follow-up issue.

ADR 0012 removes that rule. A Copilot review becomes a request from a person, on any pull request into main. No policy gives a pull request an automatic Copilot pass. Nobody verified that the automatic pass is off in the repository settings. Item #1864 carries that check.

An item pull request follows the AGENTS.md rule for a review comment. The author fixes the comment in the thread and resolves the thread. A counted budget for a manual act is bookkeeping. After item #1861 merges, only the two commands call the budget code. That code serves a rule that no longer exists.

Evidence

Counts come from the tip of release/v0.2.39 (commit f3b17488) on 2026-10-22. Count them again when you start the work.

  • src/devops_cli/github/copilot_budget.py (216 lines) reads release_copilot_passes (:77-80). It calls require_open_release_pr (:147).
  • src/devops_cli/github/review_thread_issues.py (377 lines) calls require_open_release_pr too (:284).
  • src/devops_cli/github/pr_branches.py (92 lines) holds is_release_pr, require_open_release_pr and PullRequestRefusal. Readiness calls is_release_pr (commands/pr.py:1676). Item feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861 removes that call. Then only the two modules above use these three names.
  • The same file holds same_repository, branch_ref and default_branch. Readiness calls all three at the tip. Item feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861 rewrites readiness, so this item counts their callers again.
  • The commands sit at commands/pr.py:2857-2893 (copilot-pass) and :3055-3096 (file-issues). devops gh pr mounts the same Typer app (commands/gh.py:136). So devops gh pr copilot-pass and devops gh pr threads file-issues go too.
  • Four entries of CONST_MCP_COMMAND_EXCLUSIONS name the commands (config/constants.py:569, 577, 630, 633).
  • Five constants serve them: CONST_GH_COPILOT_REVIEWER, CONST_COPILOT_PASS_REFUSED_ERROR_CODE, CONST_PR_THREAD_FILED_MARKER, CONST_PR_THREAD_FILED_MARKER_RE and CONST_THREAD_FILING_REFUSED_ERROR_CODE (config/constants.py:1692-1708). CONST_GITHUB_GHOST_LOGIN in the same range stays, because pr_threads.py uses it.
  • Two defaults serve them: DEFAULT_ROADMAP_RELEASE_COPILOT_PASSES and DEFAULT_PR_THREAD_ISSUE_TEXT_CHARS (config/defaults.py:804-808).
  • Two exceptions serve them: CopilotPassRefusedError and ThreadFilingRefusedError (exceptions/git.py:224-255).
  • 43 message fields (lang/en/messages.py:723-826) and five help fields (lang/en/help.py:859-874 and :930-939) serve them. I checked each message field with git grep. Only the two modules, the two commands and read_viewer_login use them.
  • release_copilot_passes is a field of RoadmapConfig (roadmap/config.py:62) and a comment in .github/roadmap.toml:39. RoadmapConfig forbids unknown keys (roadmap/config.py:42). So a file that still sets the key fails to parse.
  • Only the thread filing reads these members of github/pr_threads.py: read_viewer_login (:374), viewer_args (:248), the Viewer query (:192), ReviewThread.is_outdated, ReviewThread.original_line and ReviewComment.url. git grep over src finds no other reader.
  • Only copilot_budget.py (:100) reads CopilotReviewStatus.pass_requested (github/pr_monitor.py:93). Line :446 sets it from the requested flag of the timeline (:266). Two comments in pr_monitor.py (:91 and :438) name the Copilot budget.
  • tests/test_github_copilot_budget.py has 449 lines. tests/test_github_pr_threads.py has 1,322 lines. From the heading at :625, 698 lines and 25 tests cover the thread filing. tests/test_roadmap_config.py names the key in four places (:29, :60, :104 and :119).
  • tests/copilot_review_payloads.py (87 lines) stays. tests/test_github_pr_monitor.py uses its helpers and constants.
  • The generated pages name both commands: README.md:384, docs/commands/pr.md, docs/commands/gh.md, docs/CLI_REFERENCE.md and docs/ERRORS.md (:47 and :121).
  • Hand-written text names them in RELEASE_CYCLE.md:225-226 and in docs/SDLC.md (:299 and :302).
  • docs/agent/tasks/task-1345-release-copilot-pass-budget.md (62 lines) describes both commands as delivered.

Existing tool considered

This item builds nothing. It deletes code. The project rule "Open Tools Before Internal Code" asks for a written cost when a build replaces an open tool. No build happens here.

  • Copilot review request. The reviewer request on the pull request page of GitHub asks for a Copilot review. A person uses it. The deleted command wrapped gh pr edit --add-reviewer @copilot (CONST_GH_COPILOT_REVIEWER). The new AGENTS.md text that item feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861 carries says that agents do not request a Copilot review.
  • Copilot state in the monitor. devops pr monitor reads the Copilot review state from the review and timeline reads. It stays.
  • Pass counter. No open tool counts Copilot passes, and none is needed. The person who requests a review decides when to stop.
  • Thread filing. No open tool is needed, because the need is gone. The author fixes the comment in the thread and resolves the thread. A person who wants a follow-up issue files it with devops roadmap intake.
  • Written cost. ADR 0012 gives size in lines only, because no file in this repository records tokens. This item states its tokens and its elapsed time before work starts.

Proposed remedy

Delete the code, the strings and the tests that serve the two commands. Keep devops pr threads list, reply, resolve, resolve-all and unresolve. Keep devops pr monitor and tests/copilot_review_payloads.py.

  1. Delete github/copilot_budget.py and github/review_thread_issues.py.
  2. In github/pr_branches.py, delete is_release_pr, require_open_release_pr and PullRequestRefusal. Delete their imports and __all__ entries. Write a new module docstring.
  3. Delete a helper of pr_branches.py that readiness no longer calls after item feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861. Delete the file if no helper remains. Delete CONST_RELEASE_BRANCH_RE (config/constants.py:3765). After feat(release): release-please opens the release pull request, topic pull requests target main, and its merge publishes #1861 and this item, no code reads it. It is built from CONST_RELEASE_BRANCH_PREFIX. If the planner item that creates date-titled milestones has merged, delete the prefix too.
  4. Delete the copilot-pass and file-issues commands in commands/pr.py and their four CONST_MCP_COMMAND_EXCLUSIONS entries.
  5. Delete the constants, defaults, exceptions, message fields and help fields in the Evidence list.
  6. Delete the field release_copilot_passes from RoadmapConfig. Delete the comment at .github/roadmap.toml:39.
  7. Delete from pr_threads.py the members that only the thread filing read. Delete the GraphQL fields isOutdated, originalLine and url that only those members read.
  8. Delete CopilotReviewStatus.pass_requested, the requested flag of the timeline, _requests_copilot and each constant that only they use. Run git grep on each name first. Rewrite the two comments that name the Copilot budget.
  9. Run devops docs generate --sync-readme. It updates the generated pages. Remove each import that the deleted code leaves unused.

What it deletes

I counted the whole files with wc -l. I estimated the other rows from the line ranges in the Evidence list. No tool counted them.

File Lines deleted
github/copilot_budget.py 216 (whole file)
github/review_thread_issues.py 377 (whole file)
github/pr_branches.py about 60 of 92
commands/pr.py about 80
exceptions/git.py about 35
lang/en/messages.py 104
lang/en/help.py 26
config/constants.py 19
config/defaults.py, roadmap/config.py and .github/roadmap.toml about 8
github/pr_threads.py about 30
github/pr_monitor.py about 30

The source total is about 990 lines. Tests lose about 1,160 lines: 449 (whole file), 698 (the filing section) and about 13 in test_roadmap_config.py. The monitor tests about a pending Copilot request change too. The generated pages lose the sections of both commands and two rows of docs/ERRORS.md.

Order and dependencies

ADR 0012 lists this item in step 12 ("The Copilot pass commands go"). Step 12 follows step 6.

Pull request

  • The pull request targets main. Its title is a Conventional Commit. The title is the changelog entry.
  • Its body says Closes #<this issue> and names no other issue. It does not use Part of.
  • It adds no changelog fragment and does not edit CHANGELOG.md.
  • It carries the archived OpenSpec change folder of this issue as its last commit. Until the switch of ADR 0010 lands, it changes the task file of this issue instead.

Tests

Change the tests first. No test asserts that a removed name stays removed, because git history records the deletion (#1871).

  • The existing test of a misspelt key in tests/test_roadmap_config.py keeps its case with another key. It shows that RoadmapConfig still forbids an unknown key.
  • The monitor test about a pending Copilot request asserts is_active and state only.
  • The tests of devops pr threads list, reply, resolve, resolve-all and unresolve pass without change. The tests of devops pr monitor pass, except the test named above.

Acceptance criteria

  • The author runs uv run devops pr --help, uv run devops pr threads --help and uv run devops gh pr --help. None of them lists copilot-pass or file-issues. No test asserts this.
  • .github/roadmap.toml and RoadmapConfig hold no release_copilot_passes. The existing test of a misspelt key passes.
  • .github/roadmap.toml still parses to the RoadmapConfig that tests/test_roadmap_config.py expects.
  • This command prints nothing: git grep -nEi "copilot_budget|review_thread_issues|copilot-pass|file-issues|release_copilot_passes|is_release_pr|require_open_release_pr|PullRequestRefusal|CopilotPassRefusedError|ThreadFilingRefusedError|pass_requested|read_viewer_login|stop rule|Copilot budget|CONST_RELEASE_BRANCH_RE" -- . ':!tests' ':!CHANGELOG.md' ':!changelog.d' ':!docs/adr' ':!docs/agent'.
  • The same command over tests prints nothing.
  • Every function left in github/pr_branches.py has a caller outside the file, or the file is gone.
  • devops pr monitor and devops pr threads list, reply, resolve, resolve-all and unresolve work as before.
  • uv run devops docs check passes.
  • uv run devops ci passes with at least 90 percent coverage and no deprecation warning.

Pending a person

Activity

  1. added
    type/refactor
    on Oct 22, 2026
  2. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/refactor. The candidate deletes code that is no longer used after ADR 0012.
    • Priority: P2-Medium. The change removes outdated functionality but does not fix a bug or add a feature.
    • Value: Low. The change affects only internal tooling and does not impact users directly.
    • Effort: Medium. The change involves removing multiple modules, commands, constants, tests, and references across the codebase.
  3. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Delivered by #1952: devops pr copilot-pass, devops gh pr copilot-pass, devops pr threads file-issues, copilot_budget.py and review_thread_issues.py are deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/refactor

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions