Skip to content

Show user prompt separately from orchestration wrapper in chat UI#243

Merged
StephaneDelcroix merged 3 commits intomainfrom
fix/when-using-an-orchestration-the-user-pro-20260227-1925
Feb 28, 2026
Merged

Show user prompt separately from orchestration wrapper in chat UI#243
StephaneDelcroix merged 3 commits intomainfrom
fix/when-using-an-orchestration-the-user-pro-20260227-1925

Conversation

@StephaneDelcroix
Copy link
Copy Markdown
Collaborator

Problem

When using multi-agent orchestration (broadcast, sequential, orchestrator modes), the user's prompt gets wrapped in a larger context prompt that includes multi-agent context prefixes, orchestrator planning instructions, worker task assignments, etc. The full wrapped prompt was shown in the chat UI, making it hard to read and overwhelming.

Fix

  • Added OriginalContent property to ChatMessage to store the user's original typed text when Content contains the full orchestration-wrapped version
  • Threaded originalPrompt parameter through SendPromptAsync and SendPromptAndWaitAsync so orchestration callers can provide the user's original text
  • Updated all orchestration send paths (broadcast, sequential, orchestrator planning, worker dispatch, synthesis, reflect cycle) to pass the original prompt
  • Updated ChatMessageItem.razor to display OriginalContent as the visible message, with a collapsible <details> element showing the full orchestration prompt
  • Added CSS styling for the collapsed prompt section

What it looks like

  • User sees their original prompt text prominently in the chat
  • A "Full orchestration prompt" disclosure triangle lets them expand/collapse the wrapped version
  • When OriginalContent is null (regular non-orchestrated messages), behavior is unchanged

Testing

  • 8 new unit tests in OrchestrationPromptDisplayTests.cs covering OriginalContent behavior
  • 5 additional tests in ChatMessageTests.cs for the new property
  • All 1557 existing tests pass (1 pre-existing locale failure unrelated to this change)

When using multi-agent orchestration (broadcast, sequential, orchestrator modes),
the user's prompt was wrapped in a larger context prompt and the full wrapped
version was shown in the chat UI. This was overwhelming and hard to read.

Changes:
- Add OriginalContent property to ChatMessage to store the user's actual typed
  prompt when Content contains a wrapped/orchestration version
- Thread originalPrompt parameter through SendPromptAsync and
  SendPromptAndWaitAsync so orchestration callers can pass the user's original text
- Pass original prompt in SendBroadcastAsync, SendSequentialAsync,
  SendViaOrchestratorAsync, ExecuteWorkerAsync, and reflect cycle paths
- Update ChatMessageItem.razor to show OriginalContent as the visible message
  with a collapsible <details> element for the full orchestration prompt
- Add CSS styling for the collapsed orchestration prompt details
- Add unit tests for OriginalContent property and SendPromptAsync behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen
Copy link
Copy Markdown
Owner

If you've ran these through pr multi squad of power until it says it's mergeable just merge em

StephaneDelcroix and others added 2 commits February 28, 2026 10:52
Add OriginalContent column to ChatMessageEntity and map it in
both ToChatMessage() and FromChatMessage() so the separated
user prompt survives app restarts. sqlite-net-pcl auto-migrates
the nullable column; existing rows get null (pre-PR behavior).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Line 1363: SendPromptAsync for resume synthesis was missing
originalPrompt: pending.OriginalPrompt, causing the orchestrator's
synthesis message after app-restart to show the full wrapped prompt
instead of the user's original text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@StephaneDelcroix
Copy link
Copy Markdown
Collaborator Author

✅ Multi-Model Review: Ready to Merge

Two fixes applied during review:


Fix 1 — OriginalContent not persisted (commit 538f8d4)

Previous finding (3/5 models): OriginalContent on ChatMessage was not mapped in ChatMessageEntity, so it was silently dropped on app restart.

Fixed: Added OriginalContent column to ChatMessageEntity and mapped it in both ToChatMessage() and FromChatMessage(). sqlite-net-pcl auto-migrates the nullable column; existing rows get null (pre-PR behavior).


Fix 2 — MonitorAndSynthesizeAsync resume path missing originalPrompt (commit 6d00df5)

Found during re-review (2/5 models): CopilotService.Organization.cs:1363SendPromptAsync in the orchestration resume path (MonitorAndSynthesizeAsync) called without originalPrompt: pending.OriginalPrompt, so the synthesis message after app restart would show the full wrapped prompt instead of the user's original text. All other orchestration call sites were correctly updated.

Fixed: One-line change to pass originalPrompt: pending.OriginalPrompt at that call site.


All 1557 tests pass (1 pre-existing locale-dependent failure unrelated to this PR).

Post-fix re-review (5 models): No further issues found. ✅

@StephaneDelcroix StephaneDelcroix merged commit 88cbeb5 into main Feb 28, 2026
@StephaneDelcroix StephaneDelcroix deleted the fix/when-using-an-orchestration-the-user-pro-20260227-1925 branch February 28, 2026 10:31
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.

2 participants