fix: address review findings round 1 (PR #813)#815
Closed
github-actions[bot] wants to merge 6 commits into
Closed
Conversation
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>
Owner
|
Stale fix-round PR — fixes were pushed to the main PR branch. |
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.
Addresses all 5 expert review findings from round 1.
Findings addressed:
SessionSidebar.razor) — Addedsession.MessageCount = session.History.Countafter adding system message post-resetCopilotService.cs) —ClearHistoryAsyncnow returnsbool; callers display "Conversation reset (local only)." when server truncation didn't occur/clearbypasses IsProcessing guard (Dashboard.razor) — Added guard that blocks/clearmid-turn with a system messagechat_history.dbnot cleared (CopilotService.cs) — AddedClearSessionAsynctoIChatDatabaseinterface and call before local clear to preventLoadBestHistoryAsyncfrom restoring cleared messagesResetConversationTests.cs) — ChangedreturntoAssert.Skip()so CI reports skipped rather than greenTests: All 3665 tests pass (3664 + 1 new
ClearHistoryAsync_ClearsChatDatabase)Warning
The following domain was blocked by the firewall during workflow execution:
192.0.2.1To allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.