Skip to content

fix(server): repair installs that skipped the default-thread-env-mode column - #43

Merged
rynfar merged 1 commit into
pylonfrom
fix/2026-08-15-repair-env-mode-column
Aug 15, 2026
Merged

fix(server): repair installs that skipped the default-thread-env-mode column#43
rynfar merged 1 commit into
pylonfrom
fix/2026-08-15-repair-env-mode-column

Conversation

@rynfar

@rynfar rynfar commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

An earlier build shipped ProjectionThreadSessionLifecycle as migration 41.
This branch later settled on 41 = ProjectionProjectsDefaultThreadEnvMode,
42 = ProjectionProjectFaviconPath, 43 = session lifecycle.

The runner only applies ids above the highest one a database records, so a
database written by that earlier build reports 41 as done, runs 42 and 43, and
never runs 41 — leaving projection_projects without
default_thread_env_mode.

That is not a cosmetic gap. Every project query then fails with no such column, which takes the server down during startup. I hit this against a real
~/.pylon-code database while verifying something else:

INFO: Migrations ran successfully
  migrations: [ '42_ProjectionProjectFaviconPath', '43_ProjectionThreadSessionLifecycle' ]
ERROR: PersistenceSqlError: ... listProjects ... no such column: default_thread_env_mode
Failed running 'src/bin.ts'

Anyone upgrading an install from around that build hits it on first launch.

The fix

Renumbering is what caused this, so the fix cannot be another renumber — those
databases would still skip whatever sits below their high water mark. Migration
44 sits above it and re-adds the column, guarded by a table_info check so
a correctly migrated database is untouched.

Verification

Two unit tests: one reproduces the skip (stop at 40, claim 41, run through 43,
assert the column is missing, then run 44 and assert it is back), one asserts a
correctly migrated database is unchanged.

End to end against a copy of the real database that crashed: it now applies
44_RepairProjectsDefaultThreadEnvMode, starts with zero errors, and keeps its
4 projects and 25 threads.

Server typecheck and lint clean; all 12 migration test files pass.

Also corrects two lines in docs/user/install.md that read "installs beside
Pylon" and "Pylon continues using its own .t3" — both meant T3 Code, from an
over-eager rename. Noticed while following that doc to build a DMG.

Claude Opus 5 (1M context) in Claude Code.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

… column

An earlier build shipped ProjectionThreadSessionLifecycle as migration 41.
This branch later settled on 41 = ProjectionProjectsDefaultThreadEnvMode,
42 = ProjectionProjectFaviconPath, 43 = session lifecycle. The runner only
applies ids above the highest one a database records, so those installs report
41 as done, run 42 and 43, and never run 41 — leaving projection_projects
without default_thread_env_mode.

That is not a cosmetic gap: every project query then fails with `no such
column`, and the server dies during startup. Reproduced against a real
~/.pylon-code database, which logged "Migrations ran successfully
['42_…','43_…']" and then took the server down.

Renumbering is what caused this, so the fix cannot be another renumber — those
databases would still skip anything below their high water mark. Migration 44
sits above it and re-adds the column, guarded by a table_info check so a
correctly migrated database is untouched. Verified end to end: the same
database that crashed now applies 44 and starts clean with its 4 projects and
25 threads intact.

Also corrects two lines in the install doc that read "installs beside Pylon"
and "Pylon continues using its own .t3" — both meant T3 Code, from an
over-eager rename.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Aug 15, 2026
@rynfar
rynfar merged commit 9097458 into pylon Aug 15, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 6ed91c0.

This comment will update automatically after the next completed run.

@rynfar
rynfar deleted the fix/2026-08-15-repair-env-mode-column branch August 15, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant