diff --git a/application/single_app/config.py b/application/single_app/config.py
index 2303a89e..cd3cd9c2 100644
--- a/application/single_app/config.py
+++ b/application/single_app/config.py
@@ -88,7 +88,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
-VERSION = "0.237.008"
+VERSION = "0.237.009"
SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
diff --git a/application/single_app/route_backend_chats.py b/application/single_app/route_backend_chats.py
index ad514e6f..10ea1abe 100644
--- a/application/single_app/route_backend_chats.py
+++ b/application/single_app/route_backend_chats.py
@@ -442,7 +442,7 @@ def result_requires_message_reload(result: Any) -> bool:
doc_results = list(cosmos_container.query_items(
query=doc_query, parameters=doc_params, enable_cross_partition_query=True
))
- if doc_results:
+ if doc_results and 'workspace_search' in user_metadata:
doc_info = doc_results[0]
user_metadata['workspace_search']['document_name'] = doc_info.get('title') or doc_info.get('file_name')
user_metadata['workspace_search']['document_filename'] = doc_info.get('file_name')
@@ -465,18 +465,22 @@ def result_requires_message_reload(result: Any) -> bool:
if group_doc.get('name'):
group_name = group_doc.get('name')
- user_metadata['workspace_search']['group_name'] = group_name
- debug_print(f"Workspace search - set group_name to: {group_name}")
+ if 'workspace_search' in user_metadata:
+ user_metadata['workspace_search']['group_name'] = group_name
+ debug_print(f"Workspace search - set group_name to: {group_name}")
else:
debug_print(f"Workspace search - no name for group: {active_group_id}")
- user_metadata['workspace_search']['group_name'] = None
+ if 'workspace_search' in user_metadata:
+ user_metadata['workspace_search']['group_name'] = None
else:
debug_print(f"Workspace search - no group found for id: {active_group_id}")
- user_metadata['workspace_search']['group_name'] = None
+ if 'workspace_search' in user_metadata:
+ user_metadata['workspace_search']['group_name'] = None
except Exception as e:
debug_print(f"Error retrieving group details: {e}")
- user_metadata['workspace_search']['group_name'] = None
+ if 'workspace_search' in user_metadata:
+ user_metadata['workspace_search']['group_name'] = None
import traceback
traceback.print_exc()
@@ -492,8 +496,11 @@ def result_requires_message_reload(result: Any) -> bool:
except Exception as e:
debug_print(f"Error checking public workspace status: {e}")
- user_metadata['workspace_search']['active_public_workspace_id'] = active_public_workspace_id
- else:
+ if 'workspace_search' in user_metadata:
+ user_metadata['workspace_search']['active_public_workspace_id'] = active_public_workspace_id
+
+ # Ensure workspace_search key always exists for consistency
+ if 'workspace_search' not in user_metadata:
user_metadata['workspace_search'] = {
'search_enabled': False
}
diff --git a/application/single_app/static/js/group/manage_group.js b/application/single_app/static/js/group/manage_group.js
index 250a7b70..a6b00cc4 100644
--- a/application/single_app/static/js/group/manage_group.js
+++ b/application/single_app/static/js/group/manage_group.js
@@ -473,8 +473,6 @@ function renderMemberActions(member) {
} else {
return `
`;
@@ -546,10 +541,6 @@ function loadPendingRequests() {
data-request-id="${u.userId}">Approve
-
-
`;
diff --git a/docs/explanation/release_notes.md b/docs/explanation/release_notes.md
index 5901ff04..ab6b2717 100644
--- a/docs/explanation/release_notes.md
+++ b/docs/explanation/release_notes.md
@@ -1,7 +1,8 @@
+
# Feature Release
-### **(v0.237.008)**
+### **(v0.237.009)**
#### New Features
@@ -16,6 +17,14 @@
#### Bug Fixes
+* **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)
+
* **OpenAPI Basic Authentication Fix**
* Fixed "session not authenticated" errors when using Basic Authentication with OpenAPI actions, even when credentials were correct.
* **Root Cause**: Mismatch between how the UI stored Basic Auth credentials (as `username:password` string in `auth.key`) and how the OpenAPI plugin factory expected them (as separate `username` and `password` properties in `additionalFields`).
@@ -221,7 +230,7 @@
* **Frontend Integration**: UI can query allowed auth types to display only valid options.
* **Files Modified**: `route_backend_plugins.py`.
* (Ref: plugin authentication, auth type constraints, OpenAPI plugins, security)
-
+
#### Bug Fixes
* **Control Center Chart Date Labels Fix**
@@ -780,9 +789,11 @@
* (Ref: `functions_authentication.py`, `functions_documents.py`, Video Indexer workflow logging)
### **(v0.229.014)**
+
#### Bug Fixes
##### Public Workspace Management Fixes
+
* **Public Workspace Management Permission Fix**
* Fixed incorrect permission checking for public workspace management operations when "Require Membership to Create Public Workspaces" setting was enabled.
* **Issue**: Users with legitimate access to manage workspaces (Owner/Admin/DocumentManager) were incorrectly shown "Forbidden" errors when accessing management functionality.
@@ -801,7 +812,9 @@
* (Ref: `chat-documents.js`, scope label updates, dynamic workspace display)
=======
+
##### User Interface and Content Rendering Fixes
+
* **Unicode Table Rendering Fix**
* Fixed issue where AI-generated tables using Unicode box-drawing characters were not rendering as proper HTML tables in the chat interface.
* **Problem**: AI agents (particularly ESAM Agent) generated Unicode tables that appeared as plain text instead of formatted tables.
@@ -1133,7 +1146,7 @@
* (Ref: `artifacts/architecture.vsdx`)
* **Health Check**
* Provide admins ability to enable a healthcheck api.
- * (Ref: `route_external_health.py`)
+ * (Ref: `route_external_health.py`)
#### Bug Fixes
@@ -1609,9 +1622,9 @@ We introduced a robust user feedback system, expanded content-safety features fo
5. **Inline File Previews in Chat**
- Files attached to a conversation can be previewed directly from the chat, with text or data displayed in a pop-up.
-7. **Optional Image Generation**
+6. **Optional Image Generation**
- Users can toggle an “Image” button to create images via Azure OpenAI (e.g., DALL·E) when configured in Admin Settings.
-8. **App Roles & Enterprise Application**
+7. **App Roles & Enterprise Application**
- Provides a robust way to control user access at scale.
- Admins can assign roles to new users or entire Azure AD groups.
\ No newline at end of file