Autonomous PR Generation from Observability Data

posthog · Tech · 2026 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Product observability to code remediation

The team wanted to turn product signals, errors, logs, Slack messages, and session replays into actionable pull requests so engineers wake up to reviewed code changes instead of spending hours or days investigating dashboards and manually creating fixes.

Constraints:

Architecture

The pipeline groups product signals into reports, runs a Claude Agent SDK research agent in a Modal sandbox with MCP tools, codebase context, Linear, and Notion context, then decides whether the issue needs human input or is immediately actionable. Actionable items are passed to a coding agent that clones the repo into a sandbox, writes the fix, pushes a PR, snapshots state, and rehydrates/reruns when CI or review comments arrive until the PR is green.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  product-signals[Product signals] --> query-generation-grouper[Query generation grouper]
  query-generation-grouper --> signal-report[Signal report]
  signal-report --> research-agent[Research agent]
  research-agent --> mcp-server[MCP server]
  research-agent --> codebase-context[Codebase context]
  research-agent --> external-mcps[External MCPs]
  research-agent --> actionability-step[Actionability step]
  actionability-step --> human-inbox[Human inbox]
  actionability-step --> coding-agent[Coding agent]
  codebase-context --> coding-agent
  coding-agent --> pull-request[Pull request]
  pull-request --> ci-and-review-feedback[CI and review feedback]
  ci-and-review-feedback --> sandbox-snapshot[Sandbox snapshot]
  sandbox-snapshot --> coding-agent
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Product signals Incoming product data, errors, logs, Slack messages, and session replay signals. Query generation grouper
Query generation grouper Uses LLM-generated queries to group structurally different signals by meaning. Product signals, Signal report
Signal report Grouped report describing a potentially important product or production problem. Query generation grouper, Research agent
Research agent Claude Agent SDK agent in a Modal sandbox that investigates the report. Signal report, MCP server, Codebase context, External MCPs, Actionability step
MCP server Provides additional log and signal context for the research agent. Research agent
Codebase context Repository context used during research and fix generation. Research agent, Coding agent
External MCPs Linear and Notion context that grounds research and problem understanding. Research agent
Actionability step Decides whether a report needs human review or can be fixed by the coding agent. Research agent, Human inbox, Coding agent
Human inbox Receives product-sensitive or insufficiently specific reports for review. Actionability step
Coding agent Claude Agent SDK agent that clones the repo, implements fixes, and pushes PRs. Actionability step, Codebase context, Pull request, CI and review feedback, Sandbox snapshot
Pull request Generated PR that contains the proposed fix and is reviewed or shipped. Coding agent, CI and review feedback
CI and review feedback CI failures and PR comments that trigger sandbox reruns. Pull request, Sandbox snapshot, Coding agent
Sandbox snapshot Persisted coding-agent state that is rehydrated when comments or CI failures arrive. Coding agent, CI and review feedback

Data flow

A product signal arrives from observability, errors, logs, Slack, or session replay. The system generates LLM queries from signals and matches those queries in embedding space to group related reports. Promoted reports go to a sandboxed research agent, which pulls extra context through MCP and produces a problem summary, priority, and reviewer. An actionability step either sends it to a human inbox or launches a sandboxed coding agent that opens and iterates on a PR until CI and comments are resolved.

3 supporting quotes
“a product signal happens, and instead of waiting to see that in your dashboard, we want we want to run a background agent to figure out what's going wrong.”transcript, stated
“space the signals themselves, uh we generate queries based off the signals. So, we ask an LLM what is this signal about?”transcript, stated
“this will uh clone the user's repo into a sandbox, uh similar to the research agent. It's then again running the”transcript, stated

Why this architecture

The pipeline separates signal grouping, research, actionability, and code execution because not every product signal is specific enough or safe enough for direct code changes. Query generation fixes cross-source clustering where embeddings grouped logs with logs and Slack with Slack. Sandboxed research and coding agents pull grounded context, while rehydrated snapshots close the CI/review loop so engineers see green PRs rather than intermediate failures.

3 supporting quotes
“What the embedding model will do is it will notice structural similarity and it will put all of the errors together.”transcript, stated
“if it needs human input, it might be because it's a product-related decision that the agent can't really make a good call on.”transcript, stated
“from an agent who's reviewing it, we will rehydrate that snapshot and continue running until the PR is green. Uh and this delivers really good”transcript, stated

Models used: Claude Agent SDK · LLM query generator · research agent · coding agent

Scale

Alternatives considered (roads not taken)

Manual dashboard-to-issue-to-PR workflow

Rejected because: It is slow, repetitive, and can take hours to days before a PR is reviewed and shipped.

“create a PR for this problem. Then you review it and you ship it. You get the message. This is a pretty slow process.”transcript, stated

Embed raw signals directly for clustering

Rejected because: Off-the-shelf embeddings grouped by structural source similarity rather than underlying product issue.

“we would take all of our signals and we would create embeddings for them. Uh and then we would try to use that to cluster the issues”transcript, stated
“But this works really badly. So, if you take uh an off-the-shelf embedding model uh and you embed an error. Uh let's say”transcript, stated

Send every signal report to a coding agent

