| Age | Commit message (Collapse) | Author |
|
Compacted conversations start with a system summary (role: "system")
instead of a user message (role: "user"). The interleaveTurnMetrics
function only detected segments by role === "user", so compacted
conversations got zero segments and no metrics were emitted.
Fix: when no user messages are found but metrics entries exist, treat
the entire transcript as one segment. This places turn-metrics at the
end and anchors step-metrics to any tool-batch groups by stepId.
686 tests green.
|
|
When stepIds are absent on persisted chunks (or don't match), the
sequential fallback was HEAD-aligning — matching the OLDEST entries
(trimmed turns) to the NEWEST segments. This showed 'turn 1' on turn 20's
content and placed the wrong metrics on the wrong segments.
Fix: when stepId matching produces ZERO matches, use TAIL-ALIGNMENT
instead — match the LAST T entries to the T segments (the loaded chunks
are always the newest). The oldest entries (trimmed turns) are unmatched
and emit standalone turn-metrics rows at the top.
686 tests green.
|
|
When the chat limit unloads a turn's content (user message + chunks),
the segment disappears and the turn-metrics row was lost. Now unmatched
entries (fully trimmed turns) emit a standalone turn-metrics row at the
top of the transcript, so the user still sees 'turn N · X tok' for
unloaded turns.
Note: trimming during generation only affects COMMITTED chunks (old
turns). Provisional chunks (the in-flight turn) are never trimmed — the
big trim happens at seal when provisional → committed. This is by design.
|
|
The turn number comes from the entry's position in the metrics array
(1-based), which is correct regardless of trimming since stepId matching
aligns segments to the right entry. Now displays 'turn 3 · 12k tok' instead
of just 'turn · 12k tok'.
|
|
Step-metrics are only shown when anchored to their tool content (inline
after the tool-call/result group). Steps whose chunks were trimmed (or
text-only steps with no tool chunks) are now SKIPPED instead of piling
up at the segment tail as empty 'step N · X tok' bubbles.
The turn-total metrics row still shows the aggregate (tokens, duration,
cache rate), so the conversation-level summary is preserved.
Updated place.test.ts + ui.test.ts to anchor steps with tool-call groups
where step-metrics are expected.
|
|
Vite define bakes __APP_VERSION__ (git rev-parse --short=5 HEAD) at build
time — survives bundling into the arch package deploy. Falls back to 'dev'
when not in a git repo. Also fixes two noNonNullAssertion warnings in
place.ts.
|
|
trimming
When the chat limit trims old chunks, head-aligning turn metrics to
segments by position breaks (a trimmed user message removes a segment
boundary, shifting all subsequent alignments by one). Fix: match segments
to metrics entries by stepId overlap (pass 1), falling back to sequential
matching for text-only segments with no stepId-bearing groups (pass 2).
This prevents step/turn metrics from being placed on the wrong segment
after trimming, while preserving the original behavior for text-only turns.
686 tests green.
|
|
Restore the ergonomic composer from old Dispatch: an auto-resizing textarea
(1→7 lines) with a fixed-width Send button beside it, and a status bar BELOW
holding a status icon · context-window fill bar (escalating success/warning/
error color) · compact token count (current / limit · pct%).
The bar reuses the latest turn's contextSize as current usage and HARDCODES a
1,000,000-token window limit as a placeholder (real per-model limit is the next
backend ask). Absorbs the standalone ContextSizeBadge (removed). Pure helpers
computeContextUsage + formatCompactTokens added to core/metrics (tested).
540 tests green.
|
|
Backend context-size handoff: re-pin [email protected] / [email protected]
(+ re-mirror .dispatch reference snapshots). Thread the optional contextSize
through core/metrics (done fold + durable + selectCurrentContextSize: latest
turn's defined value, undefined=>unknown never 0, durable-wins-over-live).
Chat store exposes currentContextSize; ContextSizeBadge renders
"N tokens in context" / "context size unknown" above the composer.
GLOSSARY: add context size / context window. 533 tests green.
|
|
cache warming + retention, markdown
Consumes the backend cache-warming + cache-rate handoffs end-to-end and adds supporting infra:
- protocol/transport: conversation-scoped surfaces (conversationId on subscribe/invoke/surface + staleness routing); store auto-subscribes the catalog with the focused conversation and re-scopes on switch.
- surface-host: generic Number field renderer + custom rendererId dispatch (graceful skip on unknown).
- cache-warming feature: enabled toggle, min+sec interval, AUTHORITATIVE countdown from the surface's cache-warming-timer nextWarmAt, manual Warm now (POST /chat/warm), lastWarmAt-keyed history, cache-retention stat, expectedCacheRate headline.
- metrics: cross-turn expected-cache (retention) derivation + bubble badge; cache-rate fix needs no code change (inputTokens now total).
- markdown feature: marked + marked-highlight + highlight.js + dompurify, rendered in ChatView.
- fixes (gemini review): {#key activeConversationId} remount of CacheWarmingView to stop history/feedback leaking across tabs; guard NaN interval inputs from committing 0.
- docs/contracts: regenerated transport/ui-contract mirrors; backend-handoff updated (CR-3 resolved).
Verified: svelte-check 0 errors, biome clean, 494 tests pass, vite build OK.
|
|
Derive cache hit rate (cacheReadTokens / inputTokens) from data already
folded in core/metrics — no backend/contract change.
- core/metrics: computeCachePct + viewCacheRate (pct + success/warning/error
level by 66/33 thresholds + isHit); thread a running cumulativeUsage onto
each finalized turn-metrics row for the conversation total.
- ChatView: render two labelled, colour-coded percentage badges in the
turn-total bubble — "Last turn:" (that turn) and "Chat Total:" (cumulative).
- Honour backend caveats: absent cache fields -> 0, divide-by-zero guarded,
a legitimate 0% renders plainly (not "no data").
|
|
Consume [email protected] / [email protected] metrics: usage.stepId,
step-complete (ttft/decode/genTotal), done.durationMs/usage, and the
durable GET /conversations/:id/metrics endpoint.
- core/metrics: pure live-fold + durable-merge reducer; decode-rate TPS;
head-aligned, stable placement; progressive per-step rows (each shown as
its step ends) with the turn-total row gated on the done event.
- features/chat: store folds metric events + hydrates durable TurnMetrics;
ChatView renders inline step bubbles + a turn-total bubble.
- app: MetricsSync HTTP effect (tolerates 404) injected into chat stores.
- scripts/live-probe: drives the metrics path; live-verified 17/17 vs bin/up.
- docs: regenerate .dispatch wire/transport mirrors to 0.4.0; glossary terms
(turn/step metrics, TTFT, decode time, TPS, metrics bubble); trim handoff.
|