Skip to main content

Record AI agent traces as whatbroke JSONL. Diff two runs with the whatbroke CLI and see exactly what changed.

Project description

whatbroke-recorder

Record AI agent traces from Python as whatbroke JSONL. Swap a model, tweak a prompt, record again, then diff the two runs and see exactly what changed: which tool calls disappeared, which arguments drifted, where cost and latency moved.

pip install whatbroke-recorder

Zero dependencies. The trace format is identical to the Node SDK and the whatbroke record proxy, so traces from any of them diff against each other.

Usage

Wrap your existing client, run your agent exactly as before:

from whatbroke import Recorder
from openai import OpenAI

rec = Recorder("traces/current.jsonl", run="refund-flow")
client = rec.wrap_openai(OpenAI())

run_my_agent(client)  # llm calls and tool calls are captured

rec.output(final_answer)
rec.end("ok")

rec.wrap_anthropic(client) does the same for the Anthropic SDK. Sync and async clients both work.

For everything else, write events directly:

rec = Recorder("traces/current.jsonl", run="refund-flow")
rec.llm_call(model="gpt-4o", latency_ms=900, input_tokens=512, output_tokens=128, cost_usd=0.004)
rec.tool_call("lookup_order", {"order_id": "A-1042"})
rec.output("Refund issued.")
rec.end("ok")

Diffing

The diff CLI ships on npm:

npx whatbroke-cli diff traces/baseline.jsonl traces/current.jsonl

Exit code 1 when something breaking shows up (a dropped tool call, a run that started failing), so it slots straight into CI. Full docs, flaky-agent sampling, behavior contracts, and importers for OTel/Langfuse/LangSmith: github.com/arthi-arumugam-git/whatbroke.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whatbroke_recorder-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whatbroke_recorder-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file whatbroke_recorder-0.1.0.tar.gz.

File metadata

  • Download URL: whatbroke_recorder-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for whatbroke_recorder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b1a39e90fa072d13cec50b57033db1c84486c7f3a597a5a3a02bd5aaa2c8818
MD5 65217eb3d7a288e7e7d2d76c00054005
BLAKE2b-256 61bc41404906625cdaec2ba04f22962506924b659631adde0fc9e9f2af07aa9f

See more details on using hashes here.

File details

Details for the file whatbroke_recorder-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for whatbroke_recorder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 909216d881cfd6a1d66f884026afa58fd33d910192c80ea08fdfd531a175c2df
MD5 8f6296cf1dd539f8e8e902929bf174f9
BLAKE2b-256 e6dfea42e17c85b05f9b39f32f0228c27a0785a4cc96c86aa4cf1d58fd51c11e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page