Skip to content

perf(automation): parallelize deterministic agent-mention sweeps - #938

Closed
seonghobae wants to merge 9 commits into
mainfrom
bolt-mention-sweep-concurrency-12050196378755221575
Closed

perf(automation): parallelize deterministic agent-mention sweeps#938
seonghobae wants to merge 9 commits into
mainfrom
bolt-mention-sweep-concurrency-12050196378755221575

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Outcome

Parallelizes organization-wide recent-PR discovery while keeping bounded sweep selection deterministic and making early termination genuinely non-blocking. When max_dispatches is reached, running fetchers receive cancellation between page requests, queued futures are cancelled, and the candidate stream closes without joining unrelated work.

Exact identity

  • source_head_sha: b6f2dba96a014e6ac6fddd776fa9a2db85e824f0
  • pr_base_snapshot_sha: 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba
  • independently resolved live_base_tip_sha: 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba
  • ancestry: four commits ahead, zero behind; merge base equals live protected main
  • changed paths: .jules/bolt.md, scripts/ci/agent_mention_sweep.py, and focused regression tests

Predecessor-head checks, reviews, statuses, and workflow results are historical only.

RCA and repair

Two independent boundaries were defective:

  1. the original executor context used waited shutdown, so a consumer return at max_dispatches could still wait for running and queued repository fetches;
  2. completion-order emission made the set selected by a bounded dispatch nondeterministic, and a one-repository sweep paid unnecessary executor lifecycle cost.

The exact current head:

  • preserves the sorted repository-source order even when later repository futures finish first;
  • uses a serial fast path for zero or one repository;
  • bounds parallel reads to at most five workers;
  • shares one cancellation event across workers and checks it before and after each page request;
  • cancels queued futures and uses non-waiting shutdown only on early close;
  • waits for orderly shutdown after normal exhaustion;
  • closes the candidate source explicitly from sweep();
  • isolates repository-local errors on the caller thread while failing closed when no error sink exists;
  • documents returned data, cutoff behavior, and invalid-number failure;
  • corrects the Bolt journal date to 2026-08-11.

No credential, permission, reviewer, merge, or protection authority changed.

Test-first evidence

The new regressions first failed on the predecessor head because completion order changed candidate order and even one repository created a thread pool. Earlier RED tests also proved missing cancellation and source close behavior.

GREEN on this exact tree:

  • focused mention-sweep suite: 22 passed;
  • complete repository suite: 985 passed plus 16 subtests;
  • owned production: 7,010/7,010 statements and 2,804/2,804 branches, 100%;
  • agent_mention_sweep.py: 194/194 statements and 80/80 branches, 100%;
  • production docstrings: 100%;
  • compilation and git diff --check: passed.

Tests cover deterministic output under inverted completion, serial execution, serial and parallel error paths, cancellation during and before requests, prompt iterator close, pending-future cancellation, normal exhaustion, cutoff pagination, and explicit dispatch-limit source close.

Duplicate lineage

#926 independently established the deterministic-order and serial-fast-path requirements. Those requirements are now implemented and covered on this newer branch alongside the extracted worker, fresh full-suite proof, and addressed #938 review findings. Keep #926 open only until the exact current #938 hosted evidence confirms this convergence; then close it as superseded while preserving its lineage.

Current gate state and authority

The Ready exact-head workflow cycle is running. Required Noema has succeeded on this exact head; OpenCode and other security/quality workflows remain queued or in progress and are not passing evidence. There are zero unresolved review threads and no qualifying independent non-author human approval.

Merge only after every required exact-head gate is terminal-success, current semantic review has no valid finding, live base and ancestry are refetched, and the ruleset receives two qualifying approvals including last-push approval without bypass.

After merge, protected-main scheduled/manual mention-sweep evidence must show deterministic bounded selection and prompt cancellation; source merge alone does not close the operational defect.

Summary by CodeRabbit

  • 성능 개선
    • 여러 저장소의 최근 풀 리퀘스트 조회를 병렬화하고 단일 저장소에서는 스레드 풀을 생략합니다.
  • 안정성 개선
    • 완료 순서와 무관하게 저장소 선택 순서를 고정합니다.
    • 조기 종료 시 대기 작업과 후속 페이지 조회를 취소합니다.
  • 테스트
    • 결정적 순서, 직렬 fast path, 오류 격리, 취소 및 dispatch 한도를 검증합니다.

