Skip to content

docs(claude): correct the synthetic-placeholder guard's stated failure mode - #1057

Merged
junhoyeo merged 3 commits into
mainfrom
docs/claude-synthetic-comment-accuracy
Aug 6, 2026
Merged

junhoyeo merged 3 commits into
mainfrom
docs/claude-synthetic-comment-accuracy

Conversation

@junhoyeo

@junhoyeo junhoyeo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Comment-only. The <synthetic> guard in extract_claude_tool_result_message (added in #1045) documents its failure mode as:

the placeholder becomes a model_id carrying a char-based estimate and submission fails with "pricing is unavailable for submitted token usage"

That was accurate when #1045 was written, but #1053 landed first and replaced the whole-batch abort with per-model exclusion. An unguarded unknown/<synthetic> row is now dropped with a warning while the rest of the batch submits.

The consequence inverts, which is the part worth recording: the guard matters more now, because a regression in it no longer announces itself — the fabricated usage just disappears from the leaderboard.

Tests

No behavior change. cargo fmt --all --check clean, cargo build -p tokscale-core clean.


Summary by cubic

Updated the <synthetic> guard comment in extract_claude_tool_result_message. It now notes per-model exclusion with a warning when pricing is loaded, full submission failure when none is loaded, and that allow_char_estimate: false drops text-only results; also fixed a stale test comment.

Written for commit 137d06a. Summary will update on new commits.

Review in cubic

…e mode

The comment said an unguarded `<synthetic>` carrier makes submission fail
with "pricing is unavailable for submitted token usage". #1053 replaced
that abort with per-model exclusion, so the fabricated row is now dropped
with a warning while the rest submits.

The consequence inverts: the guard matters more, because a regression in
it no longer announces itself.

Confidence: high
Scope-risk: narrow
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tokscale Ignored Ignored Preview Aug 6, 2026 11:19pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

…ing it

The first pass replaced one inaccurate claim with three more, all found in
adversarial review:

- "excluded with a warning and the rest is submitted" ignored #1055: with no
  pricing dataset loaded at all, require_trustworthy_exclusions fails the
  submission rather than excluding anything.
- "carrying a char-based estimate" no longer describes production. #1037 set
  allow_char_estimate: false for Claude transcripts, so the extractor returns
  None and a text-only tool result is dropped for zero usage. Only explicit
  tool-result token metadata can reach the model-inheritance branch.
- "invisible in normal use" overstated it. The CLI prints a named exclusion
  warning, and a batch left with nothing prints "No usage data found to
  submit" and performs no HTTP submission.

Also fixes the opposite stale claim left in the same file, where a test still
said submission "rejects" the escaped usage.

Confidence: high
Scope-risk: narrow
Directive: this comment describes behavior owned by lib.rs, not this file —
re-check it against the submission path when either changes
@junhoyeo
junhoyeo merged commit 2e49fb0 into main Aug 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant