Sidebar (src/tui.tsx):
- Read quota()/now() signals inside the returned JSX instead of hoisting
quota() into a const above the return. The hoisted read subscribed once
under a non-tracking Solid owner, freezing the panel after first paint;
the slot handler re-runs on session change, which masked the bug as
'/session fixes it'.
- Harden refreshQuota: whole refresh (key resolve + fetch) inside
try/catch so any throw surfaces inline instead of wedging on loading.
Defensive api.state access (non-array provider tolerated) and
process.env access via safeEnv; key source tracked by name, never logged.
- Refresh triggers: keep session.idle, add session.status/session.updated/
message.updated (debounced) plus refresh on sidebar session_id change.
- Debug-gated tui-quota trace lines to the shared debug file (silent
unless debug is on); /cc-usage hardened the same way.
Provider cost (src/model.ts, src/usage.ts):
- Forward per-request USD from finish-step (usage.raw cost/market_cost/
gateway_cost) and provider-metadata (gateway.cost/marketCost) into
providerMetadata.commandcode.{cost,marketCost} on the terminal finish
part and doGenerate result; also stash into usage.raw. A reported 0 is
preserved; only undefined means absent.
Docs: README sidebar interval corrected (3 min, not 60 s) and trigger
list updated; AGENTS.md invariants 10 (cost) and 13 (Solid gotcha).