Skip to content

Conversation

@paullizer
Copy link
Contributor

  • Workspace Search Deselection KeyError Fix
    • Fixed HTTP 500 error when deselecting the workspace search button after having a document selected. Users would get "Could not get a response. HTTP error! status: 500" in the chat interface.
    • Root Cause: When workspace search was deselected (hybrid_search_enabled = False), the user_metadata['workspace_search'] dictionary was never initialized. However, subsequent code for handling group scope or public workspace context attempted to access user_metadata['workspace_search']['group_name'] or other properties, causing a KeyError.
    • Error: KeyError: 'workspace_search' at lines 468, 479 in route_backend_chats.py when trying to set group_name or active_public_workspace_id.
    • Solution: Added defensive checks before accessing user_metadata['workspace_search']. If the key doesn't exist, initialize it with {'search_enabled': False} before attempting to set additional properties like group_name or workspace IDs.
    • Workaround: Clicking Home and then back to Chat worked because it triggered a page reload that reset the state properly.
    • (Ref: route_backend_chats.py, workspace search, metadata initialization, KeyError handling)

@paullizer paullizer merged commit a4a4224 into Development Feb 9, 2026
4 checks passed
@paullizer paullizer deleted the search-bug-fix-20260229 branch February 9, 2026 18:07
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.

1 participant