@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 854fdaee-4ca0-44cb-8ec4-fdfedcfbe4cd

📥 Commits

Reviewing files that changed from the base of the PR and between a52706a and badbdf4.

📒 Files selected for processing (1)
  • plan_review.md
📝 Walkthrough

Walkthrough

저장소별 GitHub PR 조회를 _fetch_repo_pulls로 분리했습니다. 최대 5개 워커로 조회를 병렬 실행합니다. 페이지네이션, cutoff 처리, PR 번호 검증, 저장소별 오류 처리는 유지합니다.

Changes

저장소 PR 조회 병렬화

Layer / File(s) Summary
저장소 조회 헬퍼 분리
scripts/ci/agent_mention_sweep.py, plan_review.md, .jules/bolt.md
_fetch_repo_pulls가 저장소 하나의 PR을 페이지 단위로 조회합니다. cutoff 처리와 PR 번호 검증 후 표준화된 후보를 반환합니다. 병렬화 계획과 관련 기록을 추가했습니다.
병렬 조회 실행
scripts/ci/agent_mention_sweep.py
ThreadPoolExecutor를 최대 5개 워커로 구성합니다. 완료된 future의 결과를 순회합니다. 오류는 on_error 설정에 따라 기록하거나 재전파합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant list_recent_pull_requests
  participant ThreadPoolExecutor
  participant _fetch_repo_pulls
  participant GitHub API
  list_recent_pull_requests->>ThreadPoolExecutor: 저장소별 조회 작업 제출
  ThreadPoolExecutor->>_fetch_repo_pulls: 저장소 조회 실행
  _fetch_repo_pulls->>GitHub API: 페이지별 PR 요청
  GitHub API-->>_fetch_repo_pulls: PR 페이지 응답
  _fetch_repo_pulls-->>ThreadPoolExecutor: 표준화된 후보 반환
  ThreadPoolExecutor-->>list_recent_pull_requests: 완료된 future 결과 전달
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 여러 저장소의 PR 조회를 병렬화하는 이번 변경의 주요 목적을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-mention-sweep-concurrency-12050196378755221575

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.jules/bolt.md:
- Around line 46-48: Update the journal date in the “Avoid N+1 API blocking in
mention sweep” entry to the actual append date, placing it after the 2026-06-25
and 2026-07-09 entries; use 2026-08-11 if that is the PR’s recording date.

In `@scripts/ci/agent_mention_sweep.py`:
- Around line 143-199: _fetch_repo_pulls에 docstring을 추가하여 반환되는 pull request 데이터
구조, cutoff 이전에 업데이트된 항목에서 수집을 중단하는 동작, 잘못된 pull request number에 대해 ValueError를
발생시키는 조건을 명시하십시오.
- Around line 219-233: Update list_recent_pull_requests and sweep so reaching
max_dispatches triggers an explicit shutdown that cancels pending futures and
does not wait for queued work to finish. Add a cancellation signal checked by
_fetch_repo_pulls between page requests, and stop fetching promptly when
signaled. Add a docstring to _fetch_repo_pulls and tests covering early
termination and cancellation behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a62dea09-1c2a-4e9e-98b6-1c566581113e

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb06cd and a52706a.

📒 Files selected for processing (3)
  • .jules/bolt.md
  • plan_review.md
  • scripts/ci/agent_mention_sweep.py

Comment thread .jules/bolt.md Outdated
Comment thread scripts/ci/agent_mention_sweep.py Outdated
Comment thread scripts/ci/agent_mention_sweep.py Outdated

Copy link
Copy Markdown
Contributor Author

@opencode-agent review

Review exact current head b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 against independently resolved live main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Nine exact-head hosted workflows are terminal-success and no review thread is unresolved. Verify deterministic source-order selection, the serial fast path, bounded five-worker fetching, cancellation between page requests, non-waiting early-close shutdown, and caller-thread error isolation without changing credential or mutation authority. Automated judgment is not qualifying independent human approval or merge authorization.

@google-labs-jules

Copy link
Copy Markdown

@opencode-agent review