Rejected because: Generic reports such as broad onboarding failures create noisy PRs that do not do meaningful work.

“uh if you get a signal report that's like "Onboarding is broken" in a generic way, then if you throw that at the agent”transcript, stated
“Otherwise, you end up with a a lot of noisy PRs that aren't doing meaningful things. And then the fourth one is uh that”transcript, stated

Avoid expensive agent calls early

Rejected because: During experimentation, repeated agent runs revealed patterns that could later be distilled into cheaper one-shot calls or faster models.

“Uh and so, we tried to avoid using agents where we could or delay it till as late as possible in the pipeline.”transcript, stated
“you can take a really expensive step that you're running an agent for uh and turn that into a one-shot LLM call”transcript, stated

Patterns

query-rewriting (retrieval)

The system asks an LLM what a signal is about and embeds generated queries instead of raw source-shaped signals.

“we generate queries based off the signals. So, we ask an LLM what is this signal about?”transcript, stated

tool-use-orchestration (agentic)

Research and coding agents use MCP tools, codebase context, Linear, Notion, GitHub PRs, CI, and review comments.

“this research agent has a few tools available to it. So, the first tool is it's got our MCP server.”transcript, stated
“when CI is failing or there's a comment on the PR, it will trigger a rerun of that sandbox.”transcript, stated

human-in-the-loop-gate (decisioning)

Reports that require product judgment or are insufficiently actionable are routed to a human inbox for review.

“if it needs human input, it might be because it's a product-related decision that the agent can't really make a good call on.”transcript, stated

durable-execution (agentic)

The coding sandbox is snapshotted and rehydrated when new CI failures or comments arrive.

“we snapshot the sandbox, uh and then, if there's a comment”transcript, stated
“we will rehydrate that snapshot and continue running until the PR is green.”transcript, stated

eval-driven-development (quality)

CI failures and PR review comments trigger continued agent execution until the generated PR is green.

“continue running until the PR is green.”transcript, stated
“you ideally wake up to just green PRs.”transcript, stated

Tradeoffs

Use query-generation grouping

Chose LLM-generated semantic queries for embedding search over embedding raw observability signals directly.

Rationale: Generated queries reduced source-format clustering and grouped related issues across logs, Slack, and replays.

“instead of matching in embedding space the signals themselves, uh we generate queries based off the signals.”transcript, stated
“It worked much much better.”transcript, stated

Route ambiguous reports to humans

Chose human inbox for product decisions or low-actionability reports over automatic PR generation for every signal cluster.

Rationale: Some reports are too generic or require product judgment that the agent should not make.

“if it needs human input, it might be because it's a product-related decision”transcript, stated
“put it into an inbox for you to review in the morning.”transcript, stated

Rehydrate sandboxes on feedback

Chose snapshot and rerun the agent after CI or PR comments over manual local debugging of CI failures and comments.

Rationale: This closes the PR feedback loop so engineers wake up to green PRs rather than chores.

“if there's a comment, let's say from an agent who's reviewing it, we will rehydrate that snapshot and continue running”transcript, stated
“instead of a bunch of CI failures or uh comments that you need to address manually”transcript, stated

Gotchas (what bit them)

Raw embeddings grouped signals by format instead of issue.

Root cause: Errors, Slack messages, and session replays have structural similarity within source type that overwhelms semantic grouping.

Resolution: The team generated LLM queries from signals and matched those queries in embedding space.

“you've got all of your errors over here, all of your Slack messages here, all of your session replays here”transcript, stated
“then we match those queries in uh the embedding space.”transcript, stated

Generic reports generate noisy PRs.

Root cause: If the problem is not specific enough, the coding agent will still try to fix something.

Resolution: An actionability step filters non-specific or product-decision reports into a human inbox.

“if the problem that I've described is it specific enough uh and if not, I should ignore it.”transcript, stated
“you end up with a a lot of noisy PRs that aren't doing meaningful things.”transcript, stated

Avoiding agent calls too early slowed learning.

Root cause: Cost concerns hid repeated behavior patterns that could later be optimized.

Resolution: The team ran agents during experimentation, then distilled expensive repeated steps into one-shot calls or faster models.

“we were at first uh focused a lot on the costs of the pipeline.”transcript, stated
“you start seeing the kind of clever solutions that it comes up with and eventually you see similarities.”transcript, stated

Evaluation

The source describes alpha-stage validation through grouped signal reports, research accuracy from MCP/codebase context, actionability filtering, PR greenness, CI/comment reruns, and production outcome learning after PR release.

Metrics: manual workflow takes a few hours to a few days · same-problem agent experimentation repeated 100 times · alpha rollout over the next few months · PRs iterated until green

3 supporting quotes
“take anywhere from a few hours to a few days”transcript, stated
“same problem 100 times”transcript, stated
“continue running until the PR is green.”transcript, stated

Outcomes

The source discusses alpha maturity and workflow latency but does not report production PR counts or acceptance rates.

3 supporting quotes
“we're turning these into PRs that are ready to merge when you wake up.”transcript, stated
“learn from every single outcome.”transcript, stated
“if you're rejecting that PR or there's been an issue with a deployment or the errors resolved in production”transcript, stated