Skip to content

Add fix-with-agent capability to PR creation errors#1460

Merged
adboio merged 2 commits intomainfrom
posthog-code/fix-errors-with-agent
Apr 2, 2026
Merged

Add fix-with-agent capability to PR creation errors#1460
adboio merged 2 commits intomainfrom
posthog-code/fix-errors-with-agent

Conversation

@adboio
Copy link
Copy Markdown
Contributor

@adboio adboio commented Apr 2, 2026

TL;DR

Added "Fix with Agent" functionality to PR creation error dialogs, allowing users to send error context to an active agent session for automated resolution.

Problem

When PR creation fails, users have no way to leverage the agent to diagnose and fix the issue. They can only copy the error message and manually investigate.

Changes

error container with ✨ button inline chip that holds context about the workflow / intended action
Screenshot 2026-04-02 at 9.57.04 AM.png
Screenshot 2026-04-02 at 10.02.07 AM.png
  • New hook useFixWithAgent: Manages sending structured error prompts to the active agent session, with validation that a connected session exists
  • New utility buildCreatePrFlowErrorPrompt: Generates contextual error prompts that explain the PR creation flow, the failed step, rollback behavior, and common error resolutions
  • Updated ErrorContainer component: Added optional "Fix with Agent" button (sparkle icon) alongside the existing copy error button
  • Updated CreatePrDialog: Integrated the hook and passes error context builder to enable the fix button when a session is available
  • UX improvements: After sending the error to the agent, the dialog closes and the agent's logs panel is activated for visibility

How did you test this?

Changes are integrated into the PR creation flow and will be tested through manual PR creation scenarios with active agent sessions.

@adboio adboio marked this pull request as ready for review April 2, 2026 17:05
@adboio adboio requested a review from a team April 2, 2026 17:06
@adboio adboio merged commit c0b2dde into main Apr 2, 2026
15 checks passed
@adboio adboio deleted the posthog-code/fix-errors-with-agent branch April 2, 2026 21:34
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.

2 participants