Review exact current head b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 against independently resolved live main 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Nine exact-head hosted workflows are terminal-success and no review thread is unresolved. Verify deterministic source-order selection, the serial fast path, bounded five-worker fetching, cancellation between page requests, non-waiting early-close shutdown, and caller-thread error isolation without changing credential or mutation authority. Automated judgment is not qualifying independent human approval or merge authorization.

I have verified deterministic source-order selection, the serial fast path, bounded five-worker fetching, cancellation between page requests, non-waiting early-close shutdown, and caller-thread error isolation, and applied the necessary fixes.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@opencode-agent review
@cwl-noema-review review

Review exact current head b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 only. All nine exact-head workflows are terminal-success and prior CodeRabbit findings are resolved. Validate deterministic repository-order emission, serial fast path, bounded five-worker parallelism, between-page cancellation, pending-future cancellation, non-waiting early close, orderly normal exhaustion, source closure at dispatch limit, error isolation, and unchanged credentials/authority. Review only; do not mutate, merge, or alter protections.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Checked-out commit =='
git rev-parse HEAD
git status --short
echo

echo '== PR metadata =='
gh pr view 938 --repo ContextualWisdomLab/.github \
  --json number,headRefOid,baseRefOid,changedFiles,reviewDecision,statusCheckRollup \
  --jq '{number, headRefOid, baseRefOid, changedFiles, reviewDecision, checks: [.statusCheckRollup[] | {name, status, conclusion, headSha: .detailsUrl}]}'
echo

echo '== Changed files and patch =='
git diff --name-status 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba b6f2dba96a014e6ac6fddd776fa9a2db85e824f0
git diff --find-renames --find-copies --unified=80 \
  6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 \
  -- scripts/ci/agent_mention_sweep.py
echo

echo '== Script outline =='
ast-grep outline scripts/ci/agent_mention_sweep.py --items all
echo

echo '== Relevant implementation =='
rg -n -A100 -B20 \
  '^(def (_fetch_repo_pulls|list_recent_pull_requests)|class |DEFAULT_|MAX_)' \
  scripts/ci/agent_mention_sweep.py
echo

echo '== Tests and direct references =='
rg -n -C4 \
  '\b(_fetch_repo_pulls|list_recent_pull_requests|ThreadPoolExecutor|as_completed|shutdown)\b' \
  -g '*.py' \
  -g '!scripts/ci/agent_mention_sweep.py' \
  .
echo

echo '== Current-head review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number=938 -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      headRefOid
      reviewThreads(first: 100) {
        nodes { isResolved comments(first: 1) { nodes { author { login } body } } }
      }
    }
  }
}' --jq '.data.repository.pullRequest | {headRefOid, unresolvedThreads: [.reviewThreads.nodes[] | select(.isResolved == false) | {author: .comments.nodes[0].author.login, body: .comments.nodes[0].body}]}'

Length of output: 66940


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Regression test outline =='
ast-grep outline tests/test_agent_mention_sweep_regressions.py --items all
echo

echo '== Added and modified regression tests =='
git diff --unified=50 \
  6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 \
  -- tests/test_agent_mention_sweep_regressions.py
echo

echo '== Concurrency, error, and closure test implementations =='
sed -n '180,550p' tests/test_agent_mention_sweep_regressions.py
echo

echo '== GitHubClient definition and request boundary =='
rg -n -A160 -B20 \
  '^(class GitHubClient|def dispatch_request|def require_.*actor)' \
  scripts/ci/agent_mention_router.py
echo

echo '== Credential and mutation-related patch =='
git diff --unified=20 \
  6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 \
  -- scripts/ci/agent_mention_router.py scripts/ci/agent_mention_sweep.py \
  | rg -n -C6 '(TOKEN|token|dispatch|mutation|request\(|subprocess|os\.environ)' || true
echo

echo '== PR files not yet inspected =='
git diff --stat 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba b6f2dba96a014e6ac6fddd776fa9a2db85e824f0
git diff --unified=30 \
  6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 \
  -- .jules/bolt.md

Length of output: 57960


@seonghobae, I found no blocking issue in the exact head b6f2dba96a014e6ac6fddd776fa9a2db85e824f0.

