Skip to content

agent: @U0AJM7X8FBR I need individual buttons to merge each pull requ…#277

Merged
sweetmantech merged 1 commit intomainfrom
test
Mar 10, 2026
Merged

agent: @U0AJM7X8FBR I need individual buttons to merge each pull requ…#277
sweetmantech merged 1 commit intomainfrom
test

Conversation

@sweetmantech
Copy link
Contributor

@sweetmantech sweetmantech commented Mar 10, 2026

…est in the (#276)

  • agent: @U0AJM7X8FBR I need individual buttons to merge each pull request in the

  • agent: address feedback

  • agent: address feedback

  • agent: address feedback

  • agent: address feedback

  • agent: address feedback

  • agent: address feedback

  • agent: address feedback

  • fix: use catch-all action handler for merge_pr prefix matching

Chat SDK's onAction uses exact match, not prefix match. Changed to a catch-all handler that filters with startsWith("merge_pr:") so dynamic action IDs like "merge_pr:#42" are matched.


Summary by CodeRabbit

Release Notes

  • New Features

    • Individual merge buttons now available for each pull request, enabling granular control over merging.
  • Refactor

    • Merge workflow changed from bulk "merge all" operation to per-PR merge actions.

…est in the (#276)

* agent: @U0AJM7X8FBR I need individual buttons to merge each pull request in the

* agent: address feedback

* agent: address feedback

* agent: address feedback

* agent: address feedback

* agent: address feedback

* agent: address feedback

* agent: address feedback

* fix: use catch-all action handler for merge_pr prefix matching

Chat SDK's onAction uses exact match, not prefix match. Changed to
a catch-all handler that filters with startsWith("merge_pr:") so
dynamic action IDs like "merge_pr:#42" are matched.

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

---------

Co-authored-by: Recoup Agent <agent@recoupable.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 10, 2026

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

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Mar 10, 2026 2:20pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6fbe28f6-50ab-4783-9c8b-4907e97d8c97

📥 Commits

Reviewing files that changed from the base of the PR and between f7ce9ae and 87eb2b1.

⛔ Files ignored due to path filters (4)
  • lib/coding-agent/__tests__/handlePRCreated.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/coding-agent/__tests__/mergeGithubPR.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/coding-agent/__tests__/onMergeAction.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/coding-agent/__tests__/parseMergeActionId.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (4)
  • lib/coding-agent/buildPRCard.ts
  • lib/coding-agent/handlers/onMergeAction.ts
  • lib/coding-agent/mergeGithubPR.ts
  • lib/coding-agent/parseMergeActionId.ts

📝 Walkthrough

Walkthrough

This PR refactors the PR merge workflow from a single global "merge all PRs" button to individual per-PR merge buttons. It introduces per-PR action ID parsing, GitHub API merge utilities, and updates the merge handler to process individual PR merge actions with granular state management.

Changes

Cohort / File(s) Summary
Card UI Updates
lib/coding-agent/buildPRCard.ts
Replaces global "Merge All PRs" button with individual merge buttons for each PR, one per PR. Changes iteration from map to flatMap to pair each PR's review link with its own merge button. Updates card description to reflect per-PR behavior.
Merge Action Handler
lib/coding-agent/handlers/onMergeAction.ts
Replaces single merge-all handler with a per-PR handler that parses action IDs (merge_pr:{repo}#{number}), locates specific PRs, performs squash merge via mergeGithubPR, updates thread state, and provides per-PR success/failure messaging. Removes iteration over all PRs.
GitHub Merge Utility
lib/coding-agent/mergeGithubPR.ts
New utility function that performs squash merge via GitHub API. Accepts repo, PR number, and token; returns structured success/failure result with error logging on failure.
Action ID Parser
lib/coding-agent/parseMergeActionId.ts
New utility function that parses merge action IDs matching pattern "merge_pr:{repo}#{number}" and extracts repo and number fields; returns null if pattern doesn't match.

Sequence Diagram

sequenceDiagram
    participant User
    participant Handler as onMergeAction Handler
    participant Parser as parseMergeActionId
    participant API as GitHub API
    participant State as Thread State

    User->>Handler: Click Merge PR Button<br/>(action: merge_pr:repo#123)
    Handler->>Parser: Parse action ID
    Parser-->>Handler: {repo, number}
    
    Handler->>State: Find PR in prs array
    State-->>Handler: PR details
    
    Handler->>API: PUT /repos/{owner}/{repo}/pulls/{number}/merge<br/>(merge_method: squash)
    API-->>Handler: Success/Failure response
    
    Handler->>State: Remove merged PR from prs array
    Handler->>State: Recalculate merged status
    State-->>Handler: Updated state
    
    Handler-->>User: Per-PR success message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🔘 From one big button to many small,
Each PR now merges at its own call,
No more "merge all" in a single tap,
Per-PR control closes the gap!
GitHub squash-merge, one by one,
Individual actions—much more fun! ✨🎉

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test

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 and usage tips.

@sweetmantech sweetmantech merged commit bcfdbaf into main Mar 10, 2026
3 of 4 checks passed
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