fix: address review findings round 3 (PR #813)#817
Closed
github-actions[bot] wants to merge 6 commits intomainfrom
Closed
fix: address review findings round 3 (PR #813)#817github-actions[bot] wants to merge 6 commits intomainfrom
github-actions[bot] wants to merge 6 commits intomainfrom
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>
…reset LastReadMessageCount CRITICAL: TruncateAsync(eventId) was called with sessionId — server never truncated. SDK lacks a 'clear all' overload; added SDK-gap comment. MODERATE: ClearHistoryAsync now clears chat_history.db via ClearSessionAsync to prevent LoadBestHistoryAsync from restoring cleared messages. MODERATE: LastReadMessageCount reset to 0 alongside MessageCount. Added ClearSessionAsync to IChatDatabase interface and test stub. ClearHistoryAsync returns bool indicating live session existed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…onal message MODERATE: /clear slash command now checks session.IsProcessing before clearing. MODERATE: MessageCount synced after adding system message post-clear. MODERATE: Message reflects actual truncation status (conditional on bool return). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MODERATE: ClearSessionHistory now uses bool return from ClearHistoryAsync for conditional message. MessageCount synced after system message add. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MINOR: Test now reports as skipped (not passed) when no session items exist in CI, making the gap visible in test reports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…geCount Tests now verify: bool return value (false in demo mode), LastReadMessageCount reset to 0 alongside MessageCount. 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 expert review findings from round 3.
Fixes
🔴 CRITICAL — TruncateAsync called with wrong argument: Removed incorrect
TruncateAsync(sessionId)call. SDK'sHistoryApi.TruncateAsyncrequires aneventIdparameter, not a session ID. The SDK lacks a "clear all history" overload (documented as SDK-gap). Method now returnsboolindicating whether a live SDK session existed.🟡 MODERATE —
chat_history.dbnot cleared: Added_chatDb.ClearSessionAsync()call to preventLoadBestHistoryAsyncfrom restoring cleared messages on restart. AddedClearSessionAsynctoIChatDatabaseinterface.🟡 MODERATE —
LastReadMessageCountnot reset: Now reset to 0 alongsideMessageCount, preventing broken unread badges after clear.🟡 MODERATE — No
IsProcessingguard on/clear: Added guard to prevent mid-turn history clearing via slash command.🟡 MODERATE — Misleading success message: Both Dashboard and Sidebar now use conditional messages based on
ClearHistoryAsyncreturn value instead of unconditionally claiming server truncation.🟡 MODERATE —
MessageCountdesync: Both call sites now syncMessageCount = History.Countafter adding the system message.🟢 MINOR — Integration test passes vacuously: Changed
returntoAssert.Skip()so CI reports the test as skipped rather than silently passed.All 3664 tests pass.
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.