Skip to content

docs(#7230): document computing cost from token telemetry - #7232

Merged
ascerra merged 2 commits into
mainfrom
agent/7230-token-cost-telemetry
Oct 23, 2026
Merged

ascerra merged 2 commits into
mainfrom
agent/7230-token-cost-telemetry

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Explains how to estimate inference cost from persisted token counts using contracted rates, including runs whose runtime-reported cost is zero. Uses run-telemetry.jsonl agent spans as the primary source and metrics.json as the run-level fallback.

Closes #7230.

Changes

  • Adds an executable OTLP JSONL extraction command and a worked Codex example covering input, output, cache creation, cache read, and reasoning tokens.
  • Documents field presence, interrupted-run limits, runtime-specific reasoning overlap, and mixed-model attribution limits. Links the pinned pi 1.3.0 schema; requires verification for OpenCode.
  • Links the pricing guide from the cost contract, MLflow caveat, CLI metrics reference, and Codex runtime guide.
  • Keeps the Codex runtime-guide edits limited to cost reporting and the pricing link. Removes the unrelated readiness, CI credential prerequisite, and runtime-recommendation rewrite.

Validation

  • Applicable pre-commit hooks passed for all four changed documentation files, including secret detection and documentation links/fragments.
  • Executed the documented jq command against OTLP-shaped fixtures: multiple spans, root-span exclusion, string-encoded integers, and omitted zero reasoning passed.
  • Verified worked-example arithmetic: $0.504.
  • git diff --check passed.
  • Squashed to one DCO-signed-off commit on main 1c0e9b1bef834f5d936119dad8d83b9aa044a598.

Fresh hosted CI and automated review results are reported separately on the PR.

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner September 11, 2026 12:19
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Sep 11, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:21 PM UTC · Completed 12:34 PM UTC

Commit: a24c77a · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $2.98

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Sep 11, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Low-risk documentation-only changes with strong issue alignment, but elevated recent commit churn and regression history across touched documentation files keep the composite score at 2 (moderate).

Previous run

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Tier 1 metadata reflects a low-risk docs-only change (4 files, 162 lines, bot author, no protected paths) and Tier 3 confirms strong issue alignment, but elevated Tier 2 commit churn and regression history keep the composite score at 2 (moderate).

Previous run (2)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Tier 1 metadata reflects a low-risk docs-only change (4 files, 162 lines, bot author, no protected paths) and Tier 3 confirms strong issue alignment, but elevated Tier 2 commit churn and regression history keep the composite score at 2 (moderate).

Previous run (3)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Tier 1 metadata reflects a low-risk docs-only change (4 files, 193 lines, bot author, no protected paths) and Tier 3 confirms strong issue alignment, but elevated Tier 2 commit churn and regression history keep the composite score at 2 (moderate).

Previous run (4)

Risk Assessment: moderate (2/5)

Details

Re-review anchoring: Tier 1 metadata is unchanged (3 doc files, 128 lines, no protected or CI paths, bot author) and Tier 3 confirms full issue alignment, but Tier 2 churn in shared tracing docs elevates the composite score to 2 (moderate).

Previous run (5)

Risk Assessment: moderate (2/5)

Details

Re-review anchoring: Tier 1 metadata is unchanged from the prior round (3 files, docs-only, no protected/security/dependency/CI paths, bot author); this round only reworks wording in the already-touched reasoning/output disjointness passage and adds one reference table row, with no new files or protected paths. Tier 2 history reflects shared, frequently-edited tracing docs churn unrelated to instability from this change, and Tier 3 remains a well-matched, fully-satisfied docs issue, preserving the prior score of 2 (moderate).

Previous run (6)

Risk Assessment: moderate (2/5)

Details

Re-review confirms Tier 1 metadata is unchanged (3 files, docs-only, no protected/security/dependency/CI paths, bot author); the only new commit reworks wording in the already-touched cancelled-run cost/reasoning passage with no new files or protected paths. Tier 2 churn/fix-revert signals remain elevated but reflect general repo-wide edit activity on shared, frequently-modified tracing docs rather than instability from this change. Tier 3 remains a well-matched, fully-satisfied documentation issue. Weighted composite (~1.7) rounds to 2, preserving the prior score of 2 (moderate).

Previous run (7)

Risk Assessment: moderate (2/5)

Details

Re-review confirms Tier 1 metadata is unchanged (3 files, ~114 lines, docs-only, no protected/security/dependency/CI paths, bot author); the latest commit only reworks wording in two already-touched docs with no new files or protected paths. Tier 2 churn/fix-revert/coupling signals are elevated but reflect general repo-wide edit activity on shared, frequently-modified runtime/tracing docs rather than instability introduced by this change. Tier 3 remains a well-matched, fully-satisfied documentation issue. Weighted composite (0.51.25 + 0.33.0 + 0.2*1.0 = 1.73 -> 2) preserves the prior score of 2 (moderate).

Previous run (8)

Risk Assessment: moderate (2/5)

Details

Re-review: Tier 1 metadata is unchanged (3 files, 102 lines, docs-only, no protected/security/dependency/CI paths, bot author), and the only new commit since the prior assessment adds a single caveat row to one doc in response to reviewer feedback with no new files or protected paths; Tier 2 elevated churn/fix-revert counts reflect general repo-wide edit activity on these shared doc files rather than instability introduced by this change, and Tier 3 remains a well-matched, fully-satisfied documentation issue, so the prior composite score of 2 (moderate) is preserved.

Previous run (9)

Risk Assessment: moderate (2/5)

Details

Re-review anchoring applies: Tier 1 metadata is unchanged from the prior run (3 files, ~91 lines, small blast radius, no protected/security paths, no CI or dependency changes, bot author), and the single new commit since the prior review only adds a missing 'Reasoning' row and caveat to distributed-tracing.md in response to a reviewer finding, without introducing new files, protected paths, or dependency/CI changes; per the anchoring rules the prior composite of 2 (moderate) is preserved.

Previous run (10)

Risk Assessment: moderate (2/5)

Details

Tier 1 metadata is uniformly low-risk (small, docs-only, no security/protected paths, no dependency or CI changes, bot author), Tier 2 shows moderately active recent churn on two of the three touched doc files with no instability tied to this specific content, and Tier 3 shows a well-matched, low-priority documentation issue with acceptance criteria met, yielding a composite of 2 (moderate) driven mainly by the touched files' higher recent edit frequency despite the change itself being trivial and additive.

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Review

Findings

Low

  • [doc-style] docs/guides/infrastructure/distributed-tracing.md:408 — The added cross-reference link is appended to the end of the prose line (about 120 characters) instead of starting on its own line, unlike the new cross-reference at lines 466-468.
    Remediation: Break the line after "see" so the link starts on a new line.
  • [doc-style] docs/guides/infrastructure/distributed-tracing.md:504 — Line 504 is 86 characters in new prose, over the roughly 80-column wrap guideline in docs/contributing/documentation.md; the paragraph was edited without rewrapping.
    Remediation: Rewrap lines 500-505 to about 80 columns.
Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJhcGktY29udHJhY3QiLCJmaWxlIjoiZG9jcy9ydW50aW1lcy9jb2RleC5tZCIsImlkIjoiZl81ZWM3MjZkYjc0MWU0ZjI3IiwibGluZSI6Mjk4LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJzY29wZS1jcmVlcCIsImZpbGUiOiJkb2NzL3J1bnRpbWVzL2NvZGV4Lm1kIiwiaWQiOiJmXzZjN2NkNGU1MzZjYWUyY2UiLCJsaW5lIjoyOTMsImFjdGlvbmFibGUiOmZhbHNlfV0sImRpc3Bvc2l0aW9ucyI6W3siaWQiOiJmXzVlYzcyNmRiNzQxZTRmMjciLCJzdGF0dXMiOiJkaXNtaXNzZWRfYnlfaHVtYW4ifSx7ImlkIjoiZl82YzdjZDRlNTM2Y2FlMmNlIiwic3RhdHVzIjoiZGlzbWlzc2VkX2J5X2h1bWFuIn1dfQ== -->

Looks good to me

Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJhcGktY29udHJhY3QiLCJmaWxlIjoiZG9jcy9ydW50aW1lcy9jb2RleC5tZCIsImlkIjoiZl81ZWM3MjZkYjc0MWU0ZjI3IiwibGluZSI6Mjk4LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJzY29wZS1jcmVlcCIsImZpbGUiOiJkb2NzL3J1bnRpbWVzL2NvZGV4Lm1kIiwiaWQiOiJmXzZjN2NkNGU1MzZjYWUyY2UiLCJsaW5lIjoyOTMsImFjdGlvbmFibGUiOmZhbHNlfV0sImRpc3Bvc2l0aW9ucyI6W3siaWQiOiJmXzVlYzcyNmRiNzQxZTRmMjciLCJzdGF0dXMiOiJkaXNtaXNzZWRfYnlfaHVtYW4ifSx7ImlkIjoiZl82YzdjZDRlNTM2Y2FlMmNlIiwic3RhdHVzIjoiZGlzbWlzc2VkX2J5X2h1bWFuIn1dfQ== -->

Looks good to me


Labels: PR changes user-facing documentation only.

Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImFwaS1jb250cmFjdCIsImZpbGUiOiJkb2NzL3J1bnRpbWVzL2NvZGV4Lm1kIiwiaWQiOiJmXzVlYzcyNmRiNzQxZTRmMjciLCJsaW5lIjoyOTgsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6InNjb3BlLWNyZWVwIiwiZmlsZSI6ImRvY3MvcnVudGltZXMvY29kZXgubWQiLCJpZCI6ImZfNmM3Y2Q0ZTUzNmNhZTJjZSIsImxpbmUiOjI5MywiYWN0aW9uYWJsZSI6ZmFsc2V9XX0= -->

Review

Findings

Medium

  • [api-contract] docs/runtimes/codex.md:298 — The new sentence "CI use requires the OpenAI Workload Identity mapping" is incorrect. resolveOpenAICredential in internal/cli/run_openai.go also accepts a static OPENAI_API_KEY in CI when no WIF trio is configured (its error guidance names a masked GitLab CI/CD variable and the FULLSEND_OPENAI_API_KEY GitHub repository secret), and Codex can use the documented inference-gateway route without an OpenAI WIF mapping. The base text scoped the mapping requirement to the WIF route; the PR turned an optional credential route into a universal prerequisite.
    Remediation: Qualify the mapping requirement as applying to the direct OpenAI WIF route, and mention that static-key CI and inference-gateway runs have their own credential requirements.

Low


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (4)

Review

The prior finding (the cancelled Codex/pi "non-zero reasoning whenever a turn/message finished" overstatement) is fixed in this revision — the correctness sub-agent verified the current text now qualifies that reasoning is non-zero only when the finished turn/message actually reported reasoning tokens, checked against internal/runtime/pi_progress.go and internal/runtime/codex_progress.go. No new correctness, intent-coherence, or style issues were found in this round.

Findings

Low

  • [docs-currency] docs/runtimes/codex.md:81 — The Codex runtime guide notes that metrics.json records cost as 0 while token counts are recorded normally, but does not cross-link to the new "Computing dollar cost from token telemetry" section this PR adds explaining how to price those persisted tokens.
    Remediation: Add a cross-link to the new section, e.g.: "See Computing dollar cost from token telemetry for how to calculate cost from the recorded token counts."

  • [sub-agent-failure] N/A — The challenger sub-agent returned an empty adjudicated_findings array for a non-empty input (the one docs-currency finding above). Per protocol this is treated as a challenger failure regardless of the stated rationale (the challenger argued the finding is out-of-charter for docs-currency, since docs/runtimes/codex.md's existing content is not incorrect — only missing an optional cross-link). Falling back to the pre-challenger finding set; not observed to indicate a real problem beyond the note above.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (5)

Review

The prior finding (pi's reasoning being incorrectly grouped with Claude as "already included in output") is fixed in this revision — verified against internal/runtime/pi_progress.go, internal/runtime/codex_progress.go, and the reasoning_run.ndjson fixture. pi is now correctly treated like Codex (reasoning disjoint from output) in both distributed-tracing.md and the new docs/cli/run.md token_usage row. One new low-severity overstatement was introduced in the same passage while making that fix.

Findings

Low

  • [incorrect-api-claim] docs/guides/infrastructure/distributed-tracing.md:328 — The passage states cancelled Codex/pi runs have non-zero reasoning "whenever at least one turn (Codex) or assistant message (pi) finished before the run was cancelled." That doesn't follow: Codex's codexUsage.counters() copies reasoning_output_tokens from turn.completed as-is, and pi's accumulateAssistant sums usage.reasoning from message_end as-is — either can finish with reasoning at 0 (e.g., pi's own basic_run.ndjson fixture has reasoning: 0 on a completed assistant message). The later cost-formula guidance already correctly keys off non-zero reasoning, so this doesn't cause a billing error by itself — it's an overstated claim, not a formula bug.
    Remediation: Qualify the sentence so non-zero reasoning depends on the finished turn/message actually reporting reasoning tokens, e.g. "so reasoning is persisted there (and non-zero when that turn/message reported reasoning tokens)."

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (6)

Review

Both findings from the prior review (the "cancelled runs ⇒ 0" grouping at the old line 281, and the worked example's missing reasoning key at the old line 332) are fixed in the current text — verified against internal/runtime/claude_progress.go, codex_progress.go, and internal/cli/run.go. One new low-confidence claim from the prior revision has hardened into a confirmed inaccuracy in this revision and should be fixed before merge.

Findings

Medium

  • [incorrect-api-claim] docs/guides/infrastructure/distributed-tracing.md:334 — The guide states "For Claude and pi, output already includes reasoning tokens, so adding reasoning on top of output double-counts and overbills," and repeats this rule as a billing instruction later in the same section and in the new docs/cli/run.md token_usage row ("disjoint from output only for Codex"). This is correct for Claude — claude_progress.go's message_delta handling reads thinking_tokens out of usage.output_tokens_details, a breakdown nested inside output_tokens, and copies output_tokens through unmodified, so Claude's output genuinely already contains its reasoning tokens. It does not hold for pi. pi_progress.go's piUsage struct declares output and reasoning as sibling JSON fields with no subtraction between them, and the repo's own pi fixture confirms they are disjoint: internal/runtime/testdata/pi/reasoning_run.ndjson's final message_end event reports "input":200,"output":100,"reasoning":50,"totalTokens":300 — totalTokens equals input + output (200+100=300) and excludes reasoning entirely, which is only possible if pi's own output counter does not contain the 50 reasoning tokens. That fixture is documented as hand-authored to packages/coding-agent/docs/json.md (pi's real wire schema), not an arbitrary test value. This matches codex_progress.go's own comment, written by whoever implemented the Codex nested-counter conversion: "Claude Code and pi report cache and reasoning as counters disjoint from input/output (Anthropic's convention)." Following the doc's current instruction (do not add reasoning for pi) will therefore undercount the cost of every pi run with non-zero reasoning tokens — the exact billing-accuracy problem this new section exists to prevent.
    Remediation: Move pi out of the "already included in output, don't add" group and into the same treatment as Codex: for pi, reasoning is disjoint from output, so the fifth term (reasoning/1e6 * <reasoning rate>) should be added whenever token_usage.reasoning is non-zero on a pi run. Update both the prose in distributed-tracing.md and the docs/cli/run.md token_usage row ("disjoint from output only for Codex") to say pi as well.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (7)

Review

The three findings from the prior review (completed-only Codex reasoning wording, the docs/cli/run.md "reasoning when present" claim, and missing OpenCode coverage) are all fixed in the current text — verified against internal/runtime/codex_progress.go, internal/runtime/opencode_progress.go, and internal/cli/run.go. Two new low-severity inaccuracies were introduced in the same section while fixing those issues; both should be addressed before merge since they have concrete remediations.

Findings

Low

  • [incorrect-api-claim] docs/guides/infrastructure/distributed-tracing.md:281 — The intro states "When the runtime reports nothing (cancelled runs, or Codex, which sends no cost), the field stays 0," grouping all cancelled runs together with Codex. That holds for Claude (cost is copied only from the terminal ResultEvent; parseClaudeStream never synthesizes one on cancellation) and for Codex (codex_progress.go hardcodes TotalCostUSD: 0). It does not hold for pi: parsePiStream's finish() (internal/runtime/pi_progress.go) always emits a ResultEvent — including on incomplete/killed streams — carrying totalCostUSD accumulated from every assistant message's usage.cost.total seen before cancellation, and pi_run.go copies e.TotalCostUSD into metrics.TotalCostUSD unconditionally. A cancelled pi run that completed at least one assistant message before cancellation therefore persists a non-zero total_cost_usd, contradicting the universal "cancelled runs ⇒ 0" framing.
    Remediation: Scope the zero-cost-on-cancellation claim to Claude (no ResultEvent ever arrives) and Codex (cost hardcoded to 0 regardless of cancellation). For pi, note that a cancelled run can carry a non-zero total_cost_usd accumulated from messages that completed before cancellation.

  • [incorrect-api-claim] docs/guides/infrastructure/distributed-tracing.md:332 — The worked example's metrics.json JSON omits the reasoning key, justified as "reasoning is omitted here because it is typically zero on cancelled Claude and pi runs." This is inconsistent on two counts. First, this same document (and docs/cli/run.md's token_usage row) states metrics.json always includes reasoning (0 when there is none) — confirmed against aggregateMetrics.TokenUsage.Reasoning in internal/cli/run.go, which has no omitempty tag, so a real artifact would show "reasoning": 0, never an absent key. Second, grouping pi with Claude for "typically zero on cancellation" is inaccurate: pi's parser always synthesizes a ResultEvent at EOF/read-error — including on cancellation — carrying totalReasoning accumulated from every assistant message seen so far, so cancelled-pi reasoning is non-zero whenever at least one assistant message with reasoning finished before cancellation (the same shape the doc already documents for Codex, not Claude).
    Remediation: Add "reasoning": 0 to the example JSON so it matches the documented always-present serialization. Attribute the "typically zero on cancellation" behavior to Claude only, and either drop pi from that sentence or note that cancelled-pi reasoning depends on whether an assistant message finished before cancellation (same caveat already given for Codex).


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (8)

Review

Findings

Medium

  • [incorrect-cost-formula] docs/guides/infrastructure/distributed-tracing.md:358 — The fifth-term instruction still says to add reasoning/1e6 * <reasoning rate> only "For a completed Codex run" (line 358), and the section intro (line 289) still says reasoning "is recorded only on completed runs." That doesn't match how Codex telemetry is filled: parseCodexStream's finish() (internal/runtime/codex_progress.go) always emits a ResultEvent — including on incomplete/killed streams (subtype incomplete) — using the high-water counters snapshot accumulated from every turn.completed event observed before the interruption, and applyCodexMetrics copies that into metrics.json unconditionally. A cancelled Codex run that finished one or more turns before cancellation therefore has non-zero, output-disjoint reasoning tokens recorded in metrics.json — exactly the billing scenario this section exists for, since Codex never reports total_cost_usd regardless of cancellation. Following the completed-only wording together with the four-field cancelled-run worked example undercounts those tokens on a cancelled-but-progressed Codex run. (Claude's cancelled-run reasoning=0 framing, immediately preceding this passage, is correct and should not be conflated with Codex's behavior.)
    Remediation: Drop the completed-only qualifier for Codex specifically: state that Codex's reasoning counter is disjoint from output whenever the field is non-zero — completed or cancelled after at least one turn — so the fifth term applies to any Codex run with reasoning > 0, not only completed ones.

Low

  • [incorrect-api-claim] docs/cli/run.md:98 — The new token_usage row describes "Persisted disjoint token counts (input, output, cache_creation, cache_read, and reasoning when present)." Verified against aggregateMetrics.TokenUsage (internal/cli/run.go): the Reasoning field has no omitempty and is always serialized (0 when none) — "when present" actually describes the gen_ai.usage.reasoning_tokens span attribute's conditional-append behavior (agentSpanEndAttrs, if m.ReasoningTokens > 0), not the metrics.json field this row documents. Separately, calling all five fields uniformly "disjoint" contradicts the linked guide's own caveat that reasoning is disjoint from output only for Codex — for Claude and pi, output already includes reasoning.
    Remediation: Reword the row to describe the four always-disjoint counters plus reasoning (always present in metrics.json, 0 when none, disjoint-from-output only for Codex — see the linked guide for the per-runtime rule), rather than calling all five uniformly "disjoint" and reasoning conditionally "present."

  • [incomplete-runtime-coverage] docs/guides/infrastructure/distributed-tracing.md:361 — The add/don't-add reasoning rule names Codex vs. Claude and pi only, but this file's own "Runtime cost extraction" table also documents opencode as a supported runtime. internal/runtime/opencode_progress.go's parseOpenCodeStream copies tokens.input/output/reasoning straight through from the wire (ocStepTokens) into TokensEvent and the synthesized ResultEvent, with no subtraction step analogous to codexUsage.counters(). Whether OpenCode's own output field already nests reasoning (Claude/pi shape) or is disjoint (Codex shape) isn't established by the pass-through code alone. A reader computing contracted-rate cost for an OpenCode run has no stated rule to follow.
    Remediation: Name OpenCode explicitly in the add/don't-add paragraph: state the correct rule if the wire semantics are known, or note that OpenCode's reasoning/output relationship is unconfirmed and the reader should verify before applying either rule.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (9)

Review

Findings

Medium

  • [incorrect-cost-formula] docs/guides/infrastructure/distributed-tracing.md:349 — The completed-run guidance says to add a fifth reasoning/1e6 * <reasoning rate> term "for a completed run — especially Codex" because "the four-field formula alone will undercount whenever reasoning tokens are non-trivial." This is only true for Codex, whose codexUsage.counters() (internal/runtime/codex_progress.go) subtracts reasoning out of output (Output = nonNegative(OutputTokens - ReasoningOutputTokens)), making the two counters disjoint. For pi, the reasoning_run.ndjson fixture shows totalTokens 300 = input 200 + output 100 with reasoning: 50 as a subset of the 100 output tokens, copied through unmodified by internal/runtime/pi_progress.go. For Claude, internal/runtime/claude_progress.go sets totalOutput = md.Usage.OutputTokens directly from Anthropic's output_tokens (which already includes thinking tokens per output_tokens_details.thinking_tokens), with no subtraction. Following this doc's generally-worded instruction on a completed Claude or pi run would add the reasoning term on top of an output figure that already includes those tokens — double-counting reasoning cost and overbilling.
    Remediation: Scope the fifth-term instruction explicitly to Codex: Codex's reasoning counter is disjoint from output (completed Codex runs need the extra term), while Claude and pi already fold reasoning into output (adding it again double-counts for those runtimes). Don't phrase the guidance as applying to "a completed run" in general.

Low

  • [incorrect-api-claim] docs/guides/infrastructure/distributed-tracing.md:302 — The "Persisted token fields" table lists Reasoning as a peer row alongside the other four counters. In agentSpanEndAttrs (internal/cli/run.go), the other four gen_ai.usage.* span attributes are always attached (including when 0), but gen_ai.usage.reasoning_tokens is appended only if m.ReasoningTokens > 0 — it is entirely absent from the span when reasoning is zero, unlike the other four fields. metrics.json's token_usage.reasoning has no omitempty and is always serialized as 0 when absent. The doc doesn't note this asymmetry, which will mislead anyone filtering OTel spans on attribute presence.
    Remediation: Add a footnote to the Reasoning row: metrics.json always includes reasoning (0 when none); the span attribute is omitted entirely when 0, unlike the other four gen_ai.usage.* attributes.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (10)

Review

Findings

Medium

  • [inaccurate-claim] docs/guides/infrastructure/distributed-tracing.md:286 — The new "Computing dollar cost from token telemetry" section states it applies both to cancelled runs and to Codex ("When the runtime reports nothing (cancelled runs, or Codex, which sends no cost), the field stays 0. In both cases you can compute a dollar figure from the persisted token counts..."). However, the "Persisted token fields" table and the worked example price only four fields (input, output, cache_creation, cache_read) — token_usage.reasoning / gen_ai.usage.reasoning_tokens is omitted from the priced computation entirely. The doc mentions reasoning only afterward, framed narrowly as "typically zero ... on cancelled Claude runs." For a live/completed Codex run — one of the doc's own stated audiences, since Codex never reports total_cost_usd regardless of cancellation — reasoning tokens are a genuine, separate, often-large counter (internal/runtime/codex_progress.go's codexUsage.counters() derives Reasoning = ReasoningOutputTokens as a disjoint counter, distinct from Output, which has reasoning already subtracted out). A Codex user following this guide's four-field formula would systematically undercount cost whenever reasoning tokens are non-trivial.
    Remediation: Add a fifth row to the "Persisted token fields" table for Reasoning (token_usage.reasoning / gen_ai.usage.reasoning_tokens), and either include it in the worked-example formula with a rate placeholder, or explicitly scope the worked example/formula to "cancelled runs where reasoning is typically zero" with a distinct caveat that Codex/live runs must also price reasoning tokens.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:36 PM UTC · Completed 12:42 PM UTC

Commit: a24c77a · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.64

fullsend-ai-coder Bot added a commit that referenced this pull request Sep 11, 2026
Addresses review feedback on PR #7232: the worked example priced only
four token fields and implied that formula covered both cancelled runs
and Codex. Codex counts reasoning tokens separately from output, so a
Codex user following the four-field formula would undercount cost.

Adds a Reasoning row to the persisted-token-fields table, scopes the
worked example explicitly to cancelled runs (where reasoning is
typically zero), and adds an explicit caveat that completed/Codex runs
must add a fifth term for reasoning tokens or the formula undercounts.

Addresses #7232
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Fixed the reviewer's single medium-severity finding: the token-telemetry cost guide implied its four-field formula applied to both cancelled runs and Codex, but Codex reports reasoning tokens as a fifth, disjoint counter not covered by the formula. Added a Reasoning table row, clarified the disjointness for Codex, scoped the worked example to cancelled runs, and added an explicit caveat/formula term for completed and Codex runs.

Fixed (1):

  1. inaccurate-claim: worked example/formula for computing dollar cost from token telemetry omits reasoning tokens, which are disjoint from output for Codex and would cause undercounting on live/completed Codex runs (docs/guides/infrastructure/distributed-tracing.md): Added a Reasoning row (token_usage.reasoning / gen_ai.usage.reasoning_tokens) to the 'Persisted token fields' table, clarified in the intro paragraph that reasoning is disjoint from output for Codex, scoped the worked example explicitly to cancelled runs (where reasoning is typically zero) instead of implying universal applicability, and added an explicit caveat/formula term instructing that completed and Codex runs must price a fifth reasoning term or the four-field formula will undercount. Verified the underlying claim against internal/runtime/codex_progress.go, where codexUsage.counters() computes Output as OutputTokens minus ReasoningOutputTokens, confirming reasoning is a separate, disjoint counter for Codex.

Tests: passed

Decision points
  • Chose to scope the worked example to cancelled runs plus an explicit follow-up caveat, rather than rewriting the worked example itself to include a fifth priced reasoning line (alternatives: Rewrite the JSON example and formula to include a nonzero reasoning value and price it as a fifth term, Scope the existing cancelled-run example as-is and add a clear caveat/formula extension for completed and Codex runs; rationale: The existing example's 'reasoning is typically zero on cancelled runs' framing is accurate and useful; rewriting it to inject an arbitrary nonzero reasoning value would require fabricating a scenario not represented by the docs' own cancelled-run framing. Explicitly scoping the example and adding a distinct caveat with the formula extension keeps the fix minimal while fully resolving the inaccuracy the reviewer flagged (the sole remediation option offered by the reviewer).)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:44 PM UTC · Completed 12:57 PM UTC

Commit: ee7aee9 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $3.07

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:59 PM UTC · Completed 1:06 PM UTC

Commit: ee7aee9 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.93

fullsend-ai-coder Bot added a commit that referenced this pull request Sep 11, 2026
…metry

Address fullsend-ai-review findings on PR #7232:

- The completed-run cost guidance told readers to add a fifth
  reasoning/1e6 term generally, calling out Codex only as an example.
  For Codex, output excludes reasoning tokens (codexUsage.counters
  subtracts them), so the extra term is required. For Claude and pi,
  output already includes reasoning tokens (Claude copies
  output_tokens verbatim, which Anthropic already folds thinking
  tokens into; pi's message_end usage shows reasoning as a subset of
  output), so adding the term on top double-counts and overbills.
  Reworded both the caveat and the worked-example guidance to scope
  the fifth term to Codex explicitly and warn against it for
  Claude/pi.
- The "Persisted token fields" table listed Reasoning as a peer row
  without noting that its span attribute is omitted entirely when
  zero (agentSpanEndAttrs in internal/cli/run.go only appends
  gen_ai.usage.reasoning_tokens when greater than zero), unlike the
  other four gen_ai.usage attributes which are always attached. Added
  a footnote clarifying metrics.json always includes reasoning (0
  when none) while the span attribute does not.

Addresses #7232
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 2 (bot-triggered)

Fixed both review findings in docs/guides/infrastructure/distributed-tracing.md: scoped the fifth reasoning-token cost term to Codex only (Claude/pi already fold reasoning into output, so adding it there double-counts), and added a footnote documenting that the reasoning span attribute is omitted when zero while metrics.json always includes it. Verified both claims directly against internal/runtime/{codex,pi,claude}_progress.go, the pi reasoning_run.ndjson fixture, and agentSpanEndAttrs in internal/cli/run.go before editing.

Fixed (2):

  1. incorrect-cost-formula: fifth reasoning term guidance applies to Codex only, not all completed runs (docs/guides/infrastructure/distributed-tracing.md): Verified against internal/runtime/codex_progress.go (Output = OutputTokens - ReasoningOutputTokens, disjoint), internal/runtime/pi_progress.go plus testdata/pi/reasoning_run.ndjson (reasoning is a subset of output, e.g. totalTokens 300 = input 200 + output 100 with reasoning 50 inside the 100), and internal/runtime/claude_progress.go (totalOutput copies Anthropic's output_tokens directly, which already folds in thinking tokens). Reworded the completed-run caveat (previously 'For completed runs — Codex in particular') and the worked-example fifth-term guidance (previously 'For a completed run — especially Codex') to state the fifth reasoning/1e6 term is needed only for Codex, and explicitly warn that adding it for Claude or pi double-counts and overbills.
  2. incorrect-api-claim: Persisted token fields table omits the reasoning span-attribute presence asymmetry (docs/guides/infrastructure/distributed-tracing.md): Verified agentSpanEndAttrs in internal/cli/run.go: the four gen_ai.usage.* attributes (input/output/cache_creation/cache_read) are always attached, but gen_ai.usage.reasoning_tokens is appended only when m.ReasoningTokens > 0, while metrics.json's token_usage.reasoning field has no omitempty and is always serialized (0 when absent). Added a footnote directly under the Persisted token fields table documenting this asymmetry and warning against relying on span attribute presence/absence when filtering.

Tests: passed

Decision points
  • Left docs/cli/run.md's 'reasoning when present' phrasing for the token_usage CLI reference row unchanged (alternatives: Also reword the CLI reference row for full consistency with the corrected asymmetry explanation, Leave it untouched since neither review finding referenced that file/line; rationale: Both review findings pointed specifically at docs/guides/infrastructure/distributed-tracing.md (lines 302 and 349); the CLI reference row in docs/cli/run.md was not flagged, so changing it would exceed the review's scope.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:08 PM UTC · Completed 1:22 PM UTC

Commit: aa12f76 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $3.44

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 1:23 PM UTC · Completed 1:31 PM UTC

Commit: aa12f76 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $1.40

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 3 (bot-triggered)

Fixed all three review findings on PR #7232 by reworking the Codex reasoning-token guidance in docs/guides/infrastructure/distributed-tracing.md to key off 'reasoning > 0' rather than 'completed run' (verified Codex's finish() emits ResultEvent with high-water reasoning counters even on killed/interrupted streams), adding an explicit OpenCode caveat noting its output/reasoning disjointness is unconfirmed, and rewording the docs/cli/run.md token_usage row so it no longer calls all five persisted fields uniformly disjoint.

Fixed (3):

  1. incorrect-cost-formula: fifth-term reasoning instruction scoped to "completed Codex run" only, undercounting cancelled-but-progressed Codex runs (docs/guides/infrastructure/distributed-tracing.md): Verified against internal/runtime/codex_progress.go: finish() always emits a ResultEvent (including on killed/interrupted streams, Subtype=incomplete) built from the high-water counters accumulated from every turn.completed event observed before interruption, and applyCodexMetrics copies ReasoningTokens through unconditionally. Reworded the section intro, the per-runtime caveat paragraph, and the worked-example addendum to key the Codex reasoning guidance off "reasoning > 0" (completed or cancelled after at least one turn) instead of "completed run", and tightened the worked-example's cross-reference to the Codex exception.
  2. incorrect-api-claim: docs/cli/run.md token_usage row calls all five fields uniformly "disjoint" and reasoning conditionally "present" (docs/cli/run.md): Verified against internal/cli/run.go: TokenUsage.Reasoning has no omitempty and is always serialized (0 when none); the "when present" behavior actually describes the gen_ai.usage.reasoning_tokens span attribute, not this metrics.json field. Reworded the row to state the four always-disjoint counters plus reasoning (always present, 0 when none, disjoint from output only for Codex), pointing to the linked guide for the per-runtime rule instead of calling all five uniformly disjoint.
  3. incomplete-runtime-coverage: add/don't-add reasoning rule names Codex vs. Claude and pi only, omitting OpenCode which the same doc's runtime table documents as supported (docs/guides/infrastructure/distributed-tracing.md): Verified against internal/runtime/opencode_progress.go: parseOpenCodeStream copies tokens.input/output/reasoning straight through from ocStepTokens into TokensEvent and the synthesized ResultEvent with no subtraction step analogous to codexUsage.counters(), so whether OpenCode's output already nests reasoning (Claude/pi shape) or is disjoint (Codex shape) isn't established by the code alone. Added an explicit OpenCode paragraph to the worked-example addendum stating this is unconfirmed and instructing readers to verify against actual output/reasoning values before applying either rule.

Tests: passed

Strategy change: Iteration 3 continued directly fixing the specific wording flagged in this round's review rather than re-approaching the whole section, since each of the three findings pointed at a narrow, independently verifiable factual claim rather than a structural problem with the guide.

Decision points
  • Also tightened a worked-example cross-reference sentence ("see the caveat above for completed and Codex runs") that wasn't explicitly quoted by the reviewer (alternatives: Leave the sentence as-is, touching only the exact lines the review cited, Update the sentence's wording to stay consistent with the corrected completed/cancelled framing introduced by the other edits; rationale: The sentence sits one paragraph below the corrected per-runtime caveat and referenced 'completed and Codex runs' as the exception carve-out; left unchanged it would contradict the newly-added statement that cancelled Codex runs can also have non-zero reasoning. This is the same root-cause finding (incorrect-cost-formula), not a separate scope expansion.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

fullsend-ai-coder Bot added a commit that referenced this pull request Sep 11, 2026
…d-only

Address review feedback on PR #7232: the cost-from-telemetry guide and
CLI reference tied Codex's reasoning-token handling to "completed"
runs, but Codex's stream parser synthesizes a ResultEvent from
high-water counters on every stream, including killed/interrupted
ones, so a cancelled Codex run with at least one finished turn can
carry non-zero, output-disjoint reasoning tokens too. Reworded the
intro, the per-runtime caveat, and the worked-example addendum in
docs/guides/infrastructure/distributed-tracing.md to key off
"reasoning > 0" rather than "completed", and to name OpenCode
explicitly as an unconfirmed case since its parser passes reasoning
through without the Codex-style subtraction. Also reworded the
docs/cli/run.md token_usage row so it no longer calls all five fields
uniformly disjoint, since reasoning is disjoint from output only for
Codex.

Addresses #7232
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:34 PM UTC · Completed 1:47 PM UTC

Commit: 27ad8ba · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $3.92

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 1:49 PM UTC · Completed 1:55 PM UTC

Commit: 27ad8ba · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.73

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 4 (bot-triggered)

Fixed both low-severity findings from the latest review: scoped the cancelled-run zero-cost claim to Claude and Codex (excluding pi, which can carry non-zero cost/reasoning after cancellation), and added the missing reasoning field to the worked example's metrics.json with corrected prose attribution.

Fixed (2):

  1. distributed-tracing.md:281 groups pi with Claude/Codex as always reporting zero cost on cancellation, but pi's parser always synthesizes a ResultEvent (even on cancellation) carrying accumulated total_cost_usd from completed assistant messages (docs/guides/infrastructure/distributed-tracing.md): Rewrote the section intro to state the zero-cost-on-cancellation claim only for Claude (no ResultEvent ever arrives) and Codex (cost hardcoded to 0), and added an explicit note that a cancelled pi run can persist a non-zero total_cost_usd if at least one assistant message completed before cancellation.
  2. distributed-tracing.md:332 worked example's metrics.json omits the reasoning key, contradicting the doc's own claim that reasoning is always serialized (0 when absent), and groups pi with Claude for 'typically zero on cancellation' (docs/guides/infrastructure/distributed-tracing.md): Added "reasoning": 0 to the example metrics.json so it matches the documented always-present serialization, and reworded the surrounding sentence to attribute the 'typically zero on cancellation' behavior to Claude only, noting cancelled pi runs can carry non-zero reasoning depending on whether an assistant message finished before cancellation.

Tests: passed

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review October 23, 2026 11:21

Superseded by updated review

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment component/docs User-facing documentation labels Oct 23, 2026
@ascerra
ascerra marked this pull request as ready for review October 23, 2026 11:54
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Document estimating inference cost from token telemetry

📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Explain how to price persisted token counts when runtime-reported cost is zero or differs from
 contracted rates.
• Provide an OTLP extraction command and worked example covering cache and reasoning tokens.
• Link the guidance from CLI metrics, MLflow tracing, and Codex runtime documentation.
Diagram

graph TD
  R["Agent runtime"] --> T[("Agent spans")] --> X["Extract tokens"] --> P["Price per model"] --> C["Cost estimate"]
  R --> M[("Metrics JSON")] -->|"fallback"| X
  K["Contract rates"] --> P
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Calculate estimates in Fullsend
  • ➕ Automates estimates across runs and reporting surfaces.
  • ➖ Requires maintaining prices and contract-specific rules.
  • ➖ Could imply incomplete estimates are authoritative billing figures.

Recommendation: Keep contracted-rate pricing in user guidance rather than adding a built-in pricing table. This preserves the existing runtime-reported cost contract while giving users a way to estimate charges from available telemetry.

Files changed (4) +155 / -7

Documentation (4) +155 / -7
run.mdClarify run-level token usage in metrics.json +1/-0

Clarify run-level token usage in metrics.json

• Documents the serialized token counters, runtime differences in reasoning counts, and the limits of zero reported cost. Directs readers to per-iteration telemetry for pricing.

docs/cli/run.md

distributed-tracing.mdAdd contracted-rate pricing guide for token telemetry +142/-2

Add contracted-rate pricing guide for token telemetry

• Adds an OTLP JSONL extraction command, a worked Codex estimate, and guidance on cache and reasoning-token pricing. Explains interrupted-run gaps, fallback to metrics.json, mixed-model attribution limits, and why reported cost may remain zero.

docs/guides/infrastructure/distributed-tracing.md

tracing-with-mlflow.mdLink MLflow cost caveat to token-pricing guidance +4/-1

Link MLflow cost caveat to token-pricing guidance

• Points readers to the new guide when runtime-reported cost is zero or contracted-rate pricing is needed.

docs/guides/user/tracing-with-mlflow.md

codex.mdClarify Codex zero-cost reporting and pricing path +8/-4

Clarify Codex zero-cost reporting and pricing path

• Clarifies that Codex records zero dollar cost because its event stream has no cost field, while token usage is recorded separately. Links to the contracted-rate guide, including its treatment of reasoning tokens.

docs/runtimes/codex.md

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 11:56 AM UTC · Ended 12:01 PM UTC

Commit: 9578a45 · View workflow run →

@ascerra

ascerra commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

/fs-fix I believe this statement is wrong "Use run-telemetry.jsonl as the primary source for a contracted-rate
estimate." This isn't the real contracted-rate it will be the list price make that clear. As of right now there is no support of configuring and calculating your specific contracted-rate

@fullsend-ai-coder

fullsend-ai-coder Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:00 PM UTC · Completed 12:03 PM UTC

Commit: 9578a45 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.27

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review October 23, 2026 12:01

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed requires-manual-review Review requires human judgment labels Oct 23, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:56 AM UTC · Completed 12:01 PM UTC

Commit: 9578a45 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.76

Fullsend does not support configuring or calculating a contracted rate,
so the token-telemetry cost procedure yields a list-price estimate.
Reword the contracted-rate language in the tracing, MLflow, and Codex
docs accordingly.

Note: pre-commit hooks and lychee link check could not run (sandbox
network/exec restrictions). No links or anchors were changed.

Addresses #7232

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Clarified that the token-telemetry cost procedure gives a list-price estimate, not a contracted rate, and that contracted-rate configuration is not supported. Applied consistently across the three docs that referenced it. Pre-commit and lychee could not run in the sandbox; no links or anchors were changed.

Fixed (2):

  1. Statement that run-telemetry.jsonl is the source for a contracted-rate estimate is wrong; it yields a list-price estimate and contracted rates are not supported (docs/guides/infrastructure/distributed-tracing.md): Reworded to say the procedure produces a list-price estimate, and that fullsend does not yet support configuring or calculating a contracted rate. Also changed the related example rates and surrounding wording to list price, with a note that actual charges differ under a contract.
  2. Other docs repeated the contracted-rate framing (docs/guides/user/tracing-with-mlflow.md): Changed 'contracted-rate figure' to 'list-price figure'; same change for the cross-reference in docs/runtimes/codex.md.

Tests: passed

CI inspections (6):

  1. test (passing, success)
  2. web (passing, success)
  3. commit-lint (passing, success)
  4. build (passing, success)
  5. codecov/patch (passing, success)
  6. DCO (passing, success)

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:05 PM UTC · Completed 12:25 PM UTC

Commit: 2a769e0 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.67

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Oct 23, 2026
Comment thread docs/guides/infrastructure/distributed-tracing.md
Comment thread docs/guides/infrastructure/distributed-tracing.md
@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review October 23, 2026 12:25

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Oct 23, 2026
@ascerra
ascerra added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 3f45556 Oct 23, 2026
63 checks passed
@ascerra
ascerra deleted the agent/7230-token-cost-telemetry branch October 23, 2026 16:11

This branch was successfully deployed

2 active deployments
site-preview — 2a769e09 Deployed Oct 23, 2026 by github-actions[bot]
dev — 2a769e09 Deployed Oct 23, 2026 by fullsend-ai-coder[bot] via behaviour #17751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation needs-human Agent loop needs human intervention ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how users compute dollar cost from persisted token telemetry

1 participant