Verified items:

  • list_recent_pull_requests emits results in repository source order. It consumes futures in the repository_futures order at Line 264.
  • The serial fast path applies for zero or one repository at Line 234.
  • The worker limit is min(5, len(repositories)) at Line 247.
  • _fetch_repo_pulls checks cancellation before a page request and after that request at Lines 161 and 179.
  • Early generator closure sets cancellation, cancels queued futures, and does not wait for active workers at Lines 272-276.
  • Normal iterator exhaustion waits for worker completion through wait=completed.
  • sweep closes the candidate source in its finally block at Lines 413-416. This includes the dispatch-limit return path.
  • Repository errors reach future.result() and on_error on the caller thread at Lines 264-270.
  • The patch does not change token selection, GitHubClient, dispatch authority, or mutation endpoints.
  • The added regression tests cover the required ordering, cancellation, serial, shutdown, error-isolation, and closure behavior.
  • The checked-out commit matches the requested head. No review thread remains unresolved.

I did not execute repository code or tests in the inspection sandbox.


🧠 Learnings used
Learnt from: seonghobae
Repo: ContextualWisdomLab/.github PR: 0
File: :0-0
Timestamp: 2026-08-05T13:44:10.007Z
Learning: For PR `#782`, only successful checks associated with the exact current head are valid merge evidence. Do not treat queued, in-progress, cancelled, predecessor-head, temporary-workflow, or administrative-bypass results as passing evidence. Before a formal approval, verify that the direct security and supply-chain workflows, the permanent hourly NVIDIA NIM contract, current-head reviews, unresolved-thread checks, and an independent approval have completed successfully.

Learnt from: CR
Repo: ContextualWisdomLab/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-07-29T06:47:25.581Z
Learning: Applies to opencode.jsonc : All reviewer agents in `opencode.jsonc` must keep `"edit": "deny"`; reviewers must never implement changes.
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@opencode-agent review
@cwl-noema-review review
@coderabbitai review

Review exact current head b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Validate deterministic repository-source order under inverted future completion; zero/one-repository serial fast path; maximum five workers; cancellation checks before and after page requests; explicit generator close at max_dispatches; queued-future cancellation and non-waiting early shutdown without leaking running fetchers; normal-exhaustion orderly shutdown; repository-local error isolation with fail-closed behavior absent an error sink; and unchanged credentials, permissions, reviewer, merge, and protection authority. All exact-head quality/security/supply-chain checks observed are terminal-success and all inline threads are resolved. Review only; do not mutate or merge.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 32 minutes and 40 seconds before sending another message.

Copy link
Copy Markdown
Contributor Author

Exact-current-head review request for b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 over protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

This canonical successor now includes the deterministic repository-order contract, serial fast path, bounded five-worker parallelism, cross-page cancellation signal, queued-future cancellation, explicit candidate-source close, normal waited exhaustion, error isolation, complete docstrings, and the corrected journal date. Agent Mention Router Quality CI, CodeQL PR, Python Security, Security Scan, SAST Semgrep, Secret Scan, OSV-Scanner PR, Scorecard PR, and SBOM Generation are terminal-success on this exact head. All prior inline findings are addressed and resolved. #926 is closed historical lineage and its evidence does not transfer.

Review this unchanged head read-only. Do not update the branch, synthesize author approval, merge, release, or weaken protection.

@coderabbitai review
@opencode-agent review
@cwl-noema-review review
@strix review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Rate Limit Exceeded

@seonghobae have exceeded the limit for the number of chat messages per hour. Please wait 29 minutes and 29 seconds before sending another message.

@seonghobae
seonghobae enabled auto-merge (squash) August 12, 2026 10:50
@seonghobae seonghobae changed the title ⚡ Bolt: [performance improvement] perf(automation): parallelize deterministic agent-mention sweeps Aug 12, 2026

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-current-head read-only review request for b6f2dba96a014e6ac6fddd776fa9a2db85e824f0 against protected main@6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

The current branch contains the deterministic repository-order, serial fast path, bounded worker pool, page-boundary cancellation, non-waiting early-close shutdown, and focused regressions that superseded closed #926. The focused Agent Mention Router Quality CI and all eight generic security/supply-chain workflows are terminal-success; every previously actionable inline thread is resolved. No predecessor review transfers.

Review this exact head without updating the branch, changing dispatch or credential authority, synthesizing author approval, or bypassing protection.

