rowboat/apps
Ramnique Singh 816fc97d14 Add sessions layer above the agent loop
A session is a grouping label (id, agentId, title) over an ordered chain
of self-contained turns; the loop itself never learns sessions exist.

- sendMessage builds each turn's input by copying the previous turn's
  full transcript forward (copy-forward history) and only ever chains on
  TERMINAL turns: anything running, waiting, or crashed-idle must be
  resolved or stopped first. Terminal turns are immutable, so the copied
  snapshot can never go stale or be re-activated.
- stopTurn now persists the stop as a terminal turn error (code
  "stopped") instead of leaving the turn idle/resumable; resumeTurn,
  setToolResult, and respondToPermission all reject terminal turns.
  Unresolved tool calls on a stopped turn are closed out with synthetic
  ToolMessages when history is copied forward — never re-executed.
- Turn rows gain sessionId/sessionSeq (opaque to the reducer) with a
  UNIQUE(session_id, session_seq) index as a fork tripwire; createTurn
  is now async and persists the row before returning so a claimed seq is
  visible the moment the caller holds the handle.
- New sessions/ module: Session types, SessionStore (in-memory +
  SQLite), SessionsImpl facade with a per-session KeyedMutex (extracted
  from the loop's TurnMutex). getHistory returns the same closed-out
  transcript the next turn will actually send.
- Migration 2026-06-12_0003_sessions: sessions table + additive turn
  columns. Provider/model/permissionMode deliberately flow per
  sendMessage call and land on the turn row, not the session.
- 21 new vitest tests (79 total): copy-forward, supersede-after-stop,
  crashed-turn blocking, terminal-mutation guards, concurrent-send
  serialization, SQLite round-trips and unique-seq enforcement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-15 09:32:48 +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 Add sessions layer above the agent loop 2026-06-15 09:32:48 +05:30