Skip to content

refactor(pi): move databaseEnv into pi and version pi_file - #341

Merged
eersnington merged 1 commit into
fix/daytona-exec-abortfrom
chore/pi-move-database-env
Oct 8, 2026
Merged

eersnington merged 1 commit into
fix/daytona-exec-abortfrom
chore/pi-move-database-env

Conversation

@eersnington

@eersnington eersnington commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

databaseEnv stores files of an agent without a sandbox in the Actor's SQLite. It created its pi_file table on first use, outside migratePiTables, so a later column change had no schema version to migrate from. The env has nothing to do with sandboxes, and pi() is its only user.

 packages/
 ├── pi/src/
+│   ├── database-env.ts   # moved; takes PiDatabase
 │   └── storage.ts        # migration 3: CREATE TABLE IF NOT EXISTS pi_file
 └── sandbox-adapter/src/pi/
-    ├── database-env.ts   # ensureTable, WeakMap cache, FileDatabase
     └── sandbox-env.ts
  • ensureTable, its per-database WeakMap, and the table check before every operation are gone.
  • IF NOT EXISTS keeps agents that created pi_file on 0.5.1 working with their files.
  • @rivet-dev/sandbox-adapter/pi no longer exports databaseEnv or FileDatabase. No docs or examples use them.

This is part 4 of 9 in a stack:

@eersnington eersnington changed the title refactor(pi): move the no-sandbox file env into pi and create pi_file in its migrations refactor(pi): move databaseEnv into pi and version pi_file Oct 8, 2026
@eersnington
eersnington force-pushed the chore/pi-move-database-env branch from e7ae6a9 to 2ec5c6d Compare October 8, 2026 15:40
@eersnington
eersnington added this pull request to stack #347 October 8, 2026 16:05
@eersnington
eersnington merged commit d3106ff into main Oct 8, 2026
0 of 6 checks passed
@eersnington
eersnington deleted the chore/pi-move-database-env branch October 8, 2026 16:11
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