rowboat/apps
Ramnique Singh 91bb3cc8cd Dedup turn transcripts, record model usage, make event delivery live
Three follow-ups from the runtime design review:

Transcript prefix dedup (storage-level, transparent):
- A session turn's input starts with the previous turn's closed transcript
  (copy-forward); storing it again made session storage quadratic and every
  fact append rewrote the whole transcript. Stores now keep only the suffix
  past prefix_length and recompute the prefix on read from the immutable
  previous turn (closedTranscript moved to agent-loop/types.ts; shared
  split/join helpers in prefix-dedup.ts with loud tripwires).
- Opportunistic: input that doesn't extend the previous transcript (e.g.
  future compaction summaries) falls back to whole-row storage. Nothing
  above the stores changed; InMemoryTurnStore mirrors SQLite exactly.
- Migration 0005 adds prefix_length (default 0 = stored whole).

Per-model-call usage recording:
- New modelUsage fact log on the turn: one entry per model call, committed
  in the same write as the assistant message it paid for. ModelAdapter
  results now carry {message, usage}; VercelModelAdapter treats usage
  reporting failures as null rather than failing a completed step.
- totalUsage() derives turn aggregates; null means never reported.
- Migration 0004 adds the model_usage column.

EventStream: replay removed, bus-style live delivery:
- Events go to consumers attached at push time and are dropped otherwise,
  matching the runtime's IBus philosophy (facts persisted, deltas cosmetic,
  renderer reconciles from snapshots). No buffering without consumers;
  per-iterator queues bounded by consumer lag. Iterators attach
  synchronously at creation so the loop's own for-await never misses events.

Also: dispatched-call closures get honest wording ("may have completed
externally") distinct from interrupted and never-ran; SqliteTurnStore.update
keeps the no-op write guard alongside the prefix_length read.

8 new tests (87 total).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 21:44:53 +05:30
..
cli Add OS-aware runtime context for cross-platform shell execution 2026-02-26 11:42:43 +05:30
docs feat(oauth): switch Google OAuth from PKCE to authorization code flow with client secret 2026-04-10 00:43:34 +05:30
experimental Fix/prebuilt cards updates (#263) 2025-09-16 15:29:48 +05:30
python-sdk update py-sdk docs 2025-08-19 13:35:10 +05:30
rowboat fix: make dev script cross-platform for Windows PowerShell 2026-02-19 13:07:07 +05:30
rowboatx wip-electron 2026-01-16 12:05:33 +05:30
x Dedup turn transcripts, record model usage, make event delivery live 2026-06-12 21:44:53 +05:30