Fix fresh-install DB crash (missing selected_mcp_server_ids_json) and resolve MCP settings merge conflicts - #2
Open
TecnicalBot wants to merge 12 commits into
Open
Conversation
- migrations.ts: add the missing selected_mcp_server_ids_json column to the conversations table created on fresh installs (version 0). The v0 path jumps straight to DATABASE_VERSION=14, so the v12/v13 ALTERs that add this column were being skipped for new installs, causing "no such column: selected_mcp_server_ids_json" on every Drizzle query against conversations at app open. - add.tsx / list.tsx: resolve leftover git stash-pop conflict markers. Keep the dev @/modules/mcp/* import paths and the new fetchMcpServerCatalogCached API added in the previous commit.
…flict The previous commit accidentally included a truncated reconstruction of list.tsx. This replaces it with the exact original content (including the catalogPresets/PresetRow rendering) with only the stash-pop conflict markers resolved: keep the dev @/modules/mcp/* import paths and use fetchMcpServerCatalogCached.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Two problems on
dev:1. Fresh installs crash:
conversationsis missingselected_mcp_server_ids_jsonmigrateAppDatabasebuilds the full v14 schema in one shot for fresh installs (user_version0 jumps straight toDATABASE_VERSION), but the v0CREATE TABLE conversationsnever includedselected_mcp_server_ids_json. The column was only ever added by the v12/v13 migration path, which never runs on fresh installs. Result: every new install (including the installed test build) crashes on any SQL that reads/writes that column.Fix in
src/core/db/migrations.ts:selected_mcp_server_ids_json TEXTto the v0CREATE TABLE conversations.currentVersion >= DATABASE_VERSIONearly-return path: it checksPRAGMA table_info(conversations)andALTER TABLE ... ADD COLUMNif the column is missing. Existing installs that already landed on version 14 without the column now self-heal on next launch — no reinstall needed.2. Unresolved stash-pop conflict markers in MCP settings screens
src/app/(root)/settings/mcp/add.tsxandsrc/app/(root)/settings/mcp/list.tsxcontained live<<<<<<< Updated upstream / ======= / >>>>>>> Stashed changesmarkers.Resolution (both files):
@/modules/mcp/...module paths (the old@/lib/mcp/...path no longer exists ondev).fetchMcpServerCatalogCachedfrom@/modules/mcp/catalog— the dev call sites use it and it is what the module exports (verified againstsrc/modules/mcp/catalog.ts).list.tsxkeepsisMcpOAuthCanceledErrorfrom@/modules/mcp/oauth(verified exported).Files changed
src/core/db/migrations.ts— v0 schema fix + defensive repair on the latest-version pathsrc/app/(root)/settings/mcp/add.tsx— conflict markers resolvedsrc/app/(root)/settings/mcp/list.tsx— conflict markers resolvedVerification
<<<<<<</>>>>>>>markers remain in either settings file.devmodules.add.tsxwas already correctly resolved and left untouched except for the earlier conflict-resolution commit.