Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
- Add session_messages table and migration for storing conversation turns - Add getSessionHistory() helper to load recent history with token budget - Pass conversation history to executeWork() and executeWorkStreaming() - Persist user/assistant exchanges after completed requests - Rejected/failed requests do not pollute history Fixes #39 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
14 lines
481 B
SQL
14 lines
481 B
SQL
-- Migration: Session conversation history (#38/#39)
|
|
-- Stores user/assistant message pairs for context injection into the work model.
|
|
|
|
CREATE TABLE IF NOT EXISTS session_messages (
|
|
id SERIAL PRIMARY KEY,
|
|
session_id TEXT NOT NULL REFERENCES sessions(id),
|
|
role TEXT NOT NULL,
|
|
content TEXT NOT NULL,
|
|
token_count INTEGER,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX idx_session_messages_session_id ON session_messages(session_id);
|