Skip to content

v1.3.173

Choose a tag to compare

@topcheer topcheer released this 22 Jul 16:56

ggcode v1.3.173

Highlights

  • New ggcode report subcommand: Interactive HTML analytics dashboard for session data — overview, daily details, per-turn breakdowns, and performance metrics with embedded Chart.js (fully offline).
  • Token usage source tracking: All LLM token consumption (agent, strategist, verify, ratchet, subagent) now categorized by source in session JSONL, making previously invisible usage visible.
  • Session analytics dashboard: Date range filters, workspace filters, draggable turn range slider, grouped bar charts with dual Y-axis, and cumulative token tracking.

New Features

ggcode report Subcommand

Standalone session analytics tool that scans ~/.ggcode/sessions/*.jsonl and generates a self-contained HTML report with embedded Chart.js.

  • Overview tab: Summary cards, daily token trend, workspace distribution pie chart, tool call summary, and date range filter
  • Daily Details tab: Per-model token usage (grouped bars, dual Y-axis) and per-model TTFT/Duration comparison — drill into any day from the overview chart
  • Sessions tab: Sortable table with workspace and date range filters, click-through to session detail
  • Session Detail tab: Draggable dual-handle turn range slider, per-turn token grouped bars, TTFT comparison line chart, tool statistics
  • Performance tab: TTFT histogram (P50/P95/P99), LLM duration distribution, tool success rate, slowest tools top 10

Token Usage Source Tracking

  • UsageEntry now has a Source field ("agent", "strategist", "verify", "ratchet", "subagent") identifying which LLM call consumed the tokens
  • Strategist, verify, and ratchet LLM calls previously consumed tokens invisibly — now all LLM usage is visible and categorized
  • MetricEvent now carries InputTokens/OutputTokens/CacheRead/CacheWrite per LLM call
  • Turn digest shows cumulative token totals growing with each iteration

Dashboard Improvements

  • Date range filter on Overview tab (from/to date pickers, live chart updates)
  • Workspace and date range filters on Sessions tab (dropdown + date pickers, instant filtering)
  • Draggable turn range slider on Session Detail (dual-handle, mouse + touch support)
  • Grouped bar charts with dual Y-axis (Input/Cache on left, Output on right)
  • Turn range slider labels show actual timestamps instead of turn indices

Bug Fixes

  • Data race on usageSource: emitUsageWithSource wrote usageSource outside of lock protection — changed RLock to Lock since the field is being mutated
  • O(n²) session count in overview date filter: Replaced find() per turn with O(n) Set lookup — eliminates lag with 11K+ turns
  • Global tool average duration always 0: TotalMs was not accumulated globally per tool — now properly computed as TotalMs / Calls
  • Daily tokens aggregated by session creation date: Multi-day sessions dumped all tokens on creation date — now attributed to each turn's actual usage timestamp
  • Back button arrow: Showed literal \u2190 instead of (Go raw string literals don't process \u escapes)
  • ggreport meta field parsing: Meta fields are top-level in JSONL records, not nested under a "meta" key
  • Session table numeric sort: Was comparing formatted strings ("4.7B" vs "291.9K") instead of raw numbers

Documentation

  • Fixed Jekyll Liquid error from Go code {{ }} syntax in grpc-plugins guide
  • Updated desktop framework references from Fyne to Wails
  • Regenerated GGCODE.md project memory with current authoritative state
  • Added report subcommand to CLI reference and shell completion docs

Upgrade Notes

No breaking changes. All improvements are backward compatible.

Compare

v1.3.172...v1.3.173