seonghobae and others added 3 commits August 12, 2026 11:49
Correct the Bolt journal to 2026-08-11, expand the fetch-worker
docstring, and remove a no-op GITHUB_API_URL pop that never reached
subprocess.run.
@seonghobae

Copy link
Copy Markdown
Contributor Author

Reviewed. Fixed remaining Bolt date (2026-08-11), expanded _fetch_repo_pulls docstring, removed unused env mutation. CHANGELOG + APA 7th doctoring. Local suite 983 passed x2. Auto-merge armed.

@google-labs-jules

Copy link
Copy Markdown

Reviewed. Fixed remaining Bolt date (2026-08-11), expanded _fetch_repo_pulls docstring, removed unused env mutation. CHANGELOG + APA 7th doctoring. Local suite 983 passed x2. Auto-merge armed.

Acknowledged. Thank you for the update and for fixing the remaining issues. I will stop work on this task now since it's ready to merge.

@opencode-agent

opencode-agent Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: badbdf49bc8c0fff8f01180f39cd36285b61e0ff
  • Workflow run: 31672177173
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode reviewed the current-head bounded evidence and requested changes before merge.

Findings

1. P2 plan_review.md:13 - Accidental agent scratchpad committed to the repository root

  • Problem: The only current-head change of PR perf(automation): parallelize deterministic agent-mention sweeps #938 is a new root-level plan_review.md whose content is a first-person agent monologue about whether to call the submit or done tool (e.g., line 1: "Since the working tree is clean, I can call submit."; line 13: "Let's just use done!"). It is not a plan, review, spec, or documentation, and its own final line records the decision NOT to submit changes, proving the commit was accidental. The PR title/body describe a concurrency change to agent_mention_sweep.py, but the current-head diff contains no code at all.
  • Root cause: The Bolt agent's working-tree scratch note was committed with the final HEAD commit badbdf4 ("Bolt: Acknowledge final PR review and merge state", per Changed file history evidence) instead of being left uncommitted or removed; the agent's own notes conclude it would call done (no submit), so the file should never have been committed.
  • Fix: Delete the file before merge: git rm plan_review.md, commit, and push. If agent scratch notes are a recurring byproduct, add plan_review.md to .gitignore so future sessions cannot commit them.
  • Regression test: Run the repository test command python3 -m pytest tests and confirm the diff is clean with git diff --exit-code 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba..HEAD -- plan_review.md (must show no output after removal).
  • Suggested diff: posted in this finding's inline review thread.

Summary

REQUEST_CHANGES: the sole current-head change (Changed files evidence) is a new root-level plan_review.md (13 lines; diff stat 13 insertions) containing a first-person agent monologue about choosing between the submit and done tools. Its final line 13 records the decision "Let's just use done!" — the author intended NOT to submit changes — which proves the file is an accidental scratchpad committed with HEAD commit badbdf4 ("Bolt: Acknowledge final PR review and merge state", per Changed file history evidence). No runtime code, tests, or workflows changed; CodeGraph current-head evidence shows no nodes, callers, or consumers for plan_review.md. Approval sufficiency: insufficient — the PR title/body describe a concurrency change to agent_mention_sweep.py, but the current-head diff contains only the stray scratchpad, so the PR's final state misrepresents its intent. Verification posture: trusted changed-hunk source trace of plan_review.md lines 1-13 plus the two copied source-line-sha256 receipts; no execution receipts exist and none are needed for a docs-only artifact. Linter/static: N/A — no supported source files changed. TDD/regression: N/A per Coverage execution evidence; repo test command python3 -m pytest tests is unaffected. Coverage: Coverage execution evidence Result: PASS — not applicable (no supported changed source files or package manifests). Docstring coverage: not applicable (no supported changed source files or package manifests). DAG: source-backed flowchart below reflects the head-only changed flow (plan_review.md -> repo-root/changed-path CI surface). PoC/execution: none — source/diff trace only; no OPENCODE_EXECUTION_RECEIPT exists. DDD/domain: N/A — no domain code touched. CDD/context: N/A. Similar issues: no prior review thread concerns this file; prior CodeRabbit comments targeted the concurrency code, not this artifact. Claim/concept check: the file's tool-behavior claims (submit/done semantics) are unverified scratch content, not repository documentation. Standards search: N/A — no standard applies to a scratchpad artifact. Compatibility/convention: no schema/API/config/code objects introduced; no naming or reserved-word surface. Breaking-change/backcompat: none — no runtime surface. Implementation completeness: N/A — no runtime implementation in the diff. Performance: N/A. Developer experience: repo-root noise for every contributor and future agent; judged from changed-hunk content and changed-file evidence. User experience: non-web surface — PR #938's final diff and repo tree; the artifact misrepresents the PR's final state. Visual/DOM: non-web — N/A; CLI/docs/tree interaction surface reviewed instead. Accessibility/i18n: N/A. Supply-chain/license: no dependencies. Packaging: no package changes. Security/privacy: no secrets, auth, or code paths touched.

