Skip to content

fix: address review findings round 1 (PR #813)#815

Closed
github-actions[bot] wants to merge 6 commits into
mainfrom
fix/issue-645-29d389b9
Closed

fix: address review findings round 1 (PR #813)#815
github-actions[bot] wants to merge 6 commits into
mainfrom
fix/issue-645-29d389b9

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Addresses all 5 expert review findings from round 1.

Findings addressed:

  1. 🟡 MessageCount desync (SessionSidebar.razor) — Added session.MessageCount = session.History.Count after adding system message post-reset
  2. 🟡 Misleading system message (CopilotService.cs) — ClearHistoryAsync now returns bool; callers display "Conversation reset (local only)." when server truncation didn't occur
  3. 🟡 /clear bypasses IsProcessing guard (Dashboard.razor) — Added guard that blocks /clear mid-turn with a system message
  4. 🟡 chat_history.db not cleared (CopilotService.cs) — Added ClearSessionAsync to IChatDatabase interface and call before local clear to prevent LoadBestHistoryAsync from restoring cleared messages
  5. 🟢 Integration test silently passes (ResetConversationTests.cs) — Changed return to Assert.Skip() so CI reports skipped rather than green

Tests: All 3665 tests pass (3664 + 1 new ClearHistoryAsync_ClearsChatDatabase)

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • 192.0.2.1

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "192.0.2.1"

See Network Configuration for more information.

Generated by Review & Fix · ● 12.5M ·

github-actions Bot and others added 6 commits April 30, 2026 15:35
Adopt SDK v0.2.2 HistoryApi.TruncateAsync for user-initiated history reset:

- Add ClearHistoryAsync to CopilotService that calls server-side
  TruncateAsync before clearing local History and MessageCount
- Add 'Reset Conversation' context menu item to SessionListItem
  (hidden while session is processing)
- Wire up the callback in all SessionSidebar SessionListItem instances
- Update /clear command to use async version with server-side truncation
- Add unit tests for ClearHistoryAsync (demo mode, non-existent session)
- Add integration test for context menu item presence

Fixes #645

Co-authored-by: copilot-agentic-workflow[bot] <224017+copilot-agentic-workflow[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…g 1)

After ClearHistoryAsync sets MessageCount=0, adding the system message
left MessageCount out of sync with History.Count. The render cache keys
on MessageCount, so the system message might not render until the next
SDK event corrects the count.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ndings 2+4)

ClearHistoryAsync now returns bool indicating whether server-side
truncation succeeded. Callers use this to display accurate messages
instead of falsely claiming 'Server-side history truncated' in demo,
remote, or failure modes.

Also adds ClearSessionAsync call before local clear so
LoadBestHistoryAsync won't restore cleared messages from the DB on
restart. Adds ClearSessionAsync to IChatDatabase interface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The context menu hides Reset Conversation when processing, but /clear
had no equivalent guard. A user could type /clear mid-turn causing
a race between History.Clear() and event-driven History.Add().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nding 5)

When no session items exist in CI, the test now reports as skipped
rather than green, making it clear the feature wasn't actually verified.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…overage

Updates existing tests to verify the bool return value from
ClearHistoryAsync. Adds ClearHistoryAsync_ClearsChatDatabase test
verifying that ClearSessionAsync is called on the chat database.
Adds ClearSessionAsync to StubChatDatabase with tracking.

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

Stale fix-round PR — fixes were pushed to the main PR branch.

@PureWeen PureWeen closed this Apr 30, 2026
@PureWeen PureWeen deleted the fix/issue-645-29d389b9 branch April 30, 2026 20:17
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.

1 participant