Repository navigation
Fix pricing file not included in pip wheel - #17
Merged
Merged
Conversation
Move pricing/models.toml into ocw/pricing/ so it's packaged in the wheel. Update path in pricing.py from parent.parent.parent (repo root) to parent.parent (package root). Fixes CostEngine "No such file" error when installed via pip. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This was referenced May 28, 2026
anilmurty
added a commit
that referenced
this pull request
Jun 19, 2026
#17: surface cache_write_tokens so cost reconciles from shown tokens
HoomanDgtl
pushed a commit
to HoomanDigital/tokenjam
that referenced
this pull request
Jun 20, 2026
…om shown tokens
On cache-heavy Opus traffic, cache-write is ~91% of cost but was invisible
above the DB — the traces API omitted the field and the UI/tj cost never showed
cache tokens, so a displayed cost couldn't be derived from its own columns
(a trust problem for a cost tool).
- traces API (_span_to_dict) now returns cache_write_tokens alongside
cache_tokens (read).
- UI trace-detail panel + waterfall tooltip render Cache read + Cache write.
- CostRow + get_cost_summary sum cache-read and cache-write; /api/v1/cost rows
carry both + window totals; the UI Cost table and
TOKENS TOKENS
DATE AGENT MODEL IN OUT CACHE R CACHE W COST
──────────────────────────────────────────────────────────────────────────────
2026-06… - - 128.3k 1.1M 494.6M 0 $358.26…
2026-06… - - 172.4k 1.6M 483.9M 2.8M $361.65…
2026-06… - - 5.5k 682.1k 395.7M 36.9k $274.00…
2026-06… - - 125 66.9k 38.5M 0 $47.9370
2026-06… - - 635 180.7k 99.6M 0 $85.3886
2026-06… - - 366 164.5k 65.7M 0 $66.3781
2026-06… - - 45 30.8k 27.3M 0 $21.3287
307.4k 3.8M 1605.2M 2.9M $1214.9…
table gain
CACHE R / CACHE W columns (tool grouping stays cost-only — no token dimension).
Tests: trace detail + /cost expose cache-write (the reporter's exact span
reconciles); UI guard for the rendered fields. Suite green; ruff/mypy clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
anilmurty
pushed a commit
that referenced
this pull request
Jul 2, 2026
…lar (#17) claimed "no UI change needed," but two dollar-bearing cells in the served SPA still called bare `fmtCost(...)`. For a Max-subscription user (framing.display_rule = suppress_dollars_for_subscription_share) this leaked raw dollars: the session-detail "Cost & Tokens" / "Implied API value" panel rendered e.g. "$198.9709" (and "$0.0000" on empty sessions), and the Status "Archived sessions" table cost column showed raw "$0.0000". The panel only relabeled the header for subscription users while still emitting the raw figure — the exact honesty leak #191/#2 exist to prevent. Both cells now route through the existing `fmtFramedDollar(value, framing)` helper, matching how Traces/Cost/Optimize/Analytics render: subscription users see token-share ("% of cycle"), local sees "—", and only api/unknown plans see raw "$". The `framing` block is already in scope in both views — SessionDetailView reads `data.framing` off /sessions/{id}; the Status view reads `data.framing` off /status (already consumed by the agent cards' "Cost today" cell). No backend change needed. Guarded by two new static-grep regressions in tests/unit/test_lens_ui_regression.py asserting the bare-fmtCost patterns are gone and the framed forms are present (there is no JS runner in the Python CI job; the served source is the unit under test). Co-Authored-By: Claude <[email protected]>
anilmurty
added a commit
that referenced
this pull request
Aug 12, 2026
…ork (#717) Four source comments cited #17 ("Fix pricing file not included in pip wheel") for cache-write-token visibility work, which #17 does not document. Per Critical Rule 23 in CLAUDE.md, describe the thing plainly rather than cite a number that doesn't match. Closes #594 Co-authored-by: Anil Murty <[email protected]>
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.
Summary
pricing/models.tomllives at the repo root, outside theocw/package. The wheel only includesocw/, sopip install openclawwatchresults in:All costs show
$0.000000.Fix: Copy
models.tomlintoocw/pricing/(inside the package) and update the path inpricing.py. The originalpricing/at repo root is kept for reference.Test plan
python3 -c "from ocw.core.pricing import load_pricing_table; print(load_pricing_table())"workspip install --upgrade openclawwatch && python3 -c "from ocw.core.pricing import load_pricing_table; print('ok')"succeeds🤖 Generated with Claude Code