Skip to content

fix: gracefully handle pipeline init errors due to corrupted SQLite cache#832

Open
octo-patch wants to merge 1 commit intoCinnamon:mainfrom
octo-patch:fix/sqlite-cache-error-744
Open

fix: gracefully handle pipeline init errors due to corrupted SQLite cache#832
octo-patch wants to merge 1 commit intoCinnamon:mainfrom
octo-patch:fix/sqlite-cache-error-744

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #744

Problem

After running kotaemon for an extended period (e.g., in a tmux session), the diskcache/SQLite cache used by theflow can become unavailable or corrupted. This causes sqlite3.OperationalError: no such table: Cache to propagate unhandled when SuggestConvNamePipeline or SuggestFollowupQuesPipeline are initialized, crashing the chat callback and surfacing as an error to the user on every action.

Solution

Wrap the pipeline initialization calls in check_and_suggest_name_conv and suggest_chat_conv with try/except blocks. When initialization fails, a warning is logged and the functions return a graceful no-op result instead of propagating the error. The naming and follow-up suggestion features are non-critical — the chat still works correctly without them.

Testing

  • Verified that the guard returns gr.update(), False from check_and_suggest_name_conv without crashing when pipeline init raises an exception.
  • The happy path (no exception) is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlite3.OperationalError: no such table: Cache

1 participant