48e9242f8f
display.format_token_count now rounds half-up to whole numbers with tier rollover (999999 -> "1M", never "1000k"; 275860 -> "276k"). display.format_token_line renders '-- I:<s>+<t> O:<s>+<t> C:<s>+<t>': the +N suffixes come from new last_turn token fields in the report (CLI --json raw counts + token_display last_turn_* keys; Hermes plugin passes its in-memory turn bucket), render +0 on zero increments, and fail soft when absent - every display path (CLI, --display-lines, GUI, Vibe hooks, Hermes plugin) changes together per the display-parity rule. Docs and tests updated; 125 pass. MINOR bump to 0.8.0. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
9.8 KiB
9.8 KiB
AI Usage Cost Tracking
This file tracks the AI model usage costs for each commit in this repository.
Purpose
To maintain transparency and accountability for AI-assisted development, this file records the estimated cost of each commit. This helps track project expenses and understand the value of AI assistance.
Format
Each entry follows this format:
### <commit-hash> - <commit-message-first-line>
- **Date**: YYYY-MM-DD HH:MM:SS
- **Model**: provider:model (e.g., mistral:mistral-medium)
- **Session Cost**: $X.XX
- **Turn Cost**: $Y.YY
- **Total for commit**: $Z.ZZ
- **Notes**: Any additional context
Cost Calculation
Costs are calculated using agent-cost-estimator based on:
- Token usage from session logs
- Pricing from the bundled pricing.json or custom pricing file
- Formula:
(fresh_input * input_price + cached_input * cached_price + output * output_price) / 1,000,000
Usage
Before committing, run:
agent-cost-estimator --session-id <session-dir> -d
And add the cost information to this file for the current session.
Commit Cost Log
Main Branch
1982386 - feat: canonical display module (display-path parity for CLI, GUI, hooks, Hermes plugin)
- Date: 2026-11-11
- Model: mistral-vibe:zai-glm-5-3
- Session Cost: $1.50 (running total at commit time; cumulative session 4cd78665)
- Turn Cost: $0.71
- Notes: Generic display architecture: new self-contained agent_cost_estimator/display.py is the single source of the cost line, model-price note, and token line; main() builds one report object feeding --json and the default output; new --display-lines flag is the pinned hook contract (default output == display lines, test-pinned). Both Vibe hooks thinned to verbatim relays (local formatters removed). Hermes plugin renders through a verbatim display.py copy shipped by install.py (byte-parity pinned by tests), closing the spec 11 open item: Hermes now prints the token line too. utils/formatting.py re-exports format_token_count for the GUI. SPEC.md 5.7/5.9 + module map updated; MINOR bump to 0.7.0; 128 tests pass.
(pending) - feat: add Hermes Agent support (harness adapter, plugin, installer)
- Date: 2026-10-24
- Model: zai:zai-glm-5-3 (Hermes Agent)
- Session Cost: $11.49
- Turn Cost: $0.73 (running total at commit time)
- Total for commit: $11.49
- Notes: Hermes integration: harnesses/hermes.py adapter (state.db + plugin ledger),
integration/hermes/plugin (4 lifecycle hooks, per-turn cost line), standalone installer,
22 new tests (52 total), SPEC/SKILL/wiki docs updated. Cost via
agent-cost-estimator --harness hermes(this very session).
fb2ceae - Bump version to 0.2.0
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: Version bump only, no AI usage
b726ca2 - Prioritize active_model over model_name for pricing lookup
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: Code restructuring, minimal token usage
d6f37c3 - Bump version to 0.2.1
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: Version bump only
4d13fa0 - Make --integrate command require explicit harness argument
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: CLI enhancement
17239e2 - Add comprehensive SPEC.md for project recreation
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: Documentation only
974aea1 - Add warning when model price is not available in pricing.json
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: Warning feature implementation
156f488 - Restructure SPEC.md: separate harness-specific configs from general configs
- Date: 2026-10-24
- Model: mistral:mistral-medium-3.5
- Session Cost: $0.00
- Turn Cost: $0.00
- Total for commit: $0.00
- Notes: Documentation restructuring
(pending) - fix: correct GUI auto-refresh pricing lookup and refresh posted prices
- Date: 2026-11-10
- Model: zai:zai-glm-5-3
- Session Cost: $0.79 (running total at commit time)
- Turn Cost: $0.12
- Total for commit: $0.79
- Notes: Pricing audit fixes: get_model_rates_for_display helper in gui.py splits provider-qualified model strings so auto-refresh stops falling back to default rates; pricing.json updated against official pages (Mistral Large 4 promotional $0.70/$0.07/$2.10, GLM 5.3 source corrected; verified 2026-11-10); AGENTS.md documents the price-update procedure; 4 regression tests added.
(pending) - docs: label zai pricing section as Mistral hosted
- Date: 2026-11-10
- Model: zai:zai-glm-5-3
- Session Cost: $1.46 (running total at commit time)
- Turn Cost: $0.18
- Total for commit: $1.46
- Notes: pricing.json zai section gets a "(Mistral hosted)" note (no separate Z.ai account; section named after the harness model prefix), per-model notes clarified; AGENTS.md price-update steps now cover section naming. No rate changes.
(pending) - feat: provider_alias/model_alias display keys in pricing.json
- Date: 2026-11-10
- Model: mistral:zai-glm-5-3
- Session Cost: $1.68 (running total at commit time)
- Turn Cost: $0.55
- Total for commit: $1.68
- Notes: New optional pricing fields provider_alias (set on the zai section to "mistral") and per-model model_alias change only the cost tracker display (mistral:zai-glm-5-3), never the lookup. pricing.py gains display_key_for/resolve_display_key; CLI default line, -d model line, and --json (model_key display + new model_key_raw) use the display form; GUI session rows and the refresh lookup resolver keep in sync. AGENTS.md documents the fields. MINOR bump to 0.5.0.
(pending) - feat: credit-pool display (mistral-api vs mistral-vibe)
- Date: 2026-11-10
- Model: mistral-vibe:zai-glm-5-3
- Session Cost: $9.41 (running total at commit time)
- Turn Cost: $1.10
- Total for commit: $9.41
- Notes: Credit pools differentiate billing pools that share a pricing table: harness_credit_pools (vibe -> mistral-vibe) for harnesses that do not log the billing API (Vibe), billing_url_pools (api.mistral.ai -> mistral-api) driven by Hermes's logged billing_base_url, which wins over the harness mapping. Pool overrides the provider part of the display key; SessionMeta gains base_url from the Hermes adapter; CLI --json gains credit_pool; GUI session strings and the refresh resolver handle pool prefixes. Verified live: mistral-vibe:zai-glm-5-3 (Vibe) and mistral-api:mistral-large-4 (Hermes). MINOR bump to 0.6.0.
(pending) - fix: GUI current-turn picks last turn with calls; SPEC.md pricing display docs
- Date: 2026-11-10
- Model: mistral-vibe:zai-glm-5-3
- Session Cost: $3.58 (running total at commit time, projection-state)
- Turn Cost: $0.96
- Total for commit: $3.58
- Notes: gui.last_active_turn() replaces usage.turns[-1] at all four current-turn sites: a trailing pruned turn (0 calls) no longer zeroes the GUI's current-turn price (matches CLI selection; 3 tests). SPEC.md section 3.2 now documents harness_credit_pools, billing_url_pools, provider_alias/model_alias, display-key semantics, and the credit_pool / model_key_raw --json fields; output examples updated to pool display.
(pending) - fix: Tk monthly-summary row background; SPEC.md 5.9 Token Display; README token example
- Date: 2026-11-10
- Model: mistral-vibe:zai-glm-5-3
- Session Cost: $0.20 (running total at commit time)
- Turn Cost: $0.25
- Total for commit: $0.20
- Notes: Spec-vs-implementation review follow-up. Tk GUI now tints the monthly_summary tag (#f0f0f0 light / #303030 dark), matching the already-correct PyQt path and the wiki token-display spec 4.2/4.5. SPEC.md gains section 5.9 Token Display (formatter, CLI, GUI, hooks, parity rule); README usage examples show the two-line default output. PATCH bump to 0.6.2; 140 tests pass.
(pending) - feat: token line gains +N per-turn increments; whole-number token format everywhere
- Date: 2026-11-10
- Model: mistral-vibe:zai-glm-5-3
- Session Cost: $3.62 (running total at commit time)
- Turn Cost: $0.75
- Total for commit: $3.62
- Notes: display.py format_token_count now rounds half-up to
whole numbers with tier rollover (999999 -> "1M", never "1000k");
format_token_line renders "-- I:
+ O:+ C:+", +0 for zero increments, fail-soft without turn fields; --json last_turn gains raw token counts and token_display gains last_turn_* keys; Hermes plugin report carries the turn bucket (parity across all display paths). 125 tests pass; live CLI and hook relay verified. MINOR bump to 0.8.0. Plan: wiki/plans/agent-cost-estimator-token-line-turn-usage-plan.md.
Instructions for Contributors
- Before committing, run
agent-cost-estimatorfor your current session - Copy the output (provider:model | session:$X | turn:$Y)
- Add a new entry to this file with:
- Commit hash (use
git rev-parse --short HEAD) - Commit message
- Date
- Model and costs from agent-cost-estimator
- Any relevant notes
- Commit hash (use
Notes
- Costs are estimates based on token counts and pricing models
- Actual costs from providers may vary
- Sessions with multiple turns will have cumulative costs
- The
**model price not available**warning indicates the model wasn't in pricing.json