Skip to content

feat(state): add thread_history sqlite and initial migration#30131

Draft
owenlin0 wants to merge 2 commits into
mainfrom
owen/sqlite_schema_paginated_threads
Draft

feat(state): add thread_history sqlite and initial migration#30131
owenlin0 wants to merge 2 commits into
mainfrom
owen/sqlite_schema_paginated_threads

Conversation

@owenlin0

@owenlin0 owenlin0 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds the SQLite schema we’ll use for paginated local thread history. It creates a new thread_history_1.sqlite database owned by codex_state::StateRuntime.

Just a migration PR, no actual reads or writes yet.

Why

We want paginated local threads to store projected turns/items in SQLite without putting that load into state_5.sqlite. Making this a separate runtime DB gives us that isolation while still using the SQLite lifecycle code we already have in StateRuntime.

What changed

  • Added thread_history_1.sqlite to the StateRuntime DB inventory.
  • Added the initial thread_turns, thread_items, and thread_history_projection_state schema.
  • Wired the new DB through the existing runtime migration, telemetry, corruption-recovery path discovery, Bazel compile data, and shutdown flow.
  • Kept this scoped to schema/runtime setup only; projection writes and paginated reads come in follow-up PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant