desktop sidebar profile migration - #70964
Open
webtecnica wants to merge 1 commit into
Open
Conversation
… profile state.db (NousResearch#70944) After a Hermes update, profile state.db files can lag the current schema because the gateway only migrates the default DB on startup. The desktop sidebar aggregator opens profile DBs read-only, so list_sessions_rich fails with sqlite3.OperationalError (no such column) and the profile contributes zero sessions — an empty sidebar that looks like data loss. Fix both cross-profile endpoints: - GET /api/profiles/sessions - GET /api/profiles/sessions/sidebar When they catch sqlite3.OperationalError with 'no such column', they close the read-only connection, open the DB read-write once (triggers _init_schema → column reconciliation), then re-open read-only and retry the query. The write lock is brief (column reconciliation only) and happens at most once per lagging profile. Adds: - _migrate_db_if_schema_lags(db_path) helper - Schema-aware OperationalError handling in get_profiles_sessions - Two-attempt retry loop in get_profiles_sessions_sidebar - 5 tests covering both endpoints + idempotency + non-schema errors Closes NousResearch#70944 Related to NousResearch#42467 (original diagnosis), unmerged NousResearch#42487 (partial fix)
Collaborator
Related to #42487: its current diff covers |
13 tasks
Contributor
|
Thanks for covering both the legacy list endpoint and the batched sidebar path; the schema-lag premise is still present on current main. Problems
Suggested changes
Automated hermes-sweeper review. |
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.
Fixes issue