Repository navigation
feat(semconv): add cost, time-to-first-token and coding-agent attributes - #605
Merged
Merged
Conversation
Adds the attribute names Future AGI already reads but the conventions did not define, so coding-agent traces show cost, TTFT, tool names and token totals: - gen_ai.cost.total / gen_ai.cost.input / gen_ai.cost.output (read by fi-collector pkg/adapter costTotalKeys and tracer/utils/otel.py). - gen_ai.server.time_to_first_token. Future AGI's dashboard reads it as milliseconds; the OTel GenAI spec and the agentcc gateway use seconds. The mismatch is documented on the constant as a backend follow-up. - fi.usage.scope / fi.usage.contribution / fi.cost.kind, which the trace detail totals already honour, so turn-level usage counts exactly once. - The fi.agent.* provenance group used by the coding-agent core (fidelity, timing, outcome, usage plan/additivity, cost source, gaps, transport, source call id, non-additive summaries, tags, events). - SpanAttributes.TOOL_CALL_ID alias in Python. Same keys in TypeScript, Python, Java, C# and the five Go modules, each with a wire-contract test. No existing constant is renamed or removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nik13
added a commit
that referenced
this pull request
Nov 7, 2026
- @traceai/auto 0.1.0: zero-code Node auto-instrumentation (adapters off by default), with bundled third-party notices. - @traceai/fi-core 1.2.0: content privacy runtime, typed session.id exported with setSession, base64 images never exported; non-HTTP(S) URLs in text are kept. - fi-instrumentation-otel 1.3.0: base64 image cap defaults to 0; semantic conventions from #605 listed in the changelog. - Package fixes: openai 0.1.17, langchain 0.1.6, vercel 0.1.4, genkit 0.1.1, strands 0.1.3. - Release pipeline: NuGet publication stays off.
nik13
added a commit
that referenced
this pull request
Nov 10, 2026
…14 and Java 1.0.3 Core 1.3.1 also ships the PII-redaction scoping fixes (#195/#244) that sat under Unreleased, and the 1.3.0 heading gets its release date. OpenAI 0.1.14 also ships the Azure metadata (#154), Baseten (#541), Azure Government (#502), OpenRouter host (#547), full multi-message input (#245) and exhausted-stream changes. Java 1.0.3 also ships #543 and #605. Notes the remaining blank OTEL-env Authorization limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nik13
added a commit
that referenced
this pull request
Nov 10, 2026
… traceAI-langchain 0.2.2, Java 1.0.3 (#636) * chore(release): bump core, OpenAI, LangChain and Java patch versions Synchronize runtime versions, reactor parent references and release changelogs for #155, #348, #397, #393 and #425. Dependency floors are unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com> * chore(release): list every change shipping in core 1.3.1, OpenAI 0.1.14 and Java 1.0.3 Core 1.3.1 also ships the PII-redaction scoping fixes (#195/#244) that sat under Unreleased, and the 1.3.0 heading gets its release date. OpenAI 0.1.14 also ships the Azure metadata (#154), Baseten (#541), Azure Government (#502), OpenRouter host (#547), full multi-message input (#245) and exhausted-stream changes. Java 1.0.3 also ships #543 and #605. Notes the remaining blank OTEL-env Authorization limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Coding-agent traces in Future AGI showed 0 tokens, $0 cost and no time-to-first-token, even when the agent reported them. The agent plugins wrote these values under names the backend never reads, because
fi-semantic-conventionsdid not define the names the backend does read.What
Adds the missing names in TypeScript, Python, Java, C# and the five Go modules. Nothing existing is renamed or removed.
gen_ai.cost.total/.input/.outputfi-collector/pkg/adapter/adapter.go(costTotalKeys),futureagi/tracer/utils/otel.py(COST_TOTAL)gen_ai.server.time_to_first_tokenfutureagi/tracer/utils/otel.py(TIME_TO_FIRST_TOKEN),services/clickhouse/query_builders/dashboard.pyfi.usage.scope/fi.usage.contribution/fi.cost.kindfi.agent.*(fidelity, timing, outcome, usage plan and additivity, cost source, gap, transport, source call id, summaries, tags, event)Python also gets the
SpanAttributes.TOOL_CALL_IDalias, which previously existed only onToolCallAttributes.Open question: TTFT unit
The dashboard labels
gen_ai.server.time_to_first_tokenin milliseconds. The OTel GenAI spec and our agentcc gateway (otel.go) use seconds. The constant's documentation records this mismatch; the backend needs to pick one unit.Tests
Every language has a wire-contract test. All of them ran in an isolated E2B sandbox:
Follow-up
The coding-agent core switches to these constants in the agent-plugins integration branch. That switch:
gen_ai.cost.total;gen_ai.server.time_to_first_token;tool.nameandtool_call.idon tool spans;🤖 Generated with Claude Code