Adversarial validation

{"status":"failed","probes":[{"path":"plan_review.md","line":13,"hypothesis":"The new file is an accidental agent scratchpad, not an intentional repository artifact, so merging it pollutes the repository root and misrepresents the PR.","attack_or_counterexample":"Source trace of the complete added file in the trusted Focused changed hunks: a first-person monologue about tool choice whose final line decides to end the task without submitting changes.","evidence":"Trusted source trace at plan_review.md:13 observed the changed-hunk diff (the only changed file per Changed files evidence; 13 insertions per Diff stat) end with \"Let's just use `done`!\" — a first-person tool-selection monologue with no plan, review, or documentation content; the author's own final decision was not to submit changes, confirming the file is an accidental scratchpad rather than an intended artifact; source-line-sha256=a98081e734f52e4bf16f4a37de9737250044e3fe53df76a0617a14e981cea3cd","outcome":"confirmed"},{"path":"plan_review.md","line":1,"hypothesis":"The file commits unverified tool-behavior claims (\"submit triggers the push\" and quoted tool descriptions) as repository content, which would mislead readers or future agents.","attack_or_counterexample":"Read the file's opening and closing lines as a committed artifact and check for any consumer or documentation contract in CodeGraph.","evidence":"Trusted source trace at plan_review.md:1 observed the line \"Since the working tree is clean, I can call `submit`.\" inside an internal monologue (hunk lines 1-13) asserting agent tool semantics with no contract or documentation value; CodeGraph current-head evidence lists no index nodes or callers for plan_review.md, consistent with a stray non-functional artifact with zero blast radius; source-line-sha256=40320ec1efaaee790d30ef2116e5d2cccac82bb81086bcbaa220bd75c738cdcc","outcome":"confirmed"}],"residual_risk":"After removing plan_review.md, remaining risk is limited to the PR's actual concurrency behavior in agent_mention_sweep.py, which is not part of the current-head diff and was not re-verified here; the merge-state evidence shows prior hosted workflows terminal-success at an earlier head, but no execution receipts for the current head exist in this evidence set."}
  • Result: REQUEST_CHANGES

  • Reason: The only current-head change is an accidental agent scratchpad (plan_review.md) whose own final line records the decision not to submit changes; the file must be removed before merge.

  • Head SHA: badbdf49bc8c0fff8f01180f39cd36285b61e0ff

  • Workflow run: 31672177173

  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: plan_review.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: plan_review.md"]
  R1 --> V1["required checks"]
Loading

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode reviewed the current-head bounded evidence and requested changes before merge.

Findings

1. P2 plan_review.md:13 - Accidental agent scratchpad committed to the repository root

  • Problem: The only current-head change of PR #938 is a new root-level plan_review.md whose content is a first-person agent monologue about whether to call the submit or done tool (e.g., line 1: "Since the working tree is clean, I can call submit."; line 13: "Let's just use done!"). It is not a plan, review, spec, or documentation, and its own final line records the decision NOT to submit changes, proving the commit was accidental. The PR title/body describe a concurrency change to agent_mention_sweep.py, but the current-head diff contains no code at all.
  • Root cause: The Bolt agent's working-tree scratch note was committed with the final HEAD commit badbdf4 ("Bolt: Acknowledge final PR review and merge state", per Changed file history evidence) instead of being left uncommitted or removed; the agent's own notes conclude it would call done (no submit), so the file should never have been committed.
  • Fix: Delete the file before merge: git rm plan_review.md, commit, and push. If agent scratch notes are a recurring byproduct, add plan_review.md to .gitignore so future sessions cannot commit them.
  • Regression test: Run the repository test command python3 -m pytest tests and confirm the diff is clean with git diff --exit-code 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba..HEAD -- plan_review.md (must show no output after removal).
  • Suggested diff: posted in this finding's inline review thread.

