Skip to content

feat(macos): session detail parity β€” row actions, unread auto-clear, and subagent tree in native chat#110019

Merged
steipete merged 4 commits into
mainfrom
claude/macos-chat-session-details
Jul 17, 2026
Merged

feat(macos): session detail parity β€” row actions, unread auto-clear, and subagent tree in native chat#110019
steipete merged 4 commits into
mainfrom
claude/macos-chat-session-details

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The native macOS chat sidebar covers a fraction of the web chat's session management: rows only offer pin/copy/delete, opening a session never clears its unread marker, there is no rename or fork or archive outside the manager sheet, and subagent/child sessions render as a flat list with no run-state visibility.

Why This Change Was Made

Round 2 of native/web chat alignment (follow-up to #109712), scoped to session details:

  • Sidebar rows gain Rename…, Fork, Archive/Restore, Mark Read/Unread alongside Pin/Copy/Delete; the toolbar session menu gains "Rename Session…". Empty rename clears the custom label (explicit label: null).
  • Opening a session now clears its unread marker exactly once per successful live activation, mirroring the web semantics: failed patches re-arm on the next activation, stale in-flight list snapshots cannot revert a just-clicked Mark Read/Unread (pending explicit mutations overlay list, cache-restore, and rollback assignments), and explicit actions use per-session FIFO ordering with canonical routed identities and route leases.
  • The sidebar builds a cycle-safe session tree from sessions.list hierarchy metadata (childSessions authoritative; parentSessionKey/spawnedBy as metadata β€” field contract verified against src/gateway/session-utils.types.ts): children nest under parents with disclosure, and collapsed parents aggregate running/failed/unread descendant badges. Flat fallback when no hierarchy data is present.
  • Archive is blocked for main/global aliases and sessions with active runs.
  • Fork uses the existing sessions.create contract with parentSessionKey + fork. No new RPCs, settings, or protocol changes.

User Impact

Everyday session management no longer requires the manager sheet or the web UI: rename, fork, archive, and read-state control live on the row; unread dots behave like the web; and subagent activity is visible at a glance with nesting and status badges.

Evidence

  • swift build --package-path apps/shared/OpenClawKit --target OpenClawChatUI and swift build --package-path apps/macos --configuration release β€” pass (re-verified after rebase onto landed main).
  • swift test --package-path apps/shared/OpenClawKit --parallel β€” 885 tests pass; swift test --package-path apps/macos --parallel β€” 1304 pass.
  • New coverage: sidebar tree construction (nesting, cycles, orphans, badge aggregation), unread guard episodes (14 tests) plus a stale-snapshot overlay regression, session action request encoding.
  • Structured review: one accepted finding (stale list snapshots could visually revert pending explicit unread mutations) fixed with a guard-owned override applied at every sessions assignment site; follow-up review clean.
  • pnpm lint:swift, pnpm format:swift, pnpm native:i18n:check, Apple/Android catalog tests β€” clean; new strings translated across all 21 locales.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: ios App: ios app: macos App: macos size: XL maintainer Maintainer-authored PR labels Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7dba609a79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +41 to +43
let request = OpenClawChatGatewayRequests.forkSession(
parentSessionKey: target.sessionKey,
agentID: target.agentID)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve parent agent when forking sessions

When the user forks an agent-qualified row such as agent:ops:dashboard:abc, sessionTarget(for:) preserves the full key but leaves target.agentID nil, so this sessions.create request omits agentId. The gateway does not infer the child owner from parentSessionKey (see src/gateway/server.sessions.create.test.ts:1747-1754), so macOS can create/open the fork under the current default agent instead of the parent’s agent; the Android sibling explicitly sends the captured owner for this case in apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt:925-936.

Useful? React with πŸ‘Β / πŸ‘Ž.

Comment on lines +238 to +242
guard self.isCurrentSession(session), self.hasAppliedLiveHistory,
let entry = self.currentSessionEntry() ?? fallbackEntry,
let revision = self.unreadPatchGuard.shouldPatch(
key: self.sessionMutationIdentity(for: entry.key, listedKey: entry.key),
unread: entry.unread)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear unread for searched sessions outside the cached list

If a user opens an old unread session from the Sessions sheet search, that row lives only in the sheet’s one-shot scopedSessions and is not merged into viewModel.sessions (ChatSheets.swift:31-43, 302-307). When the subsequent 50-row bootstrap refresh still omits the old row, both currentSessionEntry() and fallbackEntry are nil here, so no sessions.patch(unread=false) is sent and the opened session stays unread; carry the selected row into the view model or fetch the activated key explicitly before this guard.

Useful? React with πŸ‘Β / πŸ‘Ž.

@clawsweeper clawsweeper Bot added rating: πŸ¦ͺ silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: πŸ“£ needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 10:22 AM ET / 14:22 UTC.

Summary
Adds native macOS session row actions, unread auto-clear, hierarchical subagent display, shared session-mutation support, tests, documentation, and regenerated native localization catalogs.

PR surface: Docs +1, Other +6329. Total +6330 across 52 files.

Reproducibility: yes. from source with high confidence: fork an agent-qualified session to exercise the missing owner, or open an old unread session returned only by Sessions-sheet search to exercise the absent activation entry.

Review metrics: 1 noteworthy metric.

  • Unresolved prior findings: 2 unresolved: 1 P1, 1 P2. Both previously reported behavioral defects remain present on the latest head and affect session routing or visible state.

Merge readiness
Overall: πŸ¦ͺ silver shellfish
Proof: πŸ¦ͺ silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Fix both session-routing and unread-activation findings with focused regression coverage.
  • [P1] Add redacted after-fix macOS recording, screenshots, logs, or live output demonstrating the session actions and hierarchy.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Only builds, tests, lint, formatting, and catalog checks are supplied. Add redacted macOS screenshots or preferably a recording showing the changed workflows after the fixes; redact private session names, endpoints, keys, and other identifying data. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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] Agent-qualified forks can be created under the current default agent rather than the parent agent, mis-associating session ownership and subsequent routing.
  • [P1] Opening an old unread session through Sessions-sheet search can leave it marked unread because the selected row is absent from the cached and bounded bootstrap lists.
  • [P1] The contributor has not shown these broad native UI and session-state workflows running after the patch in a real macOS setup.

