Skip to content

feat(clients): session groups, batch actions, inspector, and worktree-aware creation for native chat#110347

Merged
steipete merged 13 commits into
mainfrom
claude/macos-chat-sessions-2
Jul 18, 2026
Merged

feat(clients): session groups, batch actions, inspector, and worktree-aware creation for native chat#110347
steipete merged 13 commits into
mainfrom
claude/macos-chat-sessions-2

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The native macOS chat lacks the web chat's session-management depth: session groups, batch operations, a session inspector, and worktree-aware session creation (agent, parent, base ref). Round 3c of the macOS/web parity effort (follow-up to #109712, #109995, #110019; sibling of the model-controls and message-reader rounds).

Why This Change Was Made

Bring native session management to parity using shared OpenClawKit code so iOS can adopt the same surfaces.

  • Session management sheet (ChatSessionManagementViews.swift): group create/rename/delete backed by sessions.groups.list/put/rename/delete, session categorization via sessions.patch { category }, batch actions capped at 4 concurrent operations, and a per-session inspector.
  • Worktree-aware creation: sessions.create gains agentId, parentSessionKey, worktree, worktreeBaseRef on the native transport (MacGatewayChatTransport+SessionActions.swift), matching the gateway schema.
  • Transport contract hardening: the compatibility createSession default fails closed when a transport cannot honor agentID/worktreeBaseRef instead of silently creating the wrong session; regression test included.
  • Group mutations use the same read-modify-write groups.put contract as the web UI; the non-atomicity tradeoff is documented at the call site pending a revisioned gateway groups API.
  • i18n catalogs regenerated and translated for the new strings.

User Impact

macOS chat users can organize sessions into groups, batch-archive/delete, inspect session details, and start worktree sessions from a chosen base ref — matching the web chat.

Evidence

  • Shared OpenClawKit view-model suites green including the new fail-closed transport test (214 tests in the focused run).
  • Gateway contract proof: sessions.groups.* and sessions.create fields verified against packages/gateway-protocol/src/schema/sessions.ts and gateway handlers; AgentSummary wire field workspaceGit confirmed in generated protocol models.
  • macOS release build green; pnpm format:swift clean; pnpm lint:swift 0 violations; pnpm native:i18n:check changed=false; apple/android i18n vitest gates green.
  • Autoreview (branch mode): review-driven fixes applied (fail-closed default overload); final pass pending no accepted/actionable findings.

Review-driven hardening (seven autoreview cycles to clean)

  • New-session agent inference uses only authoritative identities; ambiguous ownership omits the parent instead of scanning the roster (regression-tested).
  • Reset fallback is scoped to plain new-session requests; advanced agent/worktree requests surface the unsupported error without mutating the current session.
  • sessionGroupsRevision on the view model keys the sidebar, group manager, and inspector; local mutations and remote sessionsChanged(reason: "groups") events both bump it, and remote events also refresh sessions since rename/delete rewrite member categories (contract mirrored from src/gateway/server-methods/sessions-groups.ts + ui/src/lib/sessions).
  • New-session popover no longer swallows load failures (error + retry), dismisses only after a session is actually created, and rejects empty agent catalogs.
  • Group create/rename/delete read-modify-write matches web exactly (app-sidebar-session-groups.ts:41, custom-groups.ts:27); the lost-update window is catalog-names-only (memberships survive sessions.groups.put) and is documented in code as an accepted tradeoff pending a revisioned gateway groups API.
  • Swedish "Repository root" translation corrected; popover strings translated across all locales.
  • Final validation: 907 shared tests / 81 suites green, macOS release build green, format/lint clean, native:i18n:check clean, branch autoreview "patch is correct (0.97)" with zero findings.

@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 18, 2026
@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. labels Jul 18, 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: 548ff4d120

ℹ️ 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".

if change.reason == "groups" {
self.sessionGroupsRevision += 1
let context = self.currentSessionSnapshot()
Task { await self.fetchSessions(limit: 50, sessionSnapshot: context) }

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 Use the full session refresh size for group events

When a sessions.changed event with reason groups is broadcast, this fetch replaces the current session roster with only 50 rows. The full-window sidebar and Sessions sheet initially load sessionListFetchLimit (200), and local group rename/delete also refresh at that size, so the follow-up event can race in and truncate the visible/cached session list after any group create/rename/delete, especially for users with more than 50 sessions. Use the same session-list limit here, or avoid refreshing sessions for catalog-only group changes.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the claude/macos-chat-sessions-2 branch from 548ff4d to c0df935 Compare July 18, 2026 06:10
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 5:43 AM ET / 09:43 UTC.

Summary
Adds shared native-chat session groups, batch session actions, a session inspector, and agent/worktree-aware session creation across macOS and shared OpenClawKit UI.

PR surface: Docs +1, Other +16485. Total +16486 across 51 files.

Reproducibility: yes. from source: start with more than 50 sessions, trigger a local or remote sessionsChanged(reason: "groups") event, and observe the handler refresh the roster with 50 instead of the normal full limit.

Review metrics: 1 noteworthy metric.

  • Group-event roster limit: 200 normal limit vs. 50 group-event limit. The new remote group-event path can replace a complete session roster with a partial one after a group mutation.

Root-cause cluster
Relationship: canonical
Canonical: #110347
Summary: This PR is a distinct follow-up in the native-chat parity sequence; the linked merged PRs establish adjacent prior capability rather than duplicate the remaining group-management and worktree-creation work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
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:

  • [P1] Replace the hard-coded group-event fetch limit with the canonical full session-list limit and add a regression test above 50 sessions.
  • [P1] Add redacted native runtime evidence for creating or renaming a group and creating a worktree session with selected options.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR contains useful test and build claims but no inspectable after-fix native runtime proof; add redacted recording, screenshots, terminal/live output, or logs showing group mutations and advanced session creation, then update the body for 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] After any local or remote group mutation, users with more than 50 sessions can have the visible and cached roster truncated until another full refresh.
  • [P1] This external feature PR still needs redacted, inspectable after-fix native runtime evidence for the visible group-management and advanced worktree-session flows before merge.

Maintainer options:

  1. Restore full roster refreshes (recommended)
    Replace the hard-coded 50-session refresh for group events with the canonical session-list limit and add regression coverage for a roster exceeding 50 sessions.
  2. Accept partial roster refreshes
    Intentionally retain the 50-session event refresh only if maintainers explicitly accept that group mutations may temporarily hide older sessions until a manual full refresh.

Next step before merge

  • [P1] The protected maintainer label, feature-direction choice, contributor-owned runtime proof, and visible native behavior make this a human review path rather than an automated repair job.

Maintainer decision needed

  • Question: Should native macOS/iOS session-management parity remain an actively sponsored shared-OpenClawKit feature after the roster-refresh repair and runtime proof are supplied?
  • Rationale: This is a large new user-facing native-client capability rather than an established bug fix, and the protected maintainer label requires an explicit owner judgment on scope and landing priority.
  • Likely owner: steipete — Recent merged native-chat session work makes this person the strongest available routing candidate for the intended feature boundary.
  • Options:
    • Sponsor the parity round (recommended): Keep the shared native session-management direction, require the focused roster fix and real native behavior proof, then review the exact rebased head.
    • Narrow the scope: Land only a smaller approved subset, such as group browsing and basic mutations, and move batch actions or worktree options to separately sponsored work.
    • Pause native parity expansion: Defer this feature direction until a maintainer defines a narrower cross-platform native-chat roadmap.

Security
Cleared: The reviewed diff adds native UI, gateway request encoding, tests, docs, and generated localization data without introducing dependency, workflow, permission, secret, or artifact-execution changes.

Review findings

  • [P2] Preserve the full session-list fetch limit for group events — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+TransportEvents.swift:43-45
