Skip to content

Fix: Detect PR creation from CLI in changes panel #1210

@rabanspiegel

Description

@rabanspiegel

Problem

When a PR is created through the "Create PR" button, the changes panel immediately detects it — the onSuccess callback triggers refreshPr(), CI checks appear, and the UI updates instantly.

When a PR is created via the CLI (e.g. gh pr create in the agent terminal or a shell tab), the changes panel doesn't notice until the next background poll cycle (up to 30s) or window re-focus. During that gap, the panel still shows "Create PR" and CI checks aren't visible.

Desired Behavior

PR detection should work identically regardless of how the PR was created — button or CLI.

Possible Approaches

  1. Manual refresh — Add a refresh button to the changes panel header so the user can trigger a PR status check when they know one was created. Simple, no performance cost.

  2. PTY output detection — Watch terminal output for GitHub PR URL patterns (https://github.com/.../pull/\d+). When detected, trigger an immediate refreshPrStatus(). Event-driven, no extra polling.

Either way, the goal is instant detection without increasing background poll frequency.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions