Skip to content

exec skill: Verify PR creation and report failures #26

Closed

Description

@admarble

Summary

During /exec phase execution via sequant run, the skill reported creating a PR but the PR was never actually created. The branch was pushed successfully, but the gh pr create step either failed silently or wasn't executed.

Observed Behavior

  1. /exec 18 ran via sequant run 18 --phases spec,exec --quality-loop
  2. Streaming output showed: "Now let me commit the changes and push to create a PR"
  3. Branch feature/18-configure-placeholder-tokens-during-onboarding was pushed to origin
  4. Attempted gh pr merge 25 → GraphQL: Could not resolve to a PullRequest with the number of 25
  5. Had to manually run gh pr create before merging

Expected Behavior

  • If PR creation fails, the exec phase should report an error
  • If PR creation succeeds, the PR URL should be verified to exist
  • The phase should not report success if PR wasn't created

Root Cause Hypothesis

The Claude Agent SDK streams the model's narration/intentions, but the actual tool execution may have:

  1. Failed silently (gh command error not captured)
  2. Been described but not executed (model hallucinated the step)
  3. Timed out before completion

Proposed Fix

Add explicit PR verification to /exec skill:

## After pushing, verify PR creation

After `gh pr create`, immediately verify:
\`\`\`bash
# Verify PR exists
gh pr view --json number,url || echo "ERROR: PR was not created"
\`\`\`

If verification fails, retry PR creation or report error clearly.

Acceptance Criteria

  • AC-1: /exec skill verifies PR exists after gh pr create
  • AC-2: If PR creation fails, skill reports clear error message
  • AC-3: Phase result reflects actual PR creation status (not just push status)

Impact

  • Severity: Low (workaround: manually create PR)
  • Frequency: Unknown (first observed instance)
  • Affected workflow: sequant run with exec phase, /fullsolve

Related

Activity

  1. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Implementation Plan for PR Verification

    Acceptance Criteria Checklist

    AC Description Verification Method
    AC-1 /exec skill verifies PR exists after gh pr create Manual Test
    AC-2 If PR creation fails, skill reports clear error message Manual Test
    AC-3 Phase result reflects actual PR creation status Manual Test

    Verification Criteria

    AC-1: PR Verification

    • Given: /exec completes and pushes branch
    • When: gh pr create executes
    • Then: gh pr view --json number,url confirms PR exists
    • And: PR URL captured in progress update

    AC-2: Error Reporting

    • Given: gh pr create fails
    • Then: Error captured and logged clearly
    • And: Progress update shows "PR Creation: FAILED - [reason]"

    AC-3: Status Accuracy

    • Given: Implementation complete
    • Then: Progress update explicitly states PR status
    • And: If failed, includes manual creation instructions

    Implementation Plan

    Phase 1: PR Verification Logic

    1. Add PR verification section to SKILL.md after push instructions
    2. Include verification command: gh pr view --json number,url
    3. Add retry logic (1 retry with 2s delay)
    4. Add error capture pattern

    Phase 2: Progress Update Template

    1. Add "PR Status" section to progress update template
    2. Update Output Verification checklist with PR status requirement

    Key Decisions

    Decision Choice Rationale
    Retry on failure Yes, 1 retry Handles transient network issues
    Block on PR failure No Implementation complete regardless of PR status

    Assumptions to Validate

    • gh pr view returns non-zero when no PR exists
    • gh error messages are actionable
    • Current branch context sufficient for gh pr view

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Markdown skill file update with clear AC, no build/test needed


    Plan generated by /spec 26

  2. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Spec Review: PR Verification Implementation Plan

    Acceptance Criteria with Verification

    AC Description Verification Method Key Assumption
    AC-1 /exec verifies PR exists after gh pr create Manual Test gh pr view returns exit 1 when no PR exists
    AC-2 Clear error message on PR creation failure Manual Test gh error messages are actionable
    AC-3 Progress update reflects actual PR status Manual Test Output checklist can be updated

    Verification Criteria Detail

    AC-1: PR Verification

    • Given: /exec pushes branch and runs gh pr create
    • When: PR creation completes
    • Then: gh pr view --json number,url verifies PR exists
    • And: Exit code 0 = success, exit code 1 = failure

    AC-2: Error Reporting

    • Given: gh pr create fails
    • Then: Error captured and logged clearly
    • And: Progress update shows "PR Creation: FAILED - [reason]"
    • And: Manual creation instructions provided

    AC-3: Status Accuracy

    • Given: Implementation complete
    • Then: Progress update includes explicit "PR Status" section
    • And: Includes URL if created, error reason if failed

    Assumptions Validated ✅

    • gh pr view returns exit code 1 when no PR exists for current branch
    • gh pr view --json number,url outputs valid JSON when PR exists
    • Error messages from gh are actionable

    Implementation Plan

    Phase 1: PR Verification Logic (SKILL.md ~line 152)

    1. Add "### PR Creation and Verification" section
    2. Include verification command: gh pr view --json number,url
    3. Add 1 retry with 2s delay for transient failures
    4. Include manual fallback instructions

    Phase 2: Progress Update Template (SKILL.md ~line 406)

    1. Add "PR Status" section to progress template
    2. Include: Status (Created/Failed), URL, Manual Steps if failed

    Phase 3: Output Verification Checklist (SKILL.md ~line 447)

    1. Add "PR Status" to required output items

    Key Decisions

    Decision Choice Rationale
    Block on PR failure? No Implementation complete regardless of PR
    Retry count 1 retry, 2s delay Balance transient failures vs. wasted time

    Conflict Risk Analysis

    Status: Worktree exists (feature/26-...) but no changes yet
    Assessment: No conflict - safe to proceed

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Markdown skill file update only, no build/test impacts, clear AC


    Plan reviewed by /spec 26 - Ready for implementation

  3. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Spec Review: PR Verification Implementation

    Acceptance Criteria with Verification

    AC Description Verification Method Test Scenario
    AC-1 /exec verifies PR exists after gh pr create Manual Test After push + PR create, gh pr view --json confirms existence
    AC-2 Clear error message on PR creation failure Manual Test Simulate failure → verify error logged with instructions
    AC-3 Progress update reflects actual PR status Manual Test Check progress summary includes PR Status section

    Verification Criteria Detail

    AC-1: PR Verification

    • Given: /exec pushes branch and runs gh pr create
    • When: PR creation completes
    • Then: gh pr view --json number,url verifies PR exists (exit 0 = success)
    • And: PR URL captured in progress update

    AC-2: Error Reporting

    • Given: gh pr create fails
    • Then: Error captured with clear message
    • And: Manual creation instructions provided
    • And: Progress update shows "PR Creation: FAILED - [reason]"

    AC-3: Status Accuracy

    • Given: Implementation complete
    • Then: Progress update includes explicit "PR Status" section
    • And: Includes URL if created, error + manual steps if failed

    Implementation Plan

    Phase 1: PR Verification Logic (SKILL.md ~line 152)

    1. Add "### PR Creation and Verification" section after line 151
    2. Include gh pr create with proper HEREDOC formatting
    3. Add immediate gh pr view --json number,url verification
    4. Add 1 retry with 2s delay for transient failures
    5. Include manual fallback instructions

    Phase 2: Progress Update Template (SKILL.md ~line 405-435)

    1. Add "PR Status" to progress template requirements
    2. Include: Status (Created/Failed), URL, Manual Steps if failed

    Phase 3: Output Verification Checklist (SKILL.md ~line 440-450)

    1. Add "PR Status" checkbox to required output items

    Key Decisions

    Decision Choice Rationale
    Block on PR failure? No Implementation complete regardless of PR status
    Retry count 1 retry, 2s delay Balance transient failures vs. wasted time

    Conflict Risk Analysis

    Status: Worktree exists (feature/26-...) with no changes
    Assessment: No conflict - safe to proceed

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Markdown skill file update with clear AC, no build/test needed


    Plan generated by /spec 26

  4. added a commit that references this issue on Jan 9, 2026
  5. admarble commented on Jan 9, 2026

    @admarble
    ContributorAuthor

    Implementation Complete

    AC Coverage Summary

    AC Description Status
    AC-1 /exec skill verifies PR exists after gh pr create ✅ Satisfied
    AC-2 If PR creation fails, skill reports clear error message ✅ Satisfied
    AC-3 Phase result reflects actual PR creation status ✅ Satisfied

    Files Changed

    • .claude/skills/exec/SKILL.md - Added PR verification section, updated progress template and output checklist

    Checks Run

    • npm test - 156 tests passed

    PR Status

    Created: #36

    Implementation Details

    1. Added "PR Creation and Verification" section (after worktree workflow):

      • Step-by-step instructions for push → PR create → verify
      • Immediate gh pr view --json number,url verification after PR creation
      • Retry logic: 1 retry with 2s delay for transient failures
      • Failure handling with manual creation instructions
    2. Updated Progress Update Template:

      • Added PR Status as required field
      • Includes URL if created, error + manual steps if failed
    3. Updated Output Verification Checklist:

      • Added PR Status checkbox as required output item

    Next Steps

    • Ready for QA review via /qa 26
    • No additional work required for this issue

    Progress update from /exec 26

  6. added a commit that references this issue on Jan 9, 2026
  7. added a commit that references this issue on Sep 9, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions