Skip to content

fix(sessions): classify terminal sessions as ended - #1017

Merged
shanselman merged 1 commit into
mainfrom
shanselman-classify-ended-sessions
Jul 18, 2026
Merged

shanselman merged 1 commit into
mainfrom
shanselman-classify-ended-sessions

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The Sessions page toggle said Show completed, but the default filter hid only successful done/completed sessions. Failed, killed, and timed-out sessions remained mixed with active sessions even though they are terminal from a UI perspective.

Why This Change Was Made

Rename the UI concept to Show ended and define ended sessions as done, completed, failed, killed, or timeout. Unknown, running, suspended, and AbortedLastRun sessions remain visible because they may still be valid or need attention. The existing persisted ShowCompletedSessions key, XAML names, automation ID, and resource key remain unchanged for compatibility.

User Impact

With Show ended off, both the Sessions page and main Chat picker focus on active, unknown, suspended, or aborted sessions. Turning it on reveals all terminal outcomes.

Evidence

  • Live gateway payload previously contained 37 done, 23 unknown, and 1 killed session.
  • Current-head native Sessions page visibly shows the new Show ended label.
  • Focused tests cover all five terminal statuses, unknown/running visibility, aborted exemption, show-ended pass-through, Chat thread mapping, and picker filtering.
  • Independent rubber-duck review: CLEAN.

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; all five projects built.
  • 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,823 passed, 0 failed.
  • Focused status/provider/localization selector — 39 passed, 0 failed.
  • git diff --check — passed.

Real Behavior Proof

  • Environment tested: Windows 11, real existing gateway/user data, release/default identity.
  • PR head or commit tested: 15c7b0a1.
  • Exact steps: launched run-app-local.ps1 -NoBuild -AllowNonMain, navigated to Sessions through local MCP, and inspected the native accessibility tree.
  • Evidence after fix: toggle label is Show ended; tests confirm ended rows hide by default while unknown and aborted rows remain.
  • Observed result: UI terminology and filtering now match the terminal lifecycle model.
  • Screenshot or artifact links verified? N/A; copied native UI diagnostics above.
  • Not verified or blocked: none.

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; persisted setting key retained.
  • 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 rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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 real behavior proof before merge. Reviewed July 18, 2026, 4:45 PM ET / 20:45 UTC.

Summary
The PR renames the completed-session UI to ended-session filtering and treats failed, killed, and timed-out sessions as terminal in both the Sessions page and Chat picker.

Reproducibility: yes. source-reproducible: the base-side filter described in the PR hides only done and completed, leaving other terminal statuses visible. The claimed live after-fix UI verification is not yet backed by an inspectable artifact.

Review metrics: 1 noteworthy metric.

  • Patch scope: 9 files affected; 48 added, 38 removed. The change is tightly scoped to session lifecycle filtering, Chat mapping, localization, and regression tests.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

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

Rank-up moves:

  • Attach a redacted current-head accessibility-tree capture or terminal transcript that shows the “Show ended” control and terminal-session filtering result.
  • [P1] After adding proof, update the PR body so a fresh ClawSweeper review can assess it; if needed, ask a maintainer to comment @clawsweeper re-review.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR describes a real Windows accessibility-tree inspection but provides no copied diagnostic output, screenshot, recording, log, or linked artifact demonstrating the current-head result; add redacted runtime evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The compatibility-preserving code and tests are present, but the claimed native UI result is not independently inspectable from the PR body; merge should wait for redacted current-head runtime evidence.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared terminal-status predicate and compatible persisted toggle key, then attach a redacted current-head accessibility-tree capture or terminal transcript showing “Show ended” and the resulting visible/hidden session behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No code repair is indicated; the remaining merge gate is contributor-supplied real runtime proof, which automation cannot generate for the contributor’s environment.

Security
Cleared: The diff changes local session classification, UI text, localization, and tests without adding dependencies, privileges, network access, secrets handling, or executable supply-chain surface.

Review details

Best possible solution:

Keep the shared terminal-status predicate and compatible persisted toggle key, then attach a redacted current-head accessibility-tree capture or terminal transcript showing “Show ended” and the resulting visible/hidden session behavior.

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

Yes, source-reproducible: the base-side filter described in the PR hides only done and completed, leaving other terminal statuses visible. The claimed live after-fix UI verification is not yet backed by an inspectable artifact.

Is this the best way to solve the issue?

Yes, the shared predicate is the narrowest maintainable solution because it keeps Sessions and the Chat picker aligned while retaining the existing persisted setting key and aborted-session exception.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 258f83858dc7.

Label changes

Label changes:

  • add P2: This is a bounded user-facing session-management correctness fix without evidence of data loss, security impact, or runtime unavailability.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR describes a real Windows accessibility-tree inspection but provides no copied diagnostic output, screenshot, recording, log, or linked artifact demonstrating the current-head result; add redacted runtime evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded user-facing session-management correctness fix without evidence of data loss, security impact, or runtime unavailability.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR describes a real Windows accessibility-tree inspection but provides no copied diagnostic output, screenshot, recording, log, or linked artifact demonstrating the current-head result; add redacted runtime evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Focused lifecycle change: The PR centralizes the broader terminal-state definition in SessionVisibilityFilter, preserving AbortedLastRun visibility while mapping terminal sessions to the Chat picker’s ended state. (src/OpenClaw.Tray.WinUI/Services/SessionVisibilityFilter.cs, 15c7b0a180ad)
  • Regression coverage: The branch updates filter and chat-provider coverage for the five ended statuses, active/unknown visibility, aborted-session handling, and picker filtering. (tests/OpenClaw.Tray.Tests/SessionVisibilityFilterTests.cs, 15c7b0a180ad)
  • Feature provenance: Current main history identifies TurboTheTurtle as the author of the earlier completed-session filtering change, commit b37b1bef0a0c302cd027eb45c72191dd25aea534, making that contributor the strongest routing candidate for the lifecycle semantics. (github.com) (src/OpenClaw.Tray.WinUI/Services/SessionVisibilityFilter.cs, b37b1bef0a0c)
  • Repository proof policy: The applicable repository policy requires visible current-head proof for tray UX changes; the PR’s prose claims accessibility-tree inspection but contains no copied diagnostics, screenshot, recording, log, or linked artifact to inspect. (AGENTS.md)

Likely related people:

  • TurboTheTurtle: Authored the current-main commit that introduced the completed-session hiding behavior this patch extends. (role: introduced completed-session filtering; confidence: high; commits: b37b1bef0a0c; files: src/OpenClaw.Tray.WinUI/Services/SessionVisibilityFilter.cs, tests/OpenClaw.Tray.Tests/SessionVisibilityFilterTests.cs)
  • shanselman: Current main history shows prior merged work in the Chat surface, adjacent to the picker-status mapping changed here. (role: recent chat-area contributor; confidence: medium; commits: 14022dc, 0b8ba41; files: src/OpenClaw.Chat/ChatModels.cs, tests/OpenClaw.Tray.Tests/OpenClawChatDataProviderTests.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 ee4817d into main Jul 18, 2026
19 checks passed
@shanselman
shanselman deleted the shanselman-classify-ended-sessions branch July 18, 2026 21:02
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. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant