Skip to content

Conversation

@JacobRWebb
Copy link
Contributor

Summary

  • Fixed session start crash caused by missing plugin_meta table
  • session-start.ts was attempting to INSERT into a table that didn't exist in the schema
  • Added the table to both schema.ts (fresh installs) and as a v6 migration (existing databases)

session-start.ts attempts to INSERT into plugin_meta table during
initialization, but the table was never created in the schema.

Changes:
- Add plugin_meta table to schema.ts for fresh installs
- Add v6 migration in migrate.ts for existing databases
- Add v6 version detection in getCurrentVersion()

Fixes session start crash: "no such table: plugin_meta"
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 18, 2026

Greptile Summary

  • Fixed critical session startup crash by adding missing plugin_meta table that session-start.ts was attempting to insert into
  • Implemented comprehensive database schema fix with both base schema addition for fresh installs and v6 migration for existing databases
  • Updated schema versioning from 5 to 6 with proper migration detection logic to handle backward compatibility

Important Files Changed

Filename Overview
src/db/schema.ts Added plugin_meta table definition to base schema for fresh installations
src/db/migrate.ts Added v6 migration to create plugin_meta table and updated version detection logic
CHANGELOG.md Documented the database fix and migration details for version 2.1.4

Confidence score: 5/5

  • This PR is safe to merge with minimal risk of production issues
  • Score reflects a well-implemented database schema fix with proper migration handling and comprehensive testing considerations
  • No files require special attention as the changes follow established patterns and include proper backward compatibility

Sequence Diagram

sequenceDiagram
    participant Developer as "Developer"
    participant Claude as "Claude"
    participant DB as "Database"
    participant Migration as "Migration System"
    
    Developer->>Claude: "Starts session (session-start.ts runs)"
    Claude->>DB: "Check database schema"
    DB->>Claude: "Returns current schema version"
    Claude->>Migration: "runMigrations()"
    Migration->>DB: "Check if plugin_meta table exists"
    DB->>Migration: "Table missing"
    Migration->>DB: "Execute v6 migration SQL"
    DB->>Migration: "Create plugin_meta table"
    Migration->>DB: "Insert schema version 6"
    Migration->>Claude: "Migration complete"
    Claude->>DB: "INSERT INTO plugin_meta (version info)"
    DB->>Claude: "Success - no crash"
Loading

@ojowwalker77
Copy link
Owner

oops, yeah this is great! I will later today add tests to test db schemes against previous db versions!

@ojowwalker77 ojowwalker77 merged commit caf71c9 into ojowwalker77:main Jan 18, 2026
11 of 13 checks passed
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.

2 participants