Repository navigation
fix(mods): migrate legacy session mode constraints - #2359
Merged
vastsa merged 1 commit intoNov 15, 2026
Merged
Conversation
Custom mode definitions already pass Host validation, but an older sessions table can still reject their ids after an upgrade. Repair that persisted constraint through a backed-up schema 32 migration. Preserve existing rows, schema objects, and session permission policy. Cover upgraded selection and creation, restart, rollback, and older mode schema chains without changing UI or execution contracts.
vastsa
approved these changes
Nov 15, 2026
vastsa
left a comment
Owner
There was a problem hiding this comment.
Independently reviewed the retained legacy CHECK and upgrade chain. Ran all 6 session_mode_migration SQLite/real Host RPC tests on both head 524b026 and integration 842602c (base 043d11c): passed, including original CHECK rejection, custom mode configure/create, older schemas, persistence, dependent objects, rollback, FK validation and pragma restoration. Diff check passes; all six Actions checks green. No installed-client or paid-provider claim. Backed-up transactional migration is scoped to the retained constraint.
This was referenced Nov 15, 2026
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.
Root cause
A retained
sessions.mode CHECK (mode IN ('agent','plan','goal'))can reject a valid custom mode duringsession.configureorsession.create. The current fresh schema already accepts custom ids, but the mode migrations only add snapshot/run storage and do not remove this legacy constraint. A fresh-database test therefore misses the upgraded-user failure.Reproduced the exact CHECK failure through the real Host RPC path on current main using a schema-31 fixture that actually retains the constraint.
Minimal fix
Schema 32 is intentionally refused by older binaries; the retained
pi.sqlite.v31.baksupports rollback without deleting user data.Verification
db::project_path_tests::path_repair_is_atomic_and_can_run_inside_an_import_transaction. The identical failure was independently reproduced on untouched official main043d11c23d153d9a9088d315bb50d12ebd8283e2; it was not changed or reported as passing.scripts/e2e-mode-definitions.mjs: production Main prompt IPC/coordinator and real Host passed staged artifact/approval/command-gate/completion and catalog edit/removal scenarios. The sidecar boundary is synthetic.Only isolated data/agents directories were used. No paid provider, running user Desktop, real session database, installer, or release was used or changed.
Task candidate:
524b0265c91bcd367fcdfa1da3e7f71eb3869bcaBase main:
043d11c23d153d9a9088d315bb50d12ebd8283e2The requester asks to observe all new non-Vercel checks to completion. Vercel preview authorization is excluded from that acceptance scope; no deployment permission or check is bypassed.