Skip to content

fix(chat): hide completed sessions from picker - #1016

Merged
shanselman merged 1 commit into
mainfrom
shanselman-hide-completed-chat-sessions
Jul 18, 2026
Merged

shanselman merged 1 commit into
mainfrom
shanselman-hide-completed-chat-sessions

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The main Chat composer session picker listed cleanly completed sessions even though the Sessions page hides those same sessions when Show completed is off. On the live gateway payload, 37 done sessions—including many 20–29 days old—were offered in the Chat picker.

Why This Change Was Made

Reuse the existing SessionVisibilityFilter.IsCleanCompleted contract when projecting gateway SessionInfo into ChatThread, then exclude only ChatThreadStatus.Completed from the composer picker. Aborted, failed, killed, timeout, unknown, running, and suspended sessions remain visible. A currently selected completed conversation remains viewable but is not re-added to the dropdown.

User Impact

The Chat session dropdown stays focused on sessions that may still need attention. The Sessions page and its Show completed toggle are unchanged.

Evidence

  • Live app.sessions payload: 61 rows — 37 done, 23 unknown, 1 killed.
  • Current-head live WinUI visual tree: the open Chat picker contained exactly the eight non-cron survivors (7 unknown, 1 killed) and no done rows.
  • LVT proof used the shipping WinUI/FunctionalUI picker against the existing user gateway data; screenshot and XML tree were captured locally.
  • Independent rubber-duck review: CLEAN, including selected-completed-thread and synthetic-compose behavior.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Validation

  • ./build.ps1 — passed; Shared, CLI, WinNode CLI, SetupEngine, and WinUI built successfully.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore — 2,901 passed, 31 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore — 1,820 passed, 0 failed.
  • Focused session visibility/provider selector — 21 passed, 0 failed.
  • git diff --check — passed.
  • Structured autoreview bundle was valid (14 KB), but local reviewer CLIs were unavailable before analysis: Codex refused its isolated %TEMP% helper runtime, installed Claude Code lacked required safe-mode support, and Pi returned a connection error. Independent rubber-duck review completed cleanly.

Real Behavior Proof

  • Environment tested: Windows 11, live existing gateway/user data, release/default app identity.
  • PR head or commit tested: f9d4a62a.
  • Exact steps or command run: launched run-app-local.ps1 -NoBuild -AllowNonMain, navigated to Chat through local MCP, opened the session picker, dumped the live visual tree with lvt, and compared picker rows with winnode --command app.sessions.
  • Evidence after fix: 37 clean-completed rows were absent; the picker contained only non-cron unknown/killed rows from the live payload.
  • Observed result: completed sessions no longer appear in the main Chat dropdown; the selected conversation remains visible.
  • Screenshot or artifact links verified? N/A — copied live MCP/LVT diagnostics above; local screenshot captured but not uploaded.
  • Not verified or blocked: no remaining behavior blocker.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f0e93ff-d320-454d-b00a-865dac727d0c
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 3:01 AM ET / 07:01 UTC.

Summary
The branch classifies cleanly completed gateway sessions as completed chat threads and filters those threads from the Chat composer session picker while retaining non-clean terminal sessions.

Reproducibility: yes. —source-level reproduction is high confidence: the current mapping gives all gateway sessions Running status and the picker admits those threads except cron sessions, so clean done sessions are eligible. The contributor also reports a matching live gateway/WinUI reproduction at the PR head.

Review metrics: 2 noteworthy metrics.

  • Focused test coverage: 67 test lines added across 2 test files. The change directly covers gateway-session classification and composer-picker filtering, including the aborted-session compatibility case.
  • Patch scope: 6 files affected; 84 additions, 4 deletions. The production change is narrowly scoped to shared session visibility and the two chat projection/picker call sites.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No mechanical repair is indicated; this PR needs ordinary maintainer merge review and completion of its already-running checks.

Security
Cleared: The diff changes in-process chat-session classification and tests only; it adds no dependencies, permissions, credential handling, network calls, or command-execution surface.

Review details

Best possible solution:

Merge this focused reuse of SessionVisibilityFilter.IsCleanCompleted after the remaining required CI checks pass, preserving the existing Sessions-page toggle and keeping aborted, failed, killed, timeout, unknown, running, and suspended sessions visible.

