Merged
Conversation
…asets What we did in part one was move the large raw tabular/tool payloads off the main assistant message and store them as linked child records instead. The core code is in functions_message_artifacts.py. We added helpers to: Build a compact citation that stays on the assistant message. Store the full raw citation payload in separate assistant_artifact records, with assistant_artifact_chunk records if the payload is large enough to need chunking. Rehydrate those raw payloads later when an export or deep inspection needs the full data again. In practice, that meant the assistant message no longer carried the full tabular function_result blob. It only kept a summary like tool name, compact arguments, counts, and a few sample rows. The heavy payload was externalized with an artifact_id and raw_payload_externalized=True. That is the “large assistant-side payloads outside primary chat items” change you’re remembering. The chat write path was updated in route_backend_chats.py to persist those artifact records via persist_agent_citation_artifacts(...). The normal conversation/history paths were updated to hide those artifact records from visible chat history with filter_assistant_artifact_items(...) in route_backend_conversations.py and route_frontend_conversations.py. Export paths were updated to stitch the raw payload back together with build_message_artifact_payload_map(...) and hydrate_agent_citations_from_artifacts(...) in route_backend_conversation_export.py. Why that helped performance and reliability: It kept the main assistant message much smaller. It prevented large tabular citations from pushing a single Cosmos message item over size limits. It reduced the amount of heavy citation data carried around in normal chat reads/history assembly. It preserved the raw data for export/debugging instead of throwing it away. A few extra size cuts were part of that same phase: We compacted stored citation summaries instead of keeping the full raw result on the main message. We excluded noisy args like user_id, conversation_id, and source from compact tabular citation arguments in functions_message_artifacts.py. We also removed the duplicate user_message field from assistant message docs, as called out in ASSISTANT_CITATION_ARTIFACT_STORAGE_FIX.md.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bundles several runtime, UX, and reliability improvements across SimpleChat, including hardened dependency pinning, safer template bootstrapping, workspace UX fixes, and a new storage pattern for large assistant citation payloads.
Changes:
- Externalize large assistant
agent_citationsinto linked Cosmos “artifact” child records (with hydration for exports and filtering for normal history views). - Harden workspace/chat UI behavior (endpoint-disabled quiet load, autofill metadata markers, safer chat bootstrap rendering, improved plugin validation/save error surfacing).
- Refresh/pin dependencies across the app, deployers, UI tests, and external utilities, plus documentation/release-note updates for the shipped fixes/features.
Reviewed changes
Copilot reviewed 56 out of 57 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| ui_tests/test_workspace_page_endpoint_disabled_quiet.py | UI regression to ensure workspace doesn’t call disabled endpoints API when tab is hidden |
| ui_tests/test_workspace_page_autofill_metadata.py | UI regression validating autofill-ignore metadata on workspace modal/build surfaces |
| ui_tests/test_group_workspace_page_autofill_metadata.py | UI regression validating autofill-ignore metadata on group workspace surfaces |
| ui_tests/test_chat_page_multi_endpoint_notice_render.py | UI smoke test for authenticated chats render + multi-endpoint notice bootstrap robustness |
| ui_tests/requirements.txt | Pins UI test dependencies and adds pytest-playwright |
| functional_tests/test_workspace_endpoint_disabled_state_quiet.py | Functional regression for endpoint module gating + quiet disabled handling |
| functional_tests/test_workspace_autofill_overlay_metadata.py | Functional regression for workspace autofill metadata normalization |
| functional_tests/test_tabular_relational_analysis_helpers.py | Functional regression for new deterministic tabular relational helpers + relationship hints |
| functional_tests/test_tabular_raw_tool_fallback.py | Extends fallback regressions to enforce prompt-budgeted compaction |
| functional_tests/test_tabular_multisheet_workbook_support.py | Updates multi-sheet orchestration regressions and query guidance assertions |
| functional_tests/test_tabular_entity_lookup_mode.py | Extends entity-lookup regressions for anchor scoring + sheet selection logic |
| functional_tests/test_reasoning_effort_initial_sync.py | Updates startup ordering regression and adds legacy model restore assertions |
| functional_tests/test_plugin_validation_managed_fields_compatibility.py | Regression ensuring persisted audit fields don’t break plugin validation |
| functional_tests/test_group_workspace_autofill_overlay_metadata.py | Functional regression for group workspace autofill metadata normalization |
| functional_tests/test_flask_markup_import_fix.py | Regression for Flask 3 Markup import path + fix documentation presence |
| functional_tests/test_chat_template_json_bootstrap_safety.py | Regression ensuring chats template avoids JSON.parse string bootstrap |
| functional_tests/test_chat_multi_endpoint_notice_template_fallback.py | Regression ensuring multi-endpoint notice is safe-defaulted and bootstrap-safe |
| functional_tests/test_assistant_citation_artifact_storage.py | Regression for citation artifact externalization + hydration behavior |
| docs/Gemfile.lock | Dependency updates for docs site build |
| docs/explanation/release_notes.md | Moves PR’s release-note entries under a newer version section |
| docs/explanation/fixes/WORKSPACE_PLUGIN_VALIDATION_AUDIT_FIELDS_FIX.md | Fix doc for managed/audit fields plugin validation compatibility |
| docs/explanation/fixes/WORKSPACE_ENDPOINTS_DISABLED_TOAST_FIX.md | Fix doc for quiet behavior when endpoints are disabled |
| docs/explanation/fixes/WORKSPACE_AUTOFILL_OVERLAY_METADATA_FIX.md | Fix doc for workspace autofill overlay hardening |
| docs/explanation/fixes/TABULAR_PROMPT_BUDGET_FALLBACK_FIX.md | Fix doc for prompt-budget truncation/compaction in tabular fallbacks |
| docs/explanation/fixes/TABULAR_NAMED_MEMBER_SHARE_SEMIJOIN_FIX.md | Fix doc for deterministic named-member share behavior via semi-join |
| docs/explanation/fixes/TABULAR_MULTISHEET_ENTITY_LOOKUP_RELIABILITY_FIX.md | Fix doc for entity-lookup multi-sheet reliability and error clarity |
| docs/explanation/fixes/GROUP_WORKSPACE_AUTOFILL_OVERLAY_METADATA_FIX.md | Fix doc for group workspace autofill overlay hardening |
| docs/explanation/fixes/FLASK_31_MARKUP_IMPORT_FIX.md | Fix doc for Flask 3 Markup import compatibility |
| docs/explanation/fixes/CHAT_TEMPLATE_JSON_BOOTSTRAP_FIX.md | Fix doc for removing JSON.parse-based bootstrap in chats template |
| docs/explanation/fixes/CHAT_LEGACY_MODEL_SELECTION_RESTORE_FIX.md | Fix doc for restoring legacy preferred model selection |
| docs/explanation/fixes/ASSISTANT_CITATION_ARTIFACT_STORAGE_FIX.md | Fix doc for storing large assistant citation payloads as artifacts |
| docs/explanation/features/TABULAR_RELATIONAL_ANALYSIS_HELPERS.md | Feature doc for deterministic relational helpers and relationship hints |
| deployers/bicep/requirements.txt | Pins Bicep deployer Python deps |
| application/single_app/templates/workspace.html | Adds autofill-ignore metadata + endpoint module gating + metadata normalization helper |
| application/single_app/templates/group_workspaces.html | Adds autofill-ignore metadata + endpoint module gating + metadata normalization helper |
| application/single_app/templates/chats.html | Removes JSON.parse bootstrap, adds safe defaults for multi-endpoint notice |
| application/single_app/templates/_multiendpoint_modal.html | Adds autofill-ignore metadata for endpoint modal + password fields |
| application/single_app/templates/_agent_modal.html | Adds autofill-ignore metadata for agent modal container |
| application/single_app/static/js/workspace/workspace_plugins.js | Surfaces real validation errors and backend save error messages |
| application/single_app/static/js/workspace/workspace_plugins_new.js | Same validation/save error surfacing for the newer workspace plugin flow |
| application/single_app/static/js/workspace/workspace_model_endpoints.js | Skips init when UI absent + quiet handling for “endpoints disabled” responses |
| application/single_app/static/js/plugin_common.js | Adds getErrorMessageFromResponse() helper for consistent error extraction |
| application/single_app/static/js/chat/chat-model-selector.js | Restores legacy preferred model selection before selector refresh |
| application/single_app/static/js/admin/admin_plugins.js | Better validation error display + backend error extraction on save |
| application/single_app/static/js/admin/admin_plugins_new.js | Same validation/save error surfacing for the newer admin plugin flow |
| application/single_app/route_frontend_conversations.py | Filters out assistant artifact records from conversation views |
| application/single_app/route_backend_plugins.py | Expands validation sanitization for storage-managed plugin fields |
| application/single_app/route_backend_conversations.py | Filters artifacts from message APIs and cascades deletion to child docs |
| application/single_app/route_backend_conversation_export.py | Rehydrates agent citations from artifact records during export |
| application/single_app/route_backend_chats.py | Persists citation artifacts + prompt-budget compaction + improved workbook routing guidance |
| application/single_app/requirements.txt | Pins/updates main runtime dependencies (Flask 3, Werkzeug, etc.) |
| application/single_app/json_schema_validation.py | Adds shared storage-managed field stripping for plugin validation |
| application/single_app/functions_message_artifacts.py | New artifact storage/hydration helpers for large assistant payloads |
| application/single_app/config.py | Moves Markup import to markupsafe and bumps VERSION |
| application/external_apps/databaseseeder/requirements.txt | Pins deps and replaces dotenv with python-dotenv |
| application/external_apps/bulkloader/requirements.txt | Pins deps and replaces dotenv with python-dotenv |
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.
Cross-Cloud Deployment Improvements
deployers/azure.yaml,deployers/azurecli/deploy-simplechat.ps1,deployers/bicep/main.bicep,deployers/bicep/modules/videoIndexer.bicep,deployers/terraform/main.tf,application/single_app/functions_settings.py)Python Runtime Dependency Refresh and Supply-Chain Hardening
v0.240.014by tightening the main application runtime to exact package pins, reducing dependency drift across local development, CI, and Azure deployments to help mitigate supply-chain exposure.Flask==3.1.3andWerkzeug==3.1.6, and updated the sharedMarkupimport path tomarkupsafeso the app starts correctly with Flask 3's package boundary changes.gunicorn,requests,openai,Markdown,markdown2,azure-ai-projects,azure-ai-agents,pyjwt,pypdf,semantic-kernel,protobuf,redis,pyodbc,PyMySQL,cython, andaiohttpto pick up current security, compatibility, and capability improvements while keeping builds reproducible.application/single_app/requirements.txt,application/single_app/config.py,functional_tests/test_flask_markup_import_fix.py,docs/explanation/fixes/FLASK_31_MARKUP_IMPORT_FIX.md)Dependency Pinning and Requirements Hardening
dotenvwithpython-dotenv, removing the stdlib-onlyloggingpackage, removing an unusedFlaskrequirement from the databaseseeder utility, and addingpytest-playwrightso the UI test dependency set matches the pytest fixture usage in the test suite.application/single_app/requirements.txt,ui_tests/requirements.txt,deployers/bicep/requirements.txt,application/external_apps/databaseseeder/requirements.txt,application/external_apps/bulkloader/requirements.txt)Assistant Citation Artifact Storage for Large Tabular Payloads
functions_message_artifacts.pyto keep a compact citation summary on the assistant message, externalize the full raw citation payload intoassistant_artifactrecords withassistant_artifact_chunksupport for larger payloads, and rehydrate those raw payloads later for exports or deeper inspection.artifact_idandraw_payload_externalized=True.user_id,conversation_id, andsource, and removed the duplicateuser_messagefield from assistant message documents.functions_message_artifacts.py,route_backend_chats.py,route_backend_conversations.py,route_frontend_conversations.py,route_backend_conversation_export.py,test_assistant_citation_artifact_storage.py,ASSISTANT_CITATION_ARTIFACT_STORAGE_FIX.md)