Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@Beehtrix Thanks. The careful parts hold:
But with real exporters the tree comes out wrong, silently. Exporters send a span when it ends, so an agent's calls reach the signer before the agent span does. With SimpleSpanProcessor (one span per request) all 5 sub-agent calls of the PR's The root cause is placing each call at write time, which depends on arrival order. A design that doesn't:
Order stops mattering, and four other problems go with it:
This changes #1240's "each its own run"; the goal is showing who made each call, and I'll update the issue to match. Could you sketch the records first (fields, and where the parent ids go: an Smaller, for the rewrite:
|
|
Thanks for the careful review. I reproduced the wrong tree before designing anything: Pydantic AI (an orchestrator and two sub-agents, offline models, 11 calls) through the OpenTelemetry SDK's Shape. One run per trace, as on main. Nothing is placed at write time and no agent run is registered (no Records
Reading. Before and after (same run, Batch windows give the same "after". Your four side problems
Costs, so you can veto
Plan if this works for you: tests for calls in batch 1 with the agent span in batch 2, the same across a restart, shuffled and one-span-per-request orders, a framework span between agent and call, loops, depth, and the export, then |
|
@Beehtrix Thanks, this is the right design, and reproducing the wrong tree first was the right start. Please go ahead. On your three questions:
Your test plan covers what we'd ask. Please also cover |
|
Thanks — proceeding on this PR with your three answers (otel informational, link only recorded parent spans, verifier_min_version 1.4.0). Will include |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Give each OpenTelemetry agent span (invoke_agent, or create_agent with calls under it) its own T3 import run, linked to the enclosing agent's run by parent_run. Model and tool spans are recorded in the run of their nearest enclosing agent span, whatever order they arrive in. A span whose agent has not arrived is recorded in the trace's run after a signed ext note otel.unplaced. A trace with no agent span is one run, as before. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Describe agent runs, the application-reported tree, span placement and the split-batch limit in otel.md and limits.md, and the otel.unplaced ext note in format-v2.md. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
…retried orphans Review findings on the agent-run import: - process a request depth first (each agent span, then what is in its run), so parallel agents are not all open at once under open_runs - cap the registration recursion for loops of agent spans - a run.registered of an agent span carries its span_id, so a nested agent that arrives after its root in an earlier batch is placed without a false note - a retried span is also looked for in the trace's agent runs - an exported sub-agent names its parent run's span as parentSpanId Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
…te condition Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Greptile review findings: the retried-span lookup scanned every run per trace, and duplicate agent spans in one request multiplied their children in the tree walk. The agent runs are indexed by trace on first use, and a request's duplicate spans are collapsed before placement. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
… the first is Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
…t run by run Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
The signer will record parent span ids and agent spans instead of placing calls into agent runs at write time. The tree is assembled when the records are read: each call's nearest agent is found by walking parents iteratively (hop and depth caps), and create_agent spans count only when something hangs under them. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Exporters send a span when it ends, so placing calls into agent runs at write time put every call in the root agent's run with real processors. Keep one run per trace, write each call's parent span id and each agent span as non-critical ext, and record a skipped framework span as a link when a recorded span hangs under it (the run's refs set, rebuilt on replay). The tree is built when the records are read. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
review() adds an otel summary of the agent tree, and the run list renders those agents as nested rows under the run instead of as separate runs. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Replace the write-time placement / otel.unplaced design with parent and agent records in the trace's run, the read-time tree, and a (1.9) limits row for a chain that ends at a span the signer never received. Signed-off-by: Beehtrix <walkin_danger@hotmail.com>
Add VERSIONS 1.10.0 and EXT_CHECKS for otel in Python and TypeScript so imported OTLP bundles no longer warn not interpreted on every call. Update limits and format-v2; nested agent export still needs verifier 1.4.0.
425b4c9 to
b15c97f
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@Beehtrix Thanks, the design holds where it matters most. We ran 24 real
Before merge:
Smaller:
|
What and why
Fixes #1240.
After maintainer approval (2026-12-01) of the records sketch: one run per trace, no placement at write time, agent tree built when records are read.
The v2 signer's OTLP import (
POST /v1/traces) now records what each span says about its parent instead of opening agent runs or placing spans at write time:tool.call/model.exchangerecord carriesext.otel.parent(parent span id; omitted for a root call).extrecord{name: otel, kind: agent, agent, agent_id?, operation, parent_span_id}when the span arrives (span_iddedupe unchanged).extlink record only when a recorded span already names that span as parent (not every unrecognised span: order-proof but adds noise to every web trace).tracekit.otel_agents.build(records)walks parents (≤64 hops, memoised); calls whose chain ends at a missing span show as unseen until the agent span arrives; nesting capped at 32.tracekit viewlists each agent and its call count from the same read path.ext.otelinEXT_CHECKSas informationalotel import(Python + TypeScript,VERSIONS1.10.0 row). Bundles still needverifier_min_version: 1.4.0(theextslot). Nonot interpretedon every import.otel.unplaced, write-timeparent_run/sessionfor imports,MAX_AGENT_DEPTHplacement, parent-walk on the writer thread.Maintainer answers implemented:
otel→EXT_CHECKSinformational (not a per-bundle warning).verifier_min_version: 1.4.0for imported runs kept.AI assistance: written by an AI coding agent for @Beehtrix.
Verify and view evidence
Nested agent trace (orchestrator + researcher + fact-checker + writer + framework “running tools” span between researcher and tool — same shape as the Pydantic AI repro: orchestrator, two sub-agents, 7 tool/model spans):
pytest tests/test_signer_otel.py::TestAgents::test_the_bundle_of_a_trace_with_agents_verifies_and_the_verifier_reads_ext_otel— export--v2, then verify:0, nonot interpretedwarnings[pass] otel import: N record(s) carry ext.otel (4 agent, 1 link, … call parent): the application's report of its span tree, not checked for truthverifier_min_version: 1.4.0,verifier_version: 1.10.0View —
tests/test_view_ui.py::test_an_imported_runs_review_lists_the_agents_its_application_reported_and_the_calls_in_noneexercises the review otel panel (otelRows): e.g.<orchestrator> 5 calls,researcher 3 calls,writer 3 calls.Full suite:
tests/test_signer_otel.py31 passed;tests/test_otel_agents.py; ext interpretation parity (test_an_ext_interpretation_adds_only_its_own_lines).What changed vs the sketch (
/tmp/sketch-1246.md)ext.otel+ informational verifier (maintainer preferred overnot interpreted)VERSIONS1.10.0 +otel importline (Python/TS)signer/otel.pylinks(), limits (1.9))verifier_min_version1.4.0needs()— ext slot only bumps critical)otel.unplacedgoneTest results (this push)
pytest tests/test_signer_otel.py tests/test_otel_agents.py -q— passpytest tests/test_bundle_v2.py -k ext_interpretation -q— passpytest tests/test_ts_verifier.py -k versions -q— pass (versions.json matchesbundle_v2.VERSIONS)Checklist
docs/otel.md,docs/limits.md,docs/format-v2.mdgpgsig); GitHub shows unknown_key until the signing key is on the Beehtrix account (same for prior commits on this branch)Security invariants
ext.otelwarns on verify