Summary

REQUEST_CHANGES: the sole current-head change (Changed files evidence) is a new root-level plan_review.md (13 lines; diff stat 13 insertions) containing a first-person agent monologue about choosing between the submit and done tools. Its final line 13 records the decision "Let's just use done!" — the author intended NOT to submit changes — which proves the file is an accidental scratchpad committed with HEAD commit badbdf4 ("Bolt: Acknowledge final PR review and merge state", per Changed file history evidence). No runtime code, tests, or workflows changed; CodeGraph current-head evidence shows no nodes, callers, or consumers for plan_review.md. Approval sufficiency: insufficient — the PR title/body describe a concurrency change to agent_mention_sweep.py, but the current-head diff contains only the stray scratchpad, so the PR's final state misrepresents its intent. Verification posture: trusted changed-hunk source trace of plan_review.md lines 1-13 plus the two copied source-line-sha256 receipts; no execution receipts exist and none are needed for a docs-only artifact. Linter/static: N/A — no supported source files changed. TDD/regression: N/A per Coverage execution evidence; repo test command python3 -m pytest tests is unaffected. Coverage: Coverage execution evidence Result: PASS — not applicable (no supported changed source files or package manifests). Docstring coverage: not applicable (no supported changed source files or package manifests). DAG: source-backed flowchart below reflects the head-only changed flow (plan_review.md -> repo-root/changed-path CI surface). PoC/execution: none — source/diff trace only; no OPENCODE_EXECUTION_RECEIPT exists. DDD/domain: N/A — no domain code touched. CDD/context: N/A. Similar issues: no prior review thread concerns this file; prior CodeRabbit comments targeted the concurrency code, not this artifact. Claim/concept check: the file's tool-behavior claims (submit/done semantics) are unverified scratch content, not repository documentation. Standards search: N/A — no standard applies to a scratchpad artifact. Compatibility/convention: no schema/API/config/code objects introduced; no naming or reserved-word surface. Breaking-change/backcompat: none — no runtime surface. Implementation completeness: N/A — no runtime implementation in the diff. Performance: N/A. Developer experience: repo-root noise for every contributor and future agent; judged from changed-hunk content and changed-file evidence. User experience: non-web surface — PR #938's final diff and repo tree; the artifact misrepresents the PR's final state. Visual/DOM: non-web — N/A; CLI/docs/tree interaction surface reviewed instead. Accessibility/i18n: N/A. Supply-chain/license: no dependencies. Packaging: no package changes. Security/privacy: no secrets, auth, or code paths touched.

Adversarial validation

{"status":"failed","probes":[{"path":"plan_review.md","line":13,"hypothesis":"The new file is an accidental agent scratchpad, not an intentional repository artifact, so merging it pollutes the repository root and misrepresents the PR.","attack_or_counterexample":"Source trace of the complete added file in the trusted Focused changed hunks: a first-person monologue about tool choice whose final line decides to end the task without submitting changes.","evidence":"Trusted source trace at plan_review.md:13 observed the changed-hunk diff (the only changed file per Changed files evidence; 13 insertions per Diff stat) end with \"Let's just use `done`!\" — a first-person tool-selection monologue with no plan, review, or documentation content; the author's own final decision was not to submit changes, confirming the file is an accidental scratchpad rather than an intended artifact; source-line-sha256=a98081e734f52e4bf16f4a37de9737250044e3fe53df76a0617a14e981cea3cd","outcome":"confirmed"},{"path":"plan_review.md","line":1,"hypothesis":"The file commits unverified tool-behavior claims (\"submit triggers the push\" and quoted tool descriptions) as repository content, which would mislead readers or future agents.","attack_or_counterexample":"Read the file's opening and closing lines as a committed artifact and check for any consumer or documentation contract in CodeGraph.","evidence":"Trusted source trace at plan_review.md:1 observed the line \"Since the working tree is clean, I can call `submit`.\" inside an internal monologue (hunk lines 1-13) asserting agent tool semantics with no contract or documentation value; CodeGraph current-head evidence lists no index nodes or callers for plan_review.md, consistent with a stray non-functional artifact with zero blast radius; source-line-sha256=40320ec1efaaee790d30ef2116e5d2cccac82bb81086bcbaa220bd75c738cdcc","outcome":"confirmed"}],"residual_risk":"After removing plan_review.md, remaining risk is limited to the PR's actual concurrency behavior in agent_mention_sweep.py, which is not part of the current-head diff and was not re-verified here; the merge-state evidence shows prior hosted workflows terminal-success at an earlier head, but no execution receipts for the current head exist in this evidence set."}
  • Result: REQUEST_CHANGES

  • Reason: The only current-head change is an accidental agent scratchpad (plan_review.md) whose own final line records the decision not to submit changes; the file must be removed before merge.

  • Head SHA: badbdf49bc8c0fff8f01180f39cd36285b61e0ff

  • Workflow run: 31672177173

  • Workflow attempt: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: plan_review.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: plan_review.md"]
  R1 --> V1["required checks"]