Maintainer options:

  1. Repair both session-state paths (recommended)
    Preserve fork ownership and searched-session unread metadata, add focused tests, and obtain real native behavior proof before merge.
  2. Pause the parity expansion
    Leave the PR open but do not merge until the agent-routing and off-list unread cases are corrected and demonstrated.

Next step before merge

  • [P1] The protected maintainer label and missing contributor-owned real behavior proof require normal human PR handling rather than an automated repair lane.

Security
Cleared: The diff adds native client behavior and generated localization data without introducing dependencies, workflow execution, broader permissions, secret access, or downloaded code.

Review findings

  • [P1] Pass the parent agent when forking sessions β€” apps/macos/Sources/OpenClaw/MacGatewayChatTransport+SessionActions.swift:38
  • [P2] Carry searched sessions into unread activation β€” apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift:796
Review details

Best possible solution:

Preserve the parent agent explicitly in fork requests, carry the selected searched session into unread activation, add focused regressions for both paths, and then demonstrate the corrected workflows in a signed macOS app run.

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

Yes, from source with high confidence: fork an agent-qualified session to exercise the missing owner, or open an old unread session returned only by Sessions-sheet search to exercise the absent activation entry.

Is this the best way to solve the issue?

No, not yet. The parity direction and existing contracts are appropriate, but the implementation must preserve parent ownership and pass selected-session metadata through the activation boundary.

Full review comments:

  • [P1] Pass the parent agent when forking sessions β€” apps/macos/Sources/OpenClaw/MacGatewayChatTransport+SessionActions.swift:38
    For an agent-qualified row such as agent:ops:dashboard:abc, sessionTarget(for:) can preserve the full key while leaving target.agentID nil. The gateway does not infer ownership from parentSessionKey, so this request can create and open the fork under the current default agent; derive and send the parent agent explicitly, matching the Android sibling.
    Confidence: 0.98
  • [P2] Carry searched sessions into unread activation β€” apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift:796
    A session opened from one-shot Sessions-sheet search may not exist in viewModel.sessions, and the bounded bootstrap refresh can omit it again. In that case currentSessionEntry() supplies no unread metadata, so no sessions.patch(unread=false) is sent; retain the selected row or fetch the activated key explicitly.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The patch can associate a fork with the wrong agent and break expected session behavior in a normal native-chat workflow.
  • add merge-risk: 🚨 session-state: Merging as written can mis-associate forked sessions and leave activated searched sessions with stale unread state.
  • add rating: πŸ¦ͺ silver shellfish: Overall readiness is πŸ¦ͺ silver shellfish; proof is πŸ¦ͺ silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: πŸ“£ needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only builds, tests, lint, formatting, and catalog checks are supplied. Add redacted macOS screenshots or preferably a recording showing the changed workflows after the fixes; redact private session names, endpoints, keys, and other identifying data. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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:

  • P1: The patch can associate a fork with the wrong agent and break expected session behavior in a normal native-chat workflow.
  • merge-risk: 🚨 session-state: Merging as written can mis-associate forked sessions and leave activated searched sessions with stale unread state.
  • rating: πŸ¦ͺ silver shellfish: Overall readiness is πŸ¦ͺ silver shellfish; proof is πŸ¦ͺ silver shellfish and patch quality is 🦐 gold shrimp.
  • status: πŸ“£ needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only builds, tests, lint, formatting, and catalog checks are supplied. Add redacted macOS screenshots or preferably a recording showing the changed workflows after the fixes; redact private session names, endpoints, keys, and other identifying data. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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

PR surface:

Docs +1, Other +6329. Total +6330 across 52 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 51 8422 2093 +6329
Total 52 8425 2095 +6330

What I checked:

Likely related people:

  • steipete: Authored the merged first-stage native chat parity work and has current-main history across the same macOS transport and shared OpenClawChatUI surfaces. (role: introduced current native chat parity behavior; confidence: high; commits: bf754b8a344a; files: apps/macos/Sources/OpenClaw/WebChatSwiftUI.swift, apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatWindowShell.swift, apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSheets.swift)
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.

@steipete
steipete merged commit 75697ad into main Jul 17, 2026
128 of 129 checks passed
@steipete
steipete deleted the claude/macos-chat-session-details branch July 17, 2026 14:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…and subagent tree in native chat (openclaw#110019)

* feat(clients): session detail parity β€” row actions, unread auto-clear, and subagent tree in the native chat sidebar

* fix(clients): overlay pending explicit unread values over stale session snapshots

* chore(i18n): translate new session action strings and regenerate Apple/Android catalogs

* chore(clients): delete dead pin helper and worktree memberwise init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: ios App: ios app: macos App: macos docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: πŸ¦ͺ silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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