Skip to content

bug(run): sequant run no longer creates PRs after successful QA (v1.15.3 regression) #322

Closed

Description

@admarble

Summary

sequant run no longer creates PRs after successful QA. Worktrees contain completed, QA-passed work but branches are never pushed and PRs are never opened. This is a regression introduced in v1.15.3.

Root Cause

Two interacting issues:

1. SEQUANT_ORCHESTRATOR env var causes model to skip PR creation

Commit cb799d4 (#305) added orchestration context env vars to every claude -p session in run.ts:

env.SEQUANT_ORCHESTRATOR = "sequant-run";
env.SEQUANT_PHASE = phase;

The model sees SEQUANT_ORCHESTRATOR=sequant-run in its environment and infers it should defer PR creation to the orchestrator. The sequant repo's own exec skill (.claude/skills/exec/SKILL.md) has an explicit "Orchestration Context" section (added in 2730515, #40) that instructs:

Behavior when orchestrated: Reduce GitHub comment frequency — Defer progress updates to the orchestrator

This section was never propagated to templates/skills/exec/SKILL.md, so user projects don't have the explicit instructions — but the env var is still set, and the model picks up on it.

2. run.ts never implemented PR creation

run.ts calls rebaseBeforePR() after successful QA (added in #295), but there is no corresponding createPR() step. The function name implies PR creation follows, but it was never implemented. Before 1.15.3, the exec skill handled the entire flow including PR creation. After 1.15.3, the orchestrator took over git state management (rebase) but left a gap — nobody creates the PR.

Evidence

Pre-1.15.3 (Feb 20 run, no SEQUANT_ORCHESTRATOR):

Post-1.15.3 (Feb 21 run, SEQUANT_ORCHESTRATOR=sequant-run):

  • Exec durations: 60-264 seconds (implementation only)
  • 7 worktrees with completed work, 0 PRs created
  • All issues show status: "success" in run logs
  • Branches never pushed to remote

Additional Detail

Bash(git push:*) is not in the exec skill's allowed-tools list (and never was). Pre-1.15.3, Claude used it anyway because bypassPermissions mode was set. Post-1.15.3, the model opts not to push at all rather than being blocked — it defers to the orchestrator.

Affected Versions

  • v1.15.3 (introduced)
  • All sequant run invocations with worktree isolation

Proposed Fix

Option A: Orchestrator owns PR creation (recommended)

Add a PR creation step to run.ts after successful QA + rebase:

  1. git push -u origin <branch> from worktree
  2. gh pr create --title "feat(#N): <title>" --body "..." with AC checklist
  3. Record PR URL in run log (prUrl field)
  4. Add --no-pr flag for users who want manual control

This is the cleaner approach — the orchestrator already owns worktree creation, phase execution, rebase, and cleanup. PR creation is the missing step in that chain.

Option B: Remove SEQUANT_ORCHESTRATOR from exec phase

Stop setting SEQUANT_ORCHESTRATOR for the exec phase so the model creates PRs like before. Quick fix but regresses the orchestration awareness that #305 intentionally added.

Option C: Both

Implement Option A for the orchestrator path, and also add Bash(git push:*) to the exec skill's allowed-tools so standalone /exec can still create PRs explicitly.

Acceptance Criteria

  • sequant run creates PRs for all issues that pass QA
  • PR URL is recorded in the run log JSON (prUrl field per issue)
  • --no-pr flag skips PR creation for manual workflows
  • Chain mode: single PR for the chain (or one per issue — decide during implementation)
  • Standalone /exec (no orchestrator) still creates PRs
  • Bash(git push:*) added to exec skill allowed-tools in both skills/ and templates/skills/
  • Run summary prints PR URLs for successful issues

Activity

  1. added
    bug
    auto-ready
    on Feb 21, 2026
  2. admarble commented on Feb 21, 2026

    @admarble
    ContributorAuthor

    Spec Plan — #322

    Acceptance Criteria

    AC Description Verification
    AC-1 sequant run creates PRs for all issues that pass QA Integration Test
    AC-2 PR URL recorded in run log JSON (prUrl field per issue) Unit Test
    AC-3 --no-pr flag skips PR creation Integration Test
    AC-4 Chain mode: one PR per issue (each has own branch) Integration Test
    AC-5 Standalone /exec still creates PRs (not orchestrated) Manual Test
    AC-6 Bash(git push:*) added to exec skill allowed-tools in both skills/ and templates/skills/ File content check
    AC-7 Run summary prints PR URLs for successful issues Integration Test
    AC-8 Push/PR failures log warning and continue (don't fail run) Unit Test
    AC-9 Detect existing PR for branch and reuse URL Unit Test

    Implementation Plan

    1. Types — Add prUrl/prNumber to IssueResult and IssueLogSchema
    2. createPR() function — New function in run.ts: push branch + gh pr create + return URL
    3. Wire into post-QA flow — After rebase, create PR (unless --no-pr), record in result/log/state
    4. CLI flag — Add --no-pr to bin/cli.ts and RunOptions
    5. Summary — Extend run summary to show PR URLs
    6. Exec skill — Add Bash(git push:*) to both .claude/skills/exec/SKILL.md and templates/skills/exec/SKILL.md
    7. Tests — Cover createPR(), --no-pr, summary output

    Key Decisions

    • Chain mode: One PR per issue (each chain issue already has its own branch)
    • Error handling: PR creation failures are warnings, not run failures
    • Pattern: createPR() follows rebaseBeforePR() pattern (sync, spawnSync)

    Non-Goals

    • PR auto-merge after creation
    • Modifying exec skill behavior beyond adding git push permission
    • Dashboard or UI changes
  3. added
    planned
    cli
    on Feb 21, 2026
  4. added a commit that references this issue on Feb 21, 2026
    fe6f5bc
  5. admarble commented on Feb 21, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #322
    Status: READY_FOR_MERGE
    PR: #323

    Summary

    • AC: 6/6 met
    • Tests: 93/93 passed (run.test.ts)
    • Build: ✅ Pass
    • Lint: ✅ Pass

    Changes (8 files, +524/-1)

    • src/commands/run.ts — Added createPR() function, wired into runIssueWithLogging() after rebase, added --no-pr support
    • src/commands/run.test.ts — 5 new tests for createPR() (existing PR, fresh create, push fail, create fail, race condition)
    • src/lib/workflow/types.ts — Added prNumber/prUrl to IssueResult
    • src/lib/workflow/run-log-schema.ts — Added prNumber/prUrl to IssueLogSchema
    • src/lib/workflow/log-writer.ts — Added setPRInfo() method
    • bin/cli.ts — Added --no-pr CLI option
    • .claude/skills/exec/SKILL.md + templates/skills/exec/SKILL.md — Added Bash(git push:*) to allowed-tools

    Iterations

    • Spec: 1/1
    • Exec: 1/1
    • QA: 1/1

    Verdict: READY_FOR_MERGE — All AC met, comprehensive test coverage, clean code review.

  6. added a commit that references this issue on Feb 21, 2026
    f579039
  7. admarble commented on Feb 21, 2026

    @admarble
    ContributorAuthor

    Documentation Generated

    File: docs/features/run-pr-creation.md

    Sections Included:

    • Quick Start — what it does and when it was added
    • Access — command, requirements
    • Usage — default behavior, --no-pr, multiple issues
    • Options & Settings — CLI flags table
    • How It Works — step-by-step flow, PR title convention, run log output
    • Troubleshooting — PR not created, push failed, PR already exists

    Next Steps:

    1. Review generated documentation for accuracy
    2. Merge to deploy documentation

    Ready to merge!

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

    auto-readybugcliplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions