Description
When a PR has already been merged, PostHog Code keeps pushing new commits to that same now-dead branch instead of recognizing the work is done. Once a branch's PR is merged, further changes should start from a fresh main and go into a new PR, not pile onto the merged branch.
The app already knows the merged state. The indicator in the top right corner shows "merged", so the signal exists in the UI. The agent just does not act on it today. Getting this right would be a real advantage, since Claude Code frequently mishandles this exact case.
Proposed solution
When the agent detects that the current branch's PR is merged (the same signal that drives the top-right merged indicator), it should stop pushing to that branch. Instead it should pull fresh main, create a new branch off it, and open a new PR for any subsequent work.
Related (not a duplicate): #1090 covers the behind-main case, a different branch state.
Description
When a PR has already been merged, PostHog Code keeps pushing new commits to that same now-dead branch instead of recognizing the work is done. Once a branch's PR is merged, further changes should start from a fresh main and go into a new PR, not pile onto the merged branch.
The app already knows the merged state. The indicator in the top right corner shows "merged", so the signal exists in the UI. The agent just does not act on it today. Getting this right would be a real advantage, since Claude Code frequently mishandles this exact case.
Proposed solution
When the agent detects that the current branch's PR is merged (the same signal that drives the top-right merged indicator), it should stop pushing to that branch. Instead it should pull fresh main, create a new branch off it, and open a new PR for any subsequent work.
Related (not a duplicate): #1090 covers the behind-main case, a different branch state.