Do we have a high-confidence way to reproduce the issue?

Yes—source-level reproduction is high confidence: the current mapping gives all gateway sessions Running status and the picker admits those threads except cron sessions, so clean done sessions are eligible. The contributor also reports a matching live gateway/WinUI reproduction at the PR head.

Is this the best way to solve the issue?

Yes—the patch is the narrowest maintainable fix because it reuses the existing clean-completion contract rather than creating a second status interpretation or changing the Sessions-page visibility setting.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8e79aceb5571.

Label changes

Label changes:

  • add P2: This is a confirmed user-facing Chat picker correctness fix with limited blast radius and a focused implementation.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a concrete after-fix Windows 11 live-gateway run at the PR head, including the invoked app/MCP/LVT path and observed counts showing completed rows absent from the picker.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides a concrete after-fix Windows 11 live-gateway run at the PR head, including the invoked app/MCP/LVT path and observed counts showing completed rows absent from the picker.

Label justifications:

  • P2: This is a confirmed user-facing Chat picker correctness fix with limited blast radius and a focused implementation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides a concrete after-fix Windows 11 live-gateway run at the PR head, including the invoked app/MCP/LVT path and observed counts showing completed rows absent from the picker.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a concrete after-fix Windows 11 live-gateway run at the PR head, including the invoked app/MCP/LVT path and observed counts showing completed rows absent from the picker.
Evidence reviewed

What I checked:

  • Current picker path: The pre-change ToThread mapping shown in the PR diff assigns ChatThreadStatus.Running to every gateway SessionInfo, while the picker groups all snapshot threads except cron sessions; therefore clean done sessions are currently eligible for the picker. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs:6016, 8e79aceb5571)
  • Narrow shared visibility contract: The proposed SessionVisibilityFilter.ToChatThreadStatus delegates clean-completion classification to the existing IsCleanCompleted predicate, and VisibleChatPickerThreads excludes only the new completed thread status. (src/OpenClaw.Tray.WinUI/Services/SessionVisibilityFilter.cs:21, f9d4a62a6cee)
  • Selected-session preservation: The picker fallback now adds an effective thread only when it is visible in the picker, which prevents a selected completed conversation from being reintroduced into the dropdown while leaving the active conversation available to the chat surface. (src/OpenClaw.Tray.WinUI/Chat/OpenClawChatRoot.cs:560, f9d4a62a6cee)
  • Focused regression coverage: The PR adds provider mapping coverage for clean done, aborted-done, and unknown sessions plus filter coverage for done/completed/aborted semantics and picker inclusion behavior. (tests/OpenClaw.Tray.Tests/SessionVisibilityFilterTests.cs:81, f9d4a62a6cee)
  • Contributor validation and runtime proof: The PR body reports required build and shared/tray test passes, then a live Windows 11 gateway run at the PR head where an LVT picker inspection contained the non-completed survivors and excluded 37 clean-completed sessions. (f9d4a62a6cee)

Likely related people:

  • shanselman: The supplied PR metadata identifies this contributor as author of the single commit that introduces the session-status mapping and picker filter; current-main feature-history attribution could not be reconstructed from the read-only execution environment. (role: proposed focused repair author; confidence: low; commits: f9d4a62a6cee; files: src/OpenClaw.Tray.WinUI/Services/SessionVisibilityFilter.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatRoot.cs, src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@shanselman
shanselman merged commit 258f838 into main Jul 18, 2026
19 checks passed
@shanselman
shanselman deleted the shanselman-hide-completed-chat-sessions branch July 18, 2026 07:16
shanselman added a commit that referenced this pull request Jul 20, 2026
Resolve conflicts in OpenClawChatDataProvider and OpenClawChatRoot:
- Keep SessionPresentationResolver.AgentId/IsBackground from PR branch
- Keep SessionVisibilityFilter.ToChatThreadStatus (ended-session) from main (#1016/#1017)
- Keep SessionVisibilityFilter.VisibleChatPickerThreads picker filtering from main
- Both filters (background + ended) applied in sequence in ChatRoot

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: c311ae3b-8656-403f-91a6-5bfe2f91f5cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant