Staso Docs
Heal

Self-Heal

Self-Heal investigates agent issues — errors, behavior drift, guard violations — using trace data and source code, then opens pull requests with fixes.

Flow

  1. Signal — an error, a drift, or a guard violation appears in the trace.
  2. Diagnosis — Staso reads the trace and your source at the exact failing version, traces the failure to its root cause.
  3. Fix PR — a pull request with the proposed fix, ready to review and merge.

Quick vs Deep

QuickDeep
ReadsSpans, errors, source at the failing versionEverything in Quick + full repo clone with code execution
Cross-file tracingIndividual file readsFollows imports, searches symbols, traces call chains
Fix PRsNoYes
SpeedSecondsSlower — clones and executes in a sandbox
Runs whenDefaultPick Deep in the depth selector, or escalate from a Quick result

Quick needs a GitHub connection for source-aware analysis. Without it, diagnosis runs on trace data alone. Deep is covered in Deep Runs.

Run a diagnosis

Open a failing trace. Switch to the Heal tab. Click Diagnose. Type a specific question — "why did this return None?", "is this a regression?" — or describe a symptom.

Heal tab with Diagnose button and text input

You see each tool call and file read live.

Live investigation progress

The result includes a root cause, a proposed fix, and the option to turn it into a PR.

Follow-ups

Diagnosis is conversational. Ask follow-up questions in the same thread — each carries the full trace and prior diagnosis context.

Fix PRs

When a Deep diagnosis produces a fix, Staso writes the change, creates a branch, and opens a PR against your repo. Review the diff inline before visiting GitHub.

Diagnosis with root cause, fix applied, and View Pull Request link

No fix reaches your code without your approval. The sandbox is scoped to the single fix and torn down immediately after.

Fix PRs require Deep runs and a GitHub connection.

Conversations

Heal works at the conversation level too. Open a conversation, switch to the Heal tab, diagnose across all traces in the session — useful when a failure spans multiple agent turns.

Prerequisites

RequirementEnablesSetup
Staso SDKAll diagnosisQuickstart
GitHub connectionSource-aware diagnosis, Fix PRsConnect GitHub
Deep runs enabledMulti-file tracing, Fix PRsDeep Runs