Skip to content

v0.5.0

Choose a tag to compare

@mkjt2 mkjt2 released this 07 Jun 00:23
· 81 commits to main since this release
e96d3ff

First-class OpenCode provider support lands on the web app: session analytics, a hierarchical per-provider/per-model token breakdown card, transcript rendering, and official branding. Minor bump for the new provider surface and the accompanying API + schema additions.

Features

  • OpenCode provider — Phase 2 web (#261) — Full web support for OpenCode sessions: analytics compute, the new tokens_v2 peer card (hierarchical token breakdown across multiple LLM providers/models), and transcript UI rendering. Also wires per-line timestamp extraction for OpenCode transcripts (info.time.created epoch-ms) so last_message_at is populated for OpenCode sessions.
  • OpenCode official branding (#262, CF-544) — Replace the placeholder OpenCode branding with official brand assets (icon/label/color).

UI

  • Workflows card padding (#260, CF-534) — Add horizontal padding to Workflows card rows for roomier spacing.

DB Migrations

  • 000051_session_card_tokens_v2 — Adds the session_card_tokens_v2 table: a hierarchical, per-provider/per-model token-usage breakdown (nested JSON tree of total cost → by_providermodels → token breakdown), used primarily by OpenCode sessions that span multiple LLM providers. Columns: session_id (UUID PK, FK → sessions(id) ON DELETE CASCADE), version (INT, compute-logic version for cache invalidation), computed_at (TIMESTAMPTZ), up_to_line (BIGINT, JSONL line count when computed), data (JSONB). Adds index idx_session_card_tokens_v2_version. Coexists with the existing flat session_card_tokens table for backward compatibility.

API Changes

  • GET /api/v1/sessions/{external_id}/analytics — New cards.tokens_v2 object in the response. Hierarchical per-provider/per-model token breakdown. Cached for every session and part of the cache-validity gate, but included in the response only when it has provider data (currently OpenCode); omitted for Claude/Codex until their per-model trees are built. Supersedes cards.tokens in the UI when present. Fields:
    • total_cost_usd (string, 6dp) — total estimated cost across all providers; sourced from OpenCode's reported per-message cost, falling back to Confab's pricing table only for models OpenCode reports no cost for.
    • total_input / total_output (int) — totals matching cards.tokens.input/output.
    • by_provider (object) — map of provider id → {cost_usd, models}; each model entry has input, output, cache_read, cache_write, reasoning, cost_usd.

Breaking Changes

None. No env vars renamed/removed, no CLI impact. The tokens_v2 API field and the session_card_tokens_v2 table are purely additive.