Repository navigation
fix(server): Klin starts on databases a v0.1.2 preview build migrated - #6
Merged
Merged
Conversation
ashx-j
force-pushed
the
klin/peer-links-preview-migration
branch
from
November 13, 2026 13:55
be9825b to
047299b
Compare
Ports the intent of pingdotgg/t3code#25494. v0.1.2 previews recorded the peer link migrations as 68-70; Klin ships them as 70-72 after ShellStopRequestIndex and ThreadMessageSearch. Startup now runs 68/69 and moves the preview rows up, keeping stored peer links. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ashx-j
force-pushed
the
klin/peer-links-preview-migration
branch
from
November 13, 2026 17:36
047299b to
b40382d
Compare
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.
Brings pingdotgg/t3code#25494 into Klin. A database that a v0.1.1 or v0.1.2 preview build (
20261020.3444,20261022.3511or.3516) opened once won't start on Klin. Those previews recorded the peer link migrations as 68 to 70, and main later used 68 and 69 forShellStopRequestIndexandThreadMessageSearch, so startup refuses the migration history.Upstream closed the original PR without a fix, and upstream main still has the bug. The original dropped the preview's peer link table and refused to start if it held links, because main had no peer links code back then. Klin now ships the same 3 peer link migrations as 70 to 72 with the same schema. So startup now runs 68 and 69 and moves the preview's 3 rows up to 70 to 72, and any stored peer links keep working. It only matches that exact preview history and doesn't run when migrating to an id below 72.
The new code lives in its own file, next to upstream's rewritten
reconcileV2PreviewMigration.ts.t3 serviceruns a preflight check that predicts what startup will do to the migration history, and it would have blocked these databases. It now applies the same peer links reconciliation, and its test covers this preview history.pr filed by Claude Opus 5.5 in Claude Code through T3 Code.