Loading

Comment thread plan_review.md
Wait, `submit` says: "Call this only when you are confident the code changes are complete by running all relevant tests and ensuring they pass OR when the user asks you to commit, push, submit, or otherwise finalize the code."

If I use `done`, the whole process stops.
Let's just use `done`!

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.

P2 Accidental agent scratchpad committed to the repository root

  • Location: plan_review.md:13
  • Problem: The only current-head change of PR perf(automation): parallelize deterministic agent-mention sweeps #938 is a new root-level plan_review.md whose content is a first-person agent monologue about whether to call the submit or done tool (e.g., line 1: "Since the working tree is clean, I can call submit."; line 13: "Let's just use done!"). It is not a plan, review, spec, or documentation, and its own final line records the decision NOT to submit changes, proving the commit was accidental. The PR title/body describe a concurrency change to agent_mention_sweep.py, but the current-head diff contains no code at all.
  • Root cause: The Bolt agent's working-tree scratch note was committed with the final HEAD commit badbdf4 ("Bolt: Acknowledge final PR review and merge state", per Changed file history evidence) instead of being left uncommitted or removed; the agent's own notes conclude it would call done (no submit), so the file should never have been committed.
  • Fix: Delete the file before merge: git rm plan_review.md, commit, and push. If agent scratch notes are a recurring byproduct, add plan_review.md to .gitignore so future sessions cannot commit them.
  • Regression test: Run the repository test command python3 -m pytest tests and confirm the diff is clean with git diff --exit-code 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba..HEAD -- plan_review.md (must show no output after removal).

Suggested diff

diff --git a/plan_review.md b/plan_review.md
deleted file mode 100644
index 3cc8c7b7..0000000
--- a/plan_review.md
+++ /dev/null
@@ -1,13 +0,0 @@
-Since the working tree is clean, I can call `submit`.
-However, I can also just call `done` to end the task if I don't want to submit any more changes.
-Wait, `submit` triggers the push. If there are no changes, `submit` will just say "nothing to commit".
-
-Actually, the user told me to call `done` when finished!
-Wait, let's look at my tools: `submit` and `done`!
-Yes, I have `done`.
-"Indicates that the subagent has completed its task. Call this with a summary of what was accomplished."
-
-Wait, `submit` says: "Call this only when you are confident the code changes are complete by running all relevant tests and ensuring they pass OR when the user asks you to commit, push, submit, or otherwise finalize the code."
-
-If I use `done`, the whole process stops.
-Let's just use `done`!

@opencode-agent
opencode-agent Bot disabled auto-merge August 13, 2026 09:02
seonghobae added a commit that referenced this pull request Aug 13, 2026
OpenCode found the current-head tree was only plan_review.md, a
first-person Bolt monologue. The sweep code already lives on main.
@seonghobae seonghobae closed this Aug 13, 2026
@seonghobae

Copy link
Copy Markdown
Contributor Author

Closed: current-head unique tree was only the accidental plan_review.md scratchpad. Sweep code already lives on main. Scratchpad deleted on the branch.

@google-labs-jules

Copy link
Copy Markdown

Closed: current-head unique tree was only the accidental plan_review.md scratchpad. Sweep code already lives on main. Scratchpad deleted on the branch.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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.

1 participant