Review details

Best possible solution:

Use the canonical full session-list fetch limit for group-change refreshes, add a regression case covering a roster above 50 sessions, then provide redacted native runtime proof for group management and worktree-aware creation.

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

Yes, from source: start with more than 50 sessions, trigger a local or remote sessionsChanged(reason: "groups") event, and observe the handler refresh the roster with 50 instead of the normal full limit.

Is this the best way to solve the issue?

No, not until the group-event refresh uses the canonical session-list limit; the broader shared-UI approach is otherwise a plausible parity path subject to maintainer sponsorship.

Full review comments:

  • [P2] Preserve the full session-list fetch limit for group events — apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+TransportEvents.swift:43-45
    This new groups branch hard-codes 50, whereas the sidebar and session manager use the full session-list limit of 200. A group create, rename, or delete can therefore race this event refresh and replace a larger visible roster with only 50 sessions. Use the same canonical limit and cover a roster larger than 50.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: The PR adds useful client capability but currently has a concrete session-list consistency defect with limited, recoverable blast radius.
  • merge-risk: 🚨 compatibility: The shared native transport and session-creation interface expand cross-client behavior and need explicit compatibility review before landing.
  • merge-risk: 🚨 session-state: The group-event refresh can leave the native client with a truncated session roster after mutating session grouping 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: The PR contains useful test and build claims but no inspectable after-fix native runtime proof; add redacted recording, screenshots, terminal/live output, or logs showing group mutations and advanced session creation, then update the body for 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 +16485. Total +16486 across 51 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 50 17534 1049 +16485
Total 51 17537 1051 +16486

What I checked:

Likely related people:

  • steipete: Authored the merged native session-detail and broader macOS/web chat-alignment work that this PR extends, as well as this follow-up implementation. (role: recent native-chat feature owner; confidence: high; commits: 75697ad3bf6c, bf754b8a344a; files: apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessionSidebar.swift, apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+SessionActions.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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-18T06:13:33.901Z sha c0df935 :: needs real behavior proof before merge. :: [P2] Preserve the full session-list fetch limit for group events
  • reviewed 2026-07-18T08:02:13.791Z sha 21c51bf :: needs real behavior proof before merge. :: [P2] Preserve the full session-list fetch limit for group events

@steipete
steipete force-pushed the claude/macos-chat-sessions-2 branch from c0df935 to 21c51bf Compare July 18, 2026 07:58
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 18, 2026
@steipete
steipete force-pushed the claude/macos-chat-sessions-2 branch from 21c51bf to 035c72e Compare July 18, 2026 09:40
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 18, 2026
@steipete
steipete merged commit 1cddec3 into main Jul 18, 2026
173 of 177 checks passed
@steipete
steipete deleted the claude/macos-chat-sessions-2 branch July 18, 2026 13:09
@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 19, 2026
…-aware creation for native chat (openclaw#110347)

* feat(clients): gateway session groups, batch operations, session inspector, and new-session options

* chore(i18n): translate session management strings and regenerate catalogs

* chore(i18n): complete translation artifacts for session management strings

* fix(clients): fail closed when a transport cannot honor agent or base-ref session options

* fix(clients): authoritative agent identity for new-session parents and revision-keyed sidebar group refresh

* fix(clients): refetch session groups on remote catalog events and correct Swedish repository-root translation

* fix(clients): resilient new-session popover, revision-keyed group manager, and popover string translations

* fix(clients): scope reset fallback to plain new-session requests and revision-key the inspector groups

* fix(clients): reject empty agent catalogs and refresh sessions on remote group events

* refactor(clients): drop unused agents fetch wrapper and runtime memberwise init flagged by periphery

* chore(i18n): realign locale artifacts after rebase onto model-controls main

* chore(clients): split session creation into the session-actions extension and realign i18n after ask-user main rebase

* chore(i18n): resync derived artifacts after question-card main rebase
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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. 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