Repository navigation
v4 — Owning the traces
Cameron's traces now stay on infrastructure you control, like the data they describe.
v3 moved Cameron's instructions out of the system prompt. This release fixes something Cameron inherited and never chose: tracing. The starter shipped a Langfuse callback pointed at a hosted backend, and a trace carries every prompt, tool argument and transaction. That quietly broke the third rule: all financial data stays on infrastructure the owner controls. Tracing now uses OpenTelemetry and goes to a backend you run.
Built in public alongside the Agentailor blog, with one tagged release per article. The series hub, including where the roadmap goes next, is at blog.agentailor.com/cameron.
📖 The guide for this release: Own your agent traces with OpenTelemetry walks through the approach this release takes: GenAI spans, content capture as an explicit opt-in, and a backend you host yourself.
⚠️ Upgrading an existing install? Back up first. This release includes migration0003, which converts amounts to major units and drops the oldamount_minorcolumn. The production stack applies it on the nextdocker compose --profile full upwith a rebuilt image. Take apg_dumpbefore you do (see AGENTS.md).
What's new in v4
🔭 OpenTelemetry instead of a vendor SDK
Agent runs are traced as OpenTelemetry GenAI spans: invoke_agent for the run, chat for each model call and execute_tool for each tool call. Graph nodes and middleware get no spans of their own, so a trace shows the agent rather than LangGraph's internals. Next.js's own route and fetch spans land in the same trace. @langfuse/* is gone.
The approval gate shows up in traces too: a pause is recorded as an event on the run span, with tool names only, and a resumed run records how many calls were approved and rejected.
🔒 Off by default, with two separate opt-ins
- Tracing turns on only when
OTEL_EXPORTER_OTLP_ENDPOINTis set. The code has no default destination. - Content capture (
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true) is a separate switch. While it's off, no prompt, message, tool argument, tool result or error message leaves the process. Traces carry only names, counts, timings and token usage.
Captured content is not redacted. Turning capture on sends it as-is to the backend you configured, which is why that backend should be one you run. Redaction for owners who'd rather send traces to a hosted backend is tracked in #51.
🏠 A self-hosted backend, split the same way as the data
Phoenix runs next to Cameron by default, with the dev and production stacks kept apart just like Postgres and MinIO:
| Dev | Production | |
|---|---|---|
| Service | phoenix (--profile tracing) |
phoenix-prod (--profile full) |
| Port | 6006 | 6016 |
| Volume | phoenix_data |
prod_phoenix_data |
Both bind to localhost only and have Phoenix's own usage telemetry turned off. Production reads PROD_OTEL_* variables, so a dev value in .env can't redirect production traces.
🔁 Any OTLP backend is an endpoint change
Langfuse (self-hosted), Jaeger or anything else that speaks OTLP works without a code change. We checked this by pointing the same build at Jaeger 2.11. All gen_ai.* / cameron.* attribute names live in one file (semconv.ts), because the GenAI conventions are still at Development stability. See docs/OBSERVABILITY.md.
🐛 The inherited tracing never ran in Docker
With an src/app layout, next build looks for instrumentation.ts only inside src/. The starter's file sat at the repo root, which still runs under pnpm dev, so the production image silently shipped without tracing. Both files now live in src/. Separately, the production image couldn't build at all because next/font/google downloaded Geist during the build. The fonts now come from the geist package, and the build makes no network calls (#50).
Also in v4
✏️ Correct and delete transactions (#44). Until now Cameron could add a transaction but never fix one, so a wrong amount was permanent and the only remedy was logging it again, which double-counts. This release adds two validate-then-write pairs: update_transaction changes one row in place, and delete_transaction removes 1–25 rows by id, all or nothing. A validation is tied to each row's state: if the row changes after validation, the write returns stale, and the database re-checks under a row lock. Delete takes ids, never SQL. The approval card shows the server's matched validation, not the agent's description of it.
🛡️ One decision per gated call (#48). When the agent made several gated calls in one step, approving one card approved all of them. Since #44, that could mean approving a harmless log_expense also approved a delete_transaction in the same step. Each card now records its own decision, the batch is sent only when every call has one, and the server refuses to resume on any missing, unknown or misaligned id rather than filling in a default. A denial still sends the whole step back to the model, deliberately: calls made in one step form one plan.
💱 Amounts in major units everywhere (#47). The prompt said amounts were in cents, which was true only of the raw column run_sql saw. In an eval, a $7.00 row came back as $0.07, and the database was correct, so no grader caught it. Storage is now amount numeric(14,2), which is exact, and every tool, the SQL view and the chart skill use the same unit. There's no conversion step left to get wrong.
🕐 Timestamps read as UTC (#44). Every repository except threads read the already-UTC timestamp columns as local time, so on a UTC+1 host every transaction came back an hour off. All repositories now read timestamps through shared helpers.
🔌 A /connections page (#41). The MCP dialogs are replaced by a page. Its Form and JSON views edit the same draft, and you can paste a config in any common shape (mcpServers, VS Code servers, a bare map, a single server). A paste holding several servers opens a checklist. Tools are listed only when you ask, one server at a time, with typed errors rather than an empty list.
📉 A 37% smaller history response (#39). The thread history endpoint now returns only the fields the UI reads, not LangChain's whole serialization.
🎯 Evals (#40, #44, #48). The suite grows to 26 cases. New ones cover correcting in place instead of re-logging, a denied delete writing nothing, a mixed approve/deny batch deciding each call on its own, and a skill loaded only once per conversation. Scripted multi-turn cases are gone: every later turn comes from the simulated user, and user.agenda holds the user's own follow-ups. The suite can now grade any provider the app supports (EVAL_PROVIDER), and pnpm eval:render renders any saved report.