Skip to main content
Use ancha import --offline to turn a trace of a production run into a scene for ancha run. It runs on your computer and uploads nothing.
The file is an Ancha Trace IR file (.jsonl), or an OTLP JSON export whose spans carry the request and response bodies of the agent’s calls to its tools. Hosted workspaces don’t take traces, so pass --offline. A trace that holds only model calls and tool-call spans (a tool’s name, arguments and result), as most tracing setups record them, has no such requests. The import then stops with the trace has no API calls or webhooks Ancha can read and exits 3.

Options

Output

Output
The scene’s folder, trace-<first 8 characters of the trace ID>, holds scene.yaml and provenance.json. The provenance file records which facts came from the trace, which Ancha inferred and which are missing. With --json, the result has scene (the path written), summary (trace, agent, records, observed, inferred, missing and questions counts) and questions, each with id, question, options and default.

Answer the questions

One trace can’t settle everything, such as what the agent is told when it starts or which header the app’s scheduled calls carry. Each question has a default, and the scene uses it until you answer. A default repeats what production did, so answer the questions about what went wrong:
Then run the scene against the version that failed in production. It should fail the same way. See Test an app for what a trace can’t show.

Exit codes

Traces in a workspace

ancha traces, ancha traces show <id> and ancha pull <id> work with a workspace that takes traces from your agents. Hosted workspaces at app.ancha.io don’t take traces: ancha traces stops with this workspace does not take traces yet. Use ancha import --offline with a trace file instead. To write an attempt of your own run in the same format, use ancha runs export.