Skip to content

fix: address review findings round 3 (PR #813)#817

Closed
github-actions[bot] wants to merge 6 commits intomainfrom
fix/issue-645-2b4738eb
Closed

fix: address review findings round 3 (PR #813)#817
github-actions[bot] wants to merge 6 commits intomainfrom
fix/issue-645-2b4738eb

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Addresses expert review findings from round 3.

Fixes

  1. 🔴 CRITICAL — TruncateAsync called with wrong argument: Removed incorrect TruncateAsync(sessionId) call. SDK's HistoryApi.TruncateAsync requires an eventId parameter, not a session ID. The SDK lacks a "clear all history" overload (documented as SDK-gap). Method now returns bool indicating whether a live SDK session existed.

  2. 🟡 MODERATE — chat_history.db not cleared: Added _chatDb.ClearSessionAsync() call to prevent LoadBestHistoryAsync from restoring cleared messages on restart. Added ClearSessionAsync to IChatDatabase interface.

  3. 🟡 MODERATE — LastReadMessageCount not reset: Now reset to 0 alongside MessageCount, preventing broken unread badges after clear.

  4. 🟡 MODERATE — No IsProcessing guard on /clear: Added guard to prevent mid-turn history clearing via slash command.

  5. 🟡 MODERATE — Misleading success message: Both Dashboard and Sidebar now use conditional messages based on ClearHistoryAsync return value instead of unconditionally claiming server truncation.

  6. 🟡 MODERATE — MessageCount desync: Both call sites now sync MessageCount = History.Count after adding the system message.

  7. 🟢 MINOR — Integration test passes vacuously: Changed return to Assert.Skip() so CI reports the test as skipped rather than silently passed.

All 3664 tests pass.

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 · ● 40.7M ·

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>
…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>
@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-2b4738eb 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