Skip to content

fix(macos): restore Group badges for opaque session keys - #126807

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-168-macos-session-kind
Aug 20, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-168-macos-session-kind

Conversation

@steipete

@steipete steipete commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #126805

Additional instructions

Maintainers can directly edit this repository-owned branch.

What Problem This Solves

Fixes an issue where macOS users inspecting the native Settings → Threads pane would see no Group badge for a group conversation when its provider-owned session key was opaque. The Gateway already identifies these sessions correctly, but the native macOS list was silently treating them as direct conversations. Existing green Cron badges must remain unchanged.

Why This Change Was Made

The native Threads loader owned a second private copy of the Gateway session-list response that dropped authoritative session kind/classification and then guessed the kind from key spelling. Reusing the existing shared Swift response model removes that duplicated decoding path, preserves the Gateway’s group classification, applies cron classification before its legacy direct wire kind, maps unsupported or missing kinds to Unknown, and continues rejecting a missing session-store path. Unused native-only session fields and their constructor noise are removed. No Gateway protocol, schema, configuration, persistence, authentication, or security behavior changes.

User Impact

Group conversations with opaque provider-owned keys now display their orange Group badge in the native macOS Threads settings pane when native panes are enabled. Scheduled conversations continue displaying their green Cron badge, while direct, global, and unknown sessions retain their intended native presentation.

Evidence

  • Reproduced the defect before changing production code: the new decoded-wire regression returned seven direct classifications instead of the expected group/cron/unknown/direct/global results.
  • Focused native regression: swift test --package-path apps/macos --filter SessionDataTests — 4 tests passed, including opaque group, opaque cron with legacy direct wire kind, unsupported kind, missing kind, direct, global, and known unknown.
  • Complete macOS Swift suite: 1,706 tests in 178 suites passed; includes Quick Chat, menu-session, Threads, and settings sibling coverage.
  • Shared Swift response/chat package: 1,387 tests in 104 suites passed; all 39 ChatSessionSidebarModelTests passed separately.
  • Production-configuration native build: swift build --package-path apps/macos --product OpenClaw --configuration release passed.
  • ./scripts/lint-swift.sh macos and ./scripts/format-swift.sh macos passed with zero violations.
  • Complete repository-selected check:changed macOS lane passed, including seven Vitest shards / 487 targeted Node tests, dependency guards, formatting, and the native state schema guard.
  • Real isolated Gateway + two synthetic SQLite-owned sessions; no real channels, accounts, provider requests, transcripts, nodes, or operator state. Before and after used the same task-owned macOS bundle path, the same actual Developer ID signing identity, a dedicated isolated profile/state/Gateway port, and the native Settings → Threads view. Both images were personally inspected and contain synthetic data only.
  • Fresh Codex-backed P1 structured review: clean. Separate independent adversarial source/contract/sibling/UI review: clean, no P0/P1/P2 findings.
  • Production: +11/-68 (net -57 lines). Tests: +19/-23 (net -4 lines). Risk: low; native macOS session-list presentation only.

Before

Before: synthetic scheduled session keeps its green Cron badge while the opaque group has no badge

After

After: synthetic scheduled session keeps its green Cron badge and the opaque group now has an orange Group badge

AI-assisted: yes

@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: S maintainer Maintainer-authored PR labels Aug 20, 2026
@steipete
steipete marked this pull request as ready for review August 20, 2026 19:05
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 94052b0a98ca8bb742f59d465af6e52df5f73023:

  • Issue [Bug]: macOS Threads hides Group badge for opaque session keys #126805 reproduced with a failing-before decoded-wire regression and a real signed native Settings → Threads screenshot.
  • Owner-boundary fix reuses the existing shared Swift Gateway response model; cron classification precedes legacy direct, unsupported/missing kinds become Unknown, and required session-store path handling remains strict.
  • Before and after screenshots in the PR body show the orange Group badge restored for an opaque synthetic group while the green synthetic Cron badge remains unchanged. Both were captured from the same Developer-ID-signed task-owned app against an isolated synthetic-only Gateway/profile.
  • Full macOS Swift suite: 1,706 tests / 178 suites passed. Full shared Swift suite: 1,387 tests / 104 suites passed, including 39 chat-sidebar sibling tests.
  • Production-configuration macOS build, SwiftLint, SwiftFormat, and complete check:changed macOS gate passed; the latter ran 487 targeted Node tests across seven shards.
  • Exact-head GitHub CI: https://github.com/openclaw/openclaw/actions/runs/32406770357 — macos-swift, macos-node, and openclaw/ci-gate all passed.
  • Fresh Codex-backed P1 structured review and separate independent adversarial review: clean, no actionable findings. ClawSweeper has acknowledged/started review; no findings or Rank-up moves have been posted.
  • Production +11/-68 (net -57); tests +19/-23 (net -4). No Gateway protocol/schema, storage, config, authentication, security, release, or changelog changes.
  • Native scripts/pr exact-head review artifacts validate as READY FOR /prepare-pr, with a passing behavioral sweep and zero findings.

Proceeding through the mandatory native hosted/Testbox preparation and merge gates; no CI bypass or raw merge.

