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
- Signal — an error, a drift, or a guard violation appears in the trace.
- Diagnosis — Staso reads the trace and your source at the exact failing version, traces the failure to its root cause.
- Fix PR — a pull request with the proposed fix, ready to review and merge.
Quick vs Deep
| Quick | Deep | |
|---|---|---|
| Reads | Spans, errors, source at the failing version | Everything in Quick + full repo clone with code execution |
| Cross-file tracing | Individual file reads | Follows imports, searches symbols, traces call chains |
| Fix PRs | No | Yes |
| Speed | Seconds | Slower — clones and executes in a sandbox |
| Runs when | Default | Pick 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.

You see each tool call and file read live.

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.

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
| Requirement | Enables | Setup |
|---|---|---|
| Staso SDK | All diagnosis | Quickstart |
| GitHub connection | Source-aware diagnosis, Fix PRs | Connect GitHub |
| Deep runs enabled | Multi-file tracing, Fix PRs | Deep Runs |