Skip to content

v0.122.0

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Nov 11:20
9e9d6c8

No VS Code extension change since v0.121.1, so there is no new extension release.

Features

  • export <id> --include-subagents exports a session and its subagents, as agent-strace tree shows them, as one trace in one payload. It works with --format otlp and otlp-genai, to a file or with --endpoint. Each subagent's root span sits under the span of the call that started it, or under the parent session's root span when that span is not exported. It is refused with one line for other formats, --anonymize, --scores, --metrics and --backend. (#562)
  • export --format otlp-genai writes the conversation as gen_ai.input.messages and gen_ai.output.messages on the root span, and each tool call's input and result as gen_ai.tool.call.arguments and gen_ai.tool.call.result on its execute_tool span. The values follow the current OpenTelemetry GenAI message and tool-call schemas. The content, redaction and truncation are the same as before, and the old events and keys stay. (#562)
  • In --format otlp and otlp-genai, a call whose event names an earlier one in retry_of has a span link to that call's span, with agent.strace.link.type=retry_of. (#562)
  • export --endpoint (--format otlp, otlp-genai or temporal) and watch --stream-otlp can send OTLP/HTTP protobuf with --protocol http/protobuf, which Phoenix requires. Without the flag, they follow OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, then OTEL_EXPORTER_OTLP_PROTOCOL. The default stays JSON. (#565)
  • In --format otlp-genai, chat spans from the OpenAI and Anthropic SDK integrations now carry gen_ai.response.id, gen_ai.response.model, server.address and server.port. The integrations record them from the response and from the client's base_url. Spans from other sources do not change. (#570)
  • experiments/semconv-conformance/ runs OpenTelemetry's GenAI conformance check (Weaver live-check) against --format otlp-genai. It is not part of the package. (#570)
  • export --agent-id ID (formats otlp-genai, otlp and temporal) and watch --stream-otlp --agent-id ID put gen_ai.agent.id on every span of the session, including subagent spans with --include-subagents. AGENT_STRACE_AGENT_ID is the fallback. Microsoft Foundry matches a registered external agent's traces by this attribute. (#586)

Fixes

  • A command given the ID or ID prefix of a session whose meta.json is corrupt now prints Error: session <id> has a corrupt meta.json: <reason> and exits 1. Before, it said Session not found, so a broken session looked like a missing one. A readable session that matches the same prefix still wins. (#557)
  • replay --expand-subagents, replay --tree and stats --include-subagents no longer fail with TypeError when a subagent's started_at is null or text. That subagent sorts last. tree no longer fails for a null one. (#562)
  • agent-strace now refuses a session whose events.ndjson holds a line that is not valid UTF-8 with its usual one-line refusal, instead of a UnicodeDecodeError traceback or the codec text. (#559)
  • import now refuses a Codex rollout, a Copilot CLI events.jsonl, or a file with no Claude Code transcript record. It prints Cannot import <path>: <reason> and exits 1, and for Codex and Copilot it names agent-strace setup --cli codex or --cli copilot. Before, such a file imported as an empty claude-code session, and a Copilot file took the session ID events. (#568)
  • In --format otlp and otlp-genai, the session root span is now ERROR only when the session timed out or was terminated, its last model request failed, or a failed tool operation never recovered. Before, any session with an error had an ERROR root, so a session that retried and recovered exported as failed, and the root had no error.type. (#567)
  • cost and the OTLP exports now use the model and token usage that import records for Claude Code transcripts. cost reads the recorded tokens instead of estimating from event size. In --format otlp and otlp-genai, each imported model response becomes a chat {model} span with its token usage, finish reason and response ID. The span starts at the model's last input, since the transcript has no request time, and carries agent.strace.timing=inferred. (#569)
  • In --format otlp-genai, gen_ai.tool.call.result stays valid JSON. Before, it was cut at 500 characters, so a long JSON result became invalid JSON. A JSON result now keeps its structure within the same 500 characters, and a gen_ai.tool.call.arguments value that is not an object does the same within 1000. (#570)
  • lint and assignment now report the right end event for a reasoning spiral when other events sit between the model calls. (#579)
  • Custom anonymize rules are no longer overwritten by keys in a later section of the rules file, such as settings:. (#580)
  • dashboard no longer counts a session as succeeded when its session_end says it timed out or was killed. (#581)
  • The web dashboard compare panel now shows the comparison you asked for last, even when an earlier comparison answers later. (#582)
  • replay --expand-subagents now shows every child session a tool call started, in start order, instead of only the last one. (#583)
  • agent-strace diff now numbers each phase by its place in each session, lists phases only one session has, and reports the first real difference, including an extra phase. (#585)
  • Hooks store a tool result that the agent sends as an object as compact JSON, not a Python repr. This covers Claude Code's Bash and Read, and Codex, Gemini and Cursor objects. Bash output keeps interrupted and any exit code. --format otlp-genai now exports these results as valid JSON in gen_ai.tool.call.result. (#576)
  • Shell command reading now runs in linear time, so long backslash-continued lines, repeated failing heredoc words or deeply nested groups no longer stall review and the other commands that read recorded commands. (#588)
  • optimize --llm now reports a run of the same tool that lasts until the end of a session; before, only runs followed by a different tool were listed. (#587)
  • A resumed session that is still running no longer reads as ended: session status, the assignment no-output check and postmortem crash detection now ignore a session_end that a later session_start reopened. (#590)
  • An operation that failed again after a successful retry now counts as unresolved, so the OTLP session root span reports the error instead of UNSET. (#589)
  • agent-strace lint no longer flags a resumed session that is still running as no-output. (#593)
  • The eval gate's session_status scorer now uses the session end rules of the OTLP root status, with killed for terminated. Copilot's error and abort ends are killed, so is an int exit code too large for a float, and a session resumed after its last session_end reads as not ended. eval run <id> and eval ci <id> print Session not found: <id> for an ID that matches no session. (#575)
  • A CrewAI, OpenAI Agents SDK or Strands run whose stored started_at is not a usable time now ends, with a total duration of 0, and import skips a durationMs that would make the total too large to store. (#574)

Compatibility

  • An ID or prefix that matches only a corrupt session prints Error: session <id> has a corrupt meta.json: <reason> and exits 1, not Session not found: <id>. This includes watch and compliance export. Before, share --assignment said the requested session was not found and eval run said No sessions found. (#557)
  • replay <id> --diff <prefix>, record --parent <prefix> and record-http --parent <prefix> print the same line. Before, they ended in a traceback. (#557)
  • review prints the line after review: and exits 2. pr-comment prints it after pr-comment: and exits 1. (#557)
  • cognitive-debt --session <prefix> exits 1 with its refusal line. Before, it printed an empty report. (#557)
  • verify <prefix> names the corrupt meta.json. verify <full id> still verifies the chain. (#557)
  • setup --verify --live --session <prefix> refuses a corrupt match the way it refuses the full ID. (#557)
  • The collector answers GET /sessions/<prefix> and GET /sessions/<prefix>/events with 400, not 404. With --dashboard, the /api/sessions/<prefix>/* routes answer 400. A prefix that matches nothing still gets 404. (#557)
  • MCP tools return the message as a tool error, {"error": "<message>"} with isError: true. Before, a tool said session not found, or <tool> failed: CorruptSessionMetaError: <message>. (#557)
  • optimize <id> and export <id> --backend langfuse print Session not found: <id> when the ID matches nothing. Before, they printed No sessions found. (#557)
  • freeze with no ID and no readable session prints Session not found. Provide a session ID or record a session first. Before, it printed Session not found: None. (#557)
  • TraceStore.find_session can raise CorruptSessionMetaError, which is a ValueError. A lookup with tenant_id still skips a corrupt session. (#557)
  • In --format otlp, a failed tool call and a call with no result are now tool/{tool} CLIENT spans (kind 3) with gen_ai.operation.name, gen_ai.tool.name and gen_ai.tool.call.id, like a call that returned a result. Before, they were INTERNAL spans named {tool}. (#562)
  • An error span that does not name its tool takes its paired call's tool name instead of error. (#562)
  • In --format otlp, an error tied to no tool call and with no tool_name, such as a failed MCP server start or an HTTP proxy upstream failure, keeps its INTERNAL span named error, as in 0.121.1. Only an error that pairs with a call or has its own tool_name becomes a tool/{tool} span. (#573)
  • In --format otlp, such an error with a tool_name of "" or null is now named error. Before, the span was named "" or null. (#573)
  • export --format otlp-genai adds the four content attributes. examples/otlp/genai-conformance.json is regenerated, with additions only. (#562)
  • otlp-genai payloads are larger, because the content attributes repeat text already in events and in input.value/output.value: about +17% on three recorded sessions. Check collector payload limits. (#562)
  • Span links appear only when a trace sets retry_of. agent-strace's hooks and imports do not set it. (#562)
  • TraceStore.load_events raises UnreadableEventLineError ("line N of events.ndjson is not valid UTF-8") instead of UnicodeDecodeError. Both are ValueError. Commands that read such a session, including lint, standup, and stats and health without an ID, print the refusal they print for a line that is not valid JSON. Exit codes do not change: 1, and 2 for review and compaction. (#559)
  • health <id> prints Error: cannot read session <id>: line N of events.ndjson is not valid UTF-8 instead of Could not read session <id>: and the codec text. It still exits 1. (#559)
  • append_event, append_events and tag_session raise UnreadableEventLineError instead of UnicodeDecodeError, and still write nothing. They name the line that load_events names, whatever the line breaks. The hook still exits 0. Server ingest still answers 202 and counts the error. watch --tenant-id still exits 1. A server meta update that sets a tenant still answers 400, now with the refusal. (#559)
  • The server's GET /sessions/<id>/events answers 400 with the refusal. Before, it closed the connection with no response. (#559)
  • mcp-scan --watch skips such a line appended during the watch, and does not count it. Before, it stopped with a traceback. (#559)
  • backfill-meta still skips such a session as unparseable_events. The detail not UTF-8: invalid start byte becomes line N: not valid UTF-8, and the first problem in file order is reported. (#559)
  • The storage format does not change. A file that decodes today gives the same events, refusals and line numbers. agent_trace.store adds two public helpers, is_not_utf8 and refuse_lines_not_utf8. (#559)
  • With OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL set to grpc, or to any value other than http/json or http/protobuf, export --endpoint and watch --stream-otlp now refuse with one line and exit 1. Before, they ignored the variable and sent JSON. Pass --protocol http/json to send JSON as before. (#565)
  • With either variable set to http/protobuf, export --endpoint and watch --stream-otlp now send protobuf. --output files stay JSON, and --protocol without --endpoint is refused. (#565)
  • An endpoint that answers 415 gets a second line that names the other --protocol. (#565)
  • import exits 1 and writes nothing for a file it used to import as an empty session: a Codex rollout, a Copilot CLI events.jsonl, or a JSONL file with no line of type user, assistant, system or summary, including an empty file. A transcript with unknown lines still imports. (#568)
  • skills --from-claude counts such files as skipped N unreadable, not as empty sessions. (#568)
  • import_jsonl raises NotClaudeTranscript, a ValueError, for such files. (#568)
  • A session that failed and then recovered now has an UNSET root. To keep counting sessions with errors, filter on agent.errors > 0. (#567)
  • An ERROR root carries error.type: timeout, terminated, the failed request's error type, the type of the last failure that never recovered, or _OTHER. Each subagent root with --include-subagents follows the same rule. (#567)
  • The root gains six attributes, also in the otlp-genai metadata.agent_strace object: agent.strace.behavior.failed_operation_count, agent.strace.behavior.retry_count, agent.strace.behavior.recovered_operation_count, agent.strace.behavior.unresolved_failed_operation_count, agent.strace.session_status and agent.strace.last_model_request_failed. examples/otlp/genai-conformance.json is regenerated, with additions only. (#567)
  • watch --stream-otlp roots stay UNSET, with no outcome attributes. (#567)
  • An error event tied to no tool call and no model request, such as a proxy failure, keeps its ERROR span and still counts in agent.errors. On its own it no longer makes the root ERROR. (#567)
  • A session_end whose reason, stop_reason or termination_reason contains error or abort, as Copilot's do, is now terminated, not completed. This changes the root status and the assignment session_status scorer, so a criterion that expected completed for such a session now fails. (#567)
  • cost, tree, timeline, replay, watch and the EU AI Act export show the recorded token counts for imported Claude Code sessions instead of the size estimate. (#569)
  • import stores two new optional event fields, message_id and stop_reason. Sessions imported by earlier versions have neither, so their chat spans have no gen_ai.response.id or finish reasons. To get both, delete the session directory and import again. (#569)
  • Sessions imported before v0.108.0 repeat the usage on every line of a split message, so cost counts it once per line. Import them again. (#569)
  • A Claude Code <synthetic> API error message gets no span, so the root agent.llm_requests can be higher than the number of chat spans. (#569)
  • The direct Langfuse export still ignores this recorded usage. (#569)
  • In --format otlp-genai, a tool result or a non-object tool argument that starts with { or [ but does not parse, such as the Python repr that hooks in 0.121.1 and earlier stored for an object result, is now a JSON string. Other text stays plain. output.value and input.value do not change. (#570)
  • The OpenAI and Anthropic SDK integrations store four new optional event fields: response_id, response_model, server_address and server_port. Stored sessions stay readable, and classic --format otlp output does not change. (#570)
  • dashboard success counts and success rate can go down: a session whose session_end records a timeout or a kill now counts as failed. (#581)
  • diff text output changes when the two sessions have different phases: one-sided phases are listed and a phase at different places shows both numbers. Output for sessions with the same phases is unchanged. (#585)
  • Only the text of a hook-recorded result or error changes. Sessions already recorded keep their repr text, and readers such as the test-runner summary parse both forms. A null tool response is now stored as null instead of None. The 1000- and 500-character limits are unchanged, and secrets are still redacted before the cut. (#576)
  • A session with a session_start after its last session_end now reports session status not_recorded (OTLP agent.strace.session_status, dashboard), and postmortem can report it as crashed when its heartbeat is stale. (#590)
  • An operation whose outcomes are fail, ok, fail now reports recovered_operation_count 0 and unresolved_failed_operation_count 1, and its session root span is ERROR. Before, the root was UNSET. (#589)
  • gen_ai.agent.id is sent only when you give an ID; agent-strace never derives one. An empty --agent-id, or --agent-id where it has no effect, prints one line and exits 1. The attribute has Development status in the OpenTelemetry GenAI conventions. (#586)
  • watch --agent used to abbreviate --agent-pid. With --agent-id added it is ambiguous; use --agent-pid in full. (#586)
  • eval gate session_status: a session_end whose reason, stop_reason or termination_reason contains error or abort is now killed. Before, it was completed with exit code 0 or none, and timeout with exit code 124. A criterion that expects completed now fails for Copilot's error and abort ends, and a baseline saved by an earlier version can report a regression for such a session. (#575)
  • eval gate session_status: an int exit_code too large for a float is now killed. Before, the criterion failed with no score and the reason int too large to convert to float. (#575)
  • eval gate session_status: a session that a session_start reopened after its last session_end is now completed when its metadata has ended_at, else killed. Before, the scorer read the session_end before the resume, so a baseline saved by an earlier version can report a regression. (#575)
  • eval run <id> and eval ci <id> print Session not found: <id> to stderr when the ID or prefix matches no session. Before, they printed No sessions found. The exit code is still 1. (#575)
  • A CrewAI, OpenAI Agents SDK or Strands run whose started_at in meta.json is not a usable time, or is later than the end, now ends with ended_at, the counts and a total_duration_ms of 0. Before, the session stayed open, or stored NaN, an infinity, a total counted from 1970 or a negative total. The session_end event does not change. (#574)
  • import skips a turn_duration entry whose durationMs would make the total too large to store. Before, the total could be Infinity or an int too large for a float. A valid run and a valid import store the same total as before. (#574)

Documentation

  • docs/commands.md (the corrupt meta.json paragraph and backfill-meta), docs/server.md and docs/mcp.md describe the corrupt meta.json error for an ID prefix. (#557)
  • docs/production.md documents the GenAI content attributes, retry links, classic tool spans and --include-subagents. docs/commands.md lists the new flag and its refusals. (#562)
  • docs/production.md (Phoenix), docs/commands.md (export and watch flags, endpoint table) and docs/integrations.md describe --protocol. ADR-0006 is amended to allow stdlib OTLP/HTTP protobuf; gRPC stays excluded. (#565)
  • docs/commands.md (import) says import reads Claude Code transcripts only, how other agents' logs are recognised, and lists the new errors. (#568)
  • docs/production.md has a new "Session root status" section: the rule, error.type, the new attributes, and how to keep counting sessions with errors. docs/telemetry-dev.md marks the recovered-session limit as Predicted. (#567)
  • docs/production.md has a new section, "Model responses imported from a transcript": the span, its attributes and the timing rule. docs/commands.md (import, cost, export) is updated. (#569)
  • docs/production.md covers the JSON-string content encoding, that export sends recorded content by default, the keys outside the GenAI registry, the new chat attributes and the conformance status. experiments/semconv-conformance/RESULTS.md has the counts: missing_attribute is sdk 148, session 230 and tree 228, sdk violations drop from 169 to 153, and error_type_missing_on_error is 0. The code and ADR-0011 now follow semconv-genai release v0.1.0 instead of commit e6658f1. (#570)
  • docs/commands.md describes how post-tool and post-tool-failure store a tool's output. docs/production.md, docs/security.md and docs/capture-matrix.md are updated to match. (#576)
  • docs/integrations.md has a new Azure Monitor and Microsoft Foundry recipe: the collector config, registering the agent in Foundry with the ID, the send commands and what was verified. experiments/azure-monitor/ records what otelcol-contrib 0.165.0's Azure Monitor exporter sends for agent-strace traces: every span arrives with gen_ai.agent.id, arrays are dropped and values are cut at 8192 bytes. Application Insights and Foundry themselves were not tested. (#586)
  • docs/commands.md (eval) gives the session_status rules, the three ways they differ from the root status rules, and the Session not found line, and the eval ci synopsis shows its optional session ID. docs/production.md (Session root status) says the eval gate uses the same rules. (#575)
  • docs/production.md (Classic tool spans) and docs/commands.md (export) say when an error is a tool call. (#573)
  • docs/integrations.md (Sessions) says such a run still ends, with a total duration of 0. docs/commands.md (import) says such a durationMs is skipped. (#574)