@steipete
steipete merged commit c7322d7 into main Aug 20, 2026
109 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/autoqa-168-macos-session-kind branch August 20, 2026 19:19
@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 3:12 PM ET / 19:12 UTC.

ClawSweeper review

What this changes

The PR replaces macOS’s private Gateway session decoder with the shared Swift response model so Threads badges use Gateway-provided session kind metadata.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: this is a focused, source-supported repair for the linked macOS badge defect, with no blocking correctness finding. It is maintainer-authored and needs the normal exact-head CI/merge review path.

Priority: P2
Reviewed head: 94052b0a98ca8bb742f59d465af6e52df5f73023

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative owner-boundary repair with relevant decoding coverage and no concrete review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body additionally provides redacted before/after native UI screenshots and an isolated-run account.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body additionally provides redacted before/after native UI screenshots and an isolated-run account.
Evidence reviewed 7 items Current-main defect: Current main uses a private macOS decoder that omits both kind and classification, then infers the badge solely from session-key spelling; opaque group keys therefore fall through to direct.
Gateway producer contract: The Gateway derives kind from persisted chat type and emits group for group sessions, including opaque provider-owned keys; it separately emits classification facts for clients.
Shared Swift contract: The shared response entry retains optional kind and classification, so the macOS loader can consume the Gateway wire shape without a duplicate local record.
Findings None None.
Security None None.

Live Verification

Command: swift test --package-path apps/macos --filter SessionDataTests

Result: FAIL (failed) — execution before step 1 run: runner@runnervm76f27:/tmp/clawsweeper-live-proof-126807-eZ0bgS/target$ swift test --package-path apps/macos --filter SessionDataTests

runner@runnervm76f27:/tmp/clawsweeper-live-proof-126807-eZ0bgS/target$ swift test --package-path apps/macos --filter SessionDataTests


















































Assertions:

  • FAIL expect_output: SessionDataTests

How this fits together

The Gateway classifies session rows and returns them through its session-list response. The shared Swift model decodes that response, and the macOS Threads settings pane maps the result to Group, Cron, and other badges.

flowchart LR
A[Gateway session classification] --> B[Session-list response]
B --> C[Shared Swift response model]
C --> D[macOS session loader]
D --> E[Threads badge presentation]
Loading

Before merge

  • Complete next step (P2) - An active maintainer-authored PR already owns the repair; it should proceed through normal exact-head validation rather than a separate repair lane.
Agent review details

Security

None.

PR surface

Other -61. Total -61 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 30 91 -61
Total 4 30 91 -61

Review metrics

Metric Value Why it matters
Production versus tests production +11/-68 (net -57); tests +19/-23 (net -4) The repair deletes the duplicate local decoder and unused row fields while adding a compact wire-decoding regression case.

Stored data model

Persistent data-model change detected: vector/embedding metadata: apps/macos/Tests/OpenClawIPCTests/SessionDataTests.swift. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #126805
Summary: This PR is the focused candidate fix for the linked opaque-session-key badge defect.

Members:

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

Technical review

Best possible solution:

Land the shared-model decoding path after exact-head macOS validation so native badges continue to reflect Gateway-owned classification rather than key spelling.

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

Yes, by source: current main drops Gateway kind/classification before the macOS badge mapping, while the Gateway explicitly classifies opaque provider-owned group sessions. This read-only review did not execute the native test or app.

Is this the best way to solve the issue?

Yes. Reusing the existing shared response contract removes the duplicate decoder and preserves the Gateway as the classification owner; expanding key-shape heuristics would retain the bug class.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a deterministic native settings-pane classification defect with limited user impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This repairs a deterministic native settings-pane classification defect with limited user impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the repair and the earlier substantial macOS session feature work. (role: feature owner and current repair author; confidence: high; commits: 94052b0a98ca, 5143d909b96d; files: apps/macos/Sources/OpenClaw/SessionData.swift)
  • Dallin Romney: Current-main blame attributes the pre-fix private decoder and key-heuristic mapping to this baseline commit; shallow history prevents stronger origin attribution. (role: recent source-baseline contributor; confidence: medium; commits: cc3877154015; files: apps/macos/Sources/OpenClaw/SessionData.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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

Copy link
Copy Markdown
Contributor Author

Post-merge clarification for the ClawSweeper review, which was published after the native landing completed:

  • The sole P2 “Complete next step” was satisfied: exact-head macos-swift, macos-node, and openclaw/ci-gate passed in https://github.com/openclaw/openclaw/actions/runs/32406770357, followed by validated native review artifacts, the OPENCLAW_TESTBOX=1 hosted gate, and the native merge.
  • The bot’s Linux proof runner could not execute the macOS Swift command; the same focused regression and the full 1,706-test macOS suite both passed on macOS, and the PR body contains real signed, isolated before/after native screenshots.
  • “Persistent data-model change detected” is a false positive against a Swift test fixture: the complete change is four macOS Swift files only; no persistence, SQLite schema, migration, vector, embedding, Gateway protocol, or configuration files changed.

ClawSweeper reported no correctness or security findings; all actionable review requirements were satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS Threads hides Group badge for opaque session keys

1 participant