Conversation
When a new session is created, the SDK session creation is async. During
this window, IsCreating=true and SendPromptAsync rejects sends. The UI
(Dashboard.SendFromCard) was not checking IsCreating before sending,
causing the user's first message to be silently discarded — the input
was cleared but no message appeared in chat ('opens empty, no dialog').
Fixes:
1. Queue messages when IsCreating is true (same pattern as IsProcessing)
2. Drain queued messages after session creation completes
3. Show error feedback in chat when SendPromptAsync fails (instead of
only logging to console)
4. Add missing fields to ChatMessageEntity (ToolInput, ImagePath,
ImageDataUri, Caption) — fixes crash log in AddMessageAsync and
prevents data loss on DB round-trip
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR #287 Review — "fix: queue messages during session creation to prevent silent loss"CI Status: Consensus Findings (flagged by 3+ of 5 models)🔴 CRITICAL —
|
| # | Severity | Location | Finding |
|---|---|---|---|
| 1 | 🔴 CRITICAL | CopilotService.cs:~1662 |
Queued message removed before send; silently lost on failure |
| 2 | 🟡 MODERATE | CopilotService.cs:~1657 |
MessageQueue (List) mutated concurrently without lock |
| 3 | 🟡 MODERATE | Dashboard.razor:~1325 |
Sync catch block missing SafeRefreshAsync() call |
| 4 | 🟡 MODERATE | CopilotService.cs:~1630 |
Early-return skips queue cleanup → stale image/mode entries leak |
Recommended action:
Review by 5-model parallel dispatch (claude-opus-4.6 ×2, claude-sonnet-4.6, gemini-3-pro-preview, gpt-5.3-codex) with 2+ model consensus filter.
PR Review Squad — PR #287 Round 1CI Status: 🔴 CRITICAL (5/5 models)
🟡 MODERATE
Recommended Action:
|
…return, add SafeRefreshAsync to catch - Drain ContinueWith now calls InvokeOnUI to add ChatMessage.ErrorMessage to history and fire OnStateChanged when SendPromptAsync faults, instead of silent Debug() only - Early-return path (session closed during creation) now clears MessageQueue, _queuedImagePaths, and _queuedAgentModes before disposing to prevent stale-entry leaks - Dashboard.razor sync catch block now calls SafeRefreshAsync() so error messages added to History are immediately visible in the UI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR #287 Re-Review (Round 2) — All Critical and Moderate Findings FixedFix commit: Previous Findings Status (4/5 models, consensus)
New Finding (3/4 models: Opus1, Opus2, Sonnet)🟢 MINOR — CopilotService.cs:~1691 — If first drain send fails, messages [1..n] have no auto-retry trigger If 2+ messages were queued during creation and the first drain send fails: message [0] shows a visible error message, but messages [1..n] remain in the queue with no automatic processing trigger (because only fires when a turn successfully completes, not on failure). The messages are not lost — they remain visible in the queue UI and the user can manually resend — but they won't auto-send after the error. This is a pre-existing limitation of the fire-and-forget drain pattern and is not a regression. No change required for this PR. Recommended Action: ✅ ApproveAll critical and moderate findings from Round 1 are fixed. The PR is in good shape to merge. Re-review by 4-model parallel dispatch (claude-opus-4.6 ×2, claude-sonnet-4.6, gemini-3-pro-preview) with consensus filter. |
Bug
New sessions open empty with no dialog — user's first message is silently lost.
Root Cause
Race condition between optimistic session creation and user interaction:
CreateSessionAsyncadds session to UI immediately withIsCreating = trueSendPromptAsyncthrowsInvalidOperationException("Session is still being created")ContinueWithSecondary:
ChatDatabase.AddMessageAsynccrash in crash.log due to missing fields inChatMessageEntity.Fix
IsCreatingis true (Dashboard.razor) — same pattern as existingIsProcessingqueue logicToolInput,ImagePath,ImageDataUri,Captionadded toChatMessageEntitywith round-trip supportTests
NewSessionEmptyDialogTests.cs: IsCreating state, queue behavior, round-trip entity conversion, error messagesChatDatabaseResilienceTests.cs: DB round-trip for ToolInput and Image fields