[PR #13612] fix: skip JSON to SQLite migration on opencode serve #14737

Closed
opened 2026-02-16 18:19:30 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13612

State: closed
Merged: No


Closes #13611

Problem: The JSON to SQLite migration can take several minutes for large databases. Commands like serve are designed for programmatic usage where the caller expects opencode to start quickly.

Fix: Only run migration when process.stdout.isTTY is true - if there's no TTY, the user can't see the progress anyway.

Marker change: Uses a dedicated migration.json marker file instead of checking for opencode.db existence. This prevents the issue where a non-TTY invocation creates the db via Database.Client(), which would permanently block migration from running on future interactive commands.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13612 **State:** closed **Merged:** No --- Closes #13611 **Problem:** The JSON to SQLite migration can take several minutes for large databases. Commands like `serve` are designed for programmatic usage where the caller expects opencode to start quickly. **Fix:** Only run migration when `process.stdout.isTTY` is true - if there's no TTY, the user can't see the progress anyway. **Marker change:** Uses a dedicated `migration.json` marker file instead of checking for `opencode.db` existence. This prevents the issue where a non-TTY invocation creates the db via `Database.Client()`, which would permanently block migration from running on future interactive commands.
yindo added the pull-request label 2026-02-16 18:19:30 -05:00
yindo closed this issue 2026-02-16 18:19:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14737