Skip to content

fix: verify PR state before acting; never post to a closed/stale PR (#85) - #86

Merged
atamanvega merged 1 commit into
mainfrom
fix/verify-pr-state
Sep 23, 2026
Merged

atamanvega merged 1 commit into
mainfrom
fix/verify-pr-state

Conversation

@atamanvega

Copy link
Copy Markdown
Collaborator

Fixes #85.

The report

The agent sent changes and reported posting them to PR #29 — already closed. It reused a PR number from earlier in the session and acted on it without checking state.

The fix — a PR-state guard (same doctrine as #83)

  • fix-pr / pr-fixer — new step 0: resolve the PR from the current branch and require state == OPEN before gathering findings, pushing, commenting, or resolving threads. CLOSED/MERGEDstop and offer the real options (reopen / open a fresh PR / point at the right one), never a false "posted" report. No PR for the branch → that's create-pr.
  • create-pr — check for an existing open PR on the branch (update it instead of duplicating), refuse to reuse a closed PR's number, and report only the URL the create call actually returned.
  • coding-agent + portable work-story ship step reinforced.
  • Rule throughout: never trust a PR number from memory — re-resolve from the branch.

Verification

  • build → 12 skills @ 0.19.14, validator clean, node --test 35/35, rebuild a no-op, source/bundle byte-identical.
  • CHANGELOG entry added. Kit → 0.19.14.

Version note: #79 (plan-definition, in review) still carries an older bump on its branch; it re-bumps to the next free number when it merges. No file overlap with this PR.

🤖 Generated with Claude Code

)

A user saw the agent report posting changes to PR #29, which was already
closed — it had carried the number over from earlier in the session and
acted on it without checking.

- fix-pr / pr-fixer: resolve the PR from the current branch and require
  state == OPEN before gathering findings, pushing, commenting, or
  resolving threads. CLOSED/MERGED -> stop and offer reopen / fresh PR /
  point-at-the-right-one, never a false "posted" report. No PR -> create-pr.
- create-pr: check for an existing open PR on the branch (update rather
  than duplicate), refuse to reuse a closed PR's number, and report only
  the URL the create call actually returned.
- coding-agent + portable work-story ship step reinforced.
- Rule throughout: never trust a PR number from memory; re-resolve from
  the branch.

Bundle rebuilt; validator + 35 tests pass. Kit -> 0.19.14.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
claude-dev-kit-telemetry-relay Ignored Ignored Preview Sep 22, 2026 8:08pm UTC

Request Review

@atamanvega
atamanvega merged commit 902ff0d into main Sep 23, 2026
3 checks passed
@atamanvega
atamanvega deleted the fix/verify-pr-state branch September 23, 2026 06:11
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.

fix: agent acts on / claims to post to a closed or stale PR without checking its state

1 participant