Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
EXECUTOR_TYPE = 'thread'
EXECUTOR_MAX_WORKERS = 30
SESSION_TYPE = 'filesystem'
VERSION = "0.261.039"
VERSION = "0.261.040"
IS_DEVELOPMENT = is_development_env_enabled()

# Opt-out for deployments where App Service Easy Auth is active but the platform
Expand Down
5 changes: 4 additions & 1 deletion application/single_app/static/js/chat/chat-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7392,7 +7392,10 @@ export function buildCollaborativeInvocationTarget(messageData = {}, explicitInv
}

export function shouldUseCollaborativeAiWorkflow(messageData = {}, explicitInvocationTarget = null) {
return Boolean(buildCollaborativeInvocationTarget(messageData, explicitInvocationTarget));
return Boolean(
buildCollaborativeInvocationTarget(messageData, explicitInvocationTarget)
|| String(messageData.message || '').trim()
);
}

function buildVoiceResponseCompletionHandler(responseModality) {
Expand Down
12 changes: 10 additions & 2 deletions docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Collaboration Shared AI Workflow Fix

Fixed/Implemented in version: **0.241.021**
Original implementation: **0.241.021**
Plain-prompt coverage completed in: **0.261.040**

Check warning on line 4 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.

## Overview

Collaborative conversations were still posting plain shared messages even when the chat toolbar had an active workspace search, web search, image generation, prompt, or agent selection. That meant shared conversations did not enter the same model and agent workflow that single-user chat already uses.
The original collaborative AI implementation added a shared streaming route and correctly covered prompts with an active workspace search, web search, image generation, prompt, agent selection, or explicit model target. It did not cover ordinary prompts with none of those triggers.

Check warning on line 8 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.

Check warning on line 8 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains secret or sensitive data source marker. Recommendation%3A Pair this source with any nearby network, logging, serialization, or process execution sink before approving.

That uncovered case meant an ordinary prompt after inviting participants followed the human-only shared-message path. It was persisted successfully but never invoked the model. This was a missing-case follow-up to the original implementation, not a confirmed rollback of the entire collaboration AI workflow.

Check warning on line 10 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.

The shared composer also did not provide an explicit way to target a model without turning on a tool. Users could tag participants, but they could not tag an available model or agent as a first-class AI target in the same shared conversation.

Expand All @@ -14,6 +17,8 @@

On the frontend, the `@` suggestion menu was limited to human participants and invite suggestions. Because explicit `@model` and `@agent` tags were never parsed into `ai_invocation_target` metadata, a no-tool shared send still fell back to a plain collaborative message instead of the AI streaming path.

The follow-up defect was in the routing predicate: it only selected the AI stream when `buildCollaborativeInvocationTarget()` found a tool, workspace, prompt, agent, image, or explicit AI target. A normal non-empty message produced no invocation target and was sent to the human-only endpoint.

Check warning on line 20 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.

Check warning on line 20 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains dynamic execution, persistence, or system access marker. Recommendation%3A Do not execute changed lifecycle scripts or installers while this finding is unresolved.

## What Changed

- Added a collaborative streaming route that saves the shared AI request, proxies the existing `/api/chat/stream` workflow against a hidden backing source conversation, and mirrors the final assistant or image response back into the collaboration message store.
Expand All @@ -23,6 +28,7 @@
- Added collaboration-side rendering support for mirrored image responses.
- Extended the collaboration `@` suggestion menu so it now surfaces available agents and available models alongside participant tags and invite suggestions.
- Added explicit `@agent` and `@model` parsing so shared sends can target AI without selecting a toolbar tool, and the raw `@target` text is stripped from the final message body in favor of a structured chip.
- Routed every non-empty collaborative prompt through the AI stream by default, while retaining invocation metadata for tool, agent, model, and workspace-targeted requests.

Check warning on line 31 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.

Check warning on line 31 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains dynamic execution, persistence, or system access marker. Recommendation%3A Do not execute changed lifecycle scripts or installers while this finding is unresolved.

Check warning on line 31 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains external connection or remote asset marker. Recommendation%3A Review whether changed code can send prompts, files, credentials, cookies, settings, logs, or user data to a new sink.
- Split shared chip styling so participant mentions, agent targets, and model targets render with different background colors.
- Updated the streaming chat bridge so explicit tagged-agent requests stamp `agent_selection` and the actual resolved model onto the hidden source user message metadata, which keeps shared user-message detail panels aligned with the assistant response.
- Synced source conversation tags and context metadata back into the collaborative conversation record after streaming completes so shared conversation details reflect the resolved agent and actual model used.
Expand All @@ -36,6 +42,7 @@
- `application/single_app/static/js/chat/chat-streaming.js`
- `application/single_app/static/css/chats.css`
- `application/single_app/config.py`
- `functional_tests/test_collaboration_shared_ai_workflow.py`

## Validation

Expand All @@ -46,6 +53,7 @@
## User Impact

- Shared workspace and web requests now enter the same model or agent workflow as single-user chat.
- Ordinary prompts sent after inviting participants now receive model responses instead of becoming human-only shared messages.

Check warning on line 56 in docs/explanation/fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md

View workflow job for this annotation

GitHub Actions / malicious-pr-security-review

Important - Changed line contains AI, plugin, agent, or workspace boundary marker. Recommendation%3A Check whether prompts, chat history, uploaded documents, embeddings, citations, settings, or identity can cross a new boundary.
- Shared image requests now route to image generation and mirror the resulting image back into the collaboration conversation.
- Shared AI requests now display an explicit target chip instead of silently acting like a plain participant message.
- Shared conversation authors can now type `@Default Agent` or `@gpt-5.4` to direct a message to an agent or model without selecting a tool first.
Expand Down
9 changes: 9 additions & 0 deletions docs/explanation/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

For feature-focused and fix-focused drill-downs by version, see [Features by Version](https://github.com/microsoft/simplechat/tree/main/docs/explanation/features) and [Fixes by Version](https://github.com/microsoft/simplechat/tree/main/docs/explanation/fixes).

### **(v0.261.040)**

#### Bug Fixes

* **Collaborative Prompts Now Receive Model Responses**
* Fixed ordinary prompts in conversations shared through **Invite Participants** being saved as human-only messages without invoking the model.
* All non-empty collaborative prompts now use the shared AI streaming workflow, while preserving explicit agent, model, workspace, and tool targeting.
* (Ref: `chat-messages.js`, `chat-collaboration.js`, [Collaboration Shared AI Workflow Fix](fixes/COLLABORATION_SHARED_AI_WORKFLOW_FIX.md))

### **(v0.261.030)**

#### Bug Fixes
Expand Down
5 changes: 3 additions & 2 deletions functional_tests/test_collaboration_shared_ai_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# test_collaboration_shared_ai_workflow.py
"""
Functional test for collaboration shared AI workflow parity.
Version: 0.250.224
Implemented in: 0.241.068
Version: 0.261.040
Implemented in: 0.261.040

This test ensures collaborative conversations route shared AI requests through
the collaboration stream bridge, persist explicit AI-request metadata, and
Expand Down Expand Up @@ -53,6 +53,7 @@ def test_frontend_collaboration_stream_wiring():
assert 'export function getCollaborativeTagSuggestions(' in messages_source
assert 'export function buildCollaborativeInvocationTarget(' in messages_source
assert 'export function shouldUseCollaborativeAiWorkflow(' in messages_source
assert "|| String(messageData.message || '').trim()" in messages_source
assert 'function buildCollaborativeSendContext(' in messages_source
assert "source_mode: 'explicit_tag'" in messages_source
assert 'stripExplicitCollaborativeTargetText(' in messages_source
Expand Down
Loading