Skip to content

refactor(macos): retire pre-July Gateway response fallbacks - #163389

Merged
steipete merged 1 commit into
mainfrom
deslop/l295-migrations-apps2-macos-20261002
Oct 2, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/l295-migrations-apps2-macos-20261002

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The macOS app retains a second preview renderer for Gateways predating January 2026 and a health-output parser for an app CLI path retired in December 2025.

User Impact

Supported July 2026 and newer Gateways keep the existing preview, cache, error, and health behavior. Connections to Gateways predating sessions.preview no longer fall back to chat.history. No stored data, schema, permissions, or public plugin SDK changes.

Why This Change Was Made

sessions.preview first shipped in v2026.1.21 on January 22; v2026.1.20 is the last release without it. The July baseline and current Gateway always register the method. Removing the alternate request deletes its duplicate text/tool/media renderer and history-only limits.

Health has received structured RPC JSON since December 8, 2025 (293b4960f39), before the first tag containing native app source, v2.0.0-beta1. Its CLI-noise extraction and obsolete noise-only test are unreachable. Clean JSON and malformed-input tests remain. The pairing list also now decodes only the paired-node fields it consumes; pending-request metadata and approval authority checks stay intact.

Release-note context: upgrades/connections from pre-July-2026 versions are no longer given the old preview RPC fallback. July-shaped replies retain the existing mapper. This is transport compatibility retirement, not a SQLite migration.

Evidence

  • Production reduction: 128 net lines; seven obsolete test lines removed.
  • Exact producer/tag history and all current callers checked. The whole large-file native census now covers 469 handwritten source/tooling files across both passes.
  • No mutable test-only route was added to GatewayConnection.shared; its test endpoint deliberately refuses networking. A native loader invocation against a July reply remains an explicit fixture gap. Existing server preview tests and exact-head hosted native compilation/tests provide the available contract proof.
  • macOS Crabbox broker access returned 401. No personal credentials were requested; hosted native CI is the selected gate.
  • Independent review passed at P0–P2; repository SwiftFormat and strict production SwiftLint passed. Both import-cycle checks report zero after incorporating the already-landed custody-type split 0f470aecdc1 for an inherited cycle.
  • Focused suites passed: 47 session-reader/preview tests, 15 Doctor auth tests, and 59 Doctor migration tests.
  • Exact-head hosted CI passed. Swift package job: 522s; native app test job: 607s. The edited HealthDecodeTests only loses the obsolete case; its retained current-input coverage ran in the native job.
  • Merged as 2a390ec087731f6251ad55362a3603138b58e8b6; merge ancestry and exact changed-file equality verified.

Local check-changed completed its static guards and macOS source lint, then full app lint reported two unchanged shared Chat UI functions at complexity 21 (limit 20): ChatViewModel+TransportEvents.swift:25 and ChatSessionSidebarGrouping.swift:5. Neither is in this diff; hosted native CI is green. These are recorded for the shared-owner follow-up.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 4:38 AM ET / 08:38 UTC.

ClawSweeper review

What this changes

The macOS app removes legacy session-preview and health-output fallbacks and stops decoding unused paired-node metadata.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused cleanup remains absent from current main and the latest release. No introduced correctness defect was found.

Likely related people: steipete (high-confidence routing based on prior merged macOS work).

Priority: P3
Reviewed head: 3f9ea44eb605895cb97262d34a2332423c27b509

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable cleanup with preserved supported-path semantics and candid validation limits.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER classification exempts this internal cleanup from external-contributor proof. The body discloses that the native preview loader was not exercised against a July reply; server tests and pending native CI are supplemental evidence, not a live run. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER classification exempts this internal cleanup from external-contributor proof. The body discloses that the native preview loader was not exercised against a July reply; server tests and pending native CI are supplemental evidence, not a live run. No stored-data contract changes.
Evidence reviewed 9 items Introduced change and verified merge boundary: Read the pinned merge-base-to-head diff and original preview blob. The test merge's raw parents are the pinned base followed by the exact PR head; its result changes only the same four files. The retained preview mapper, timeout, cache fallback, and error presentation remain equivalent.
Still necessary on current main: Current main retains both the chat-history preview fallback and JSON-noise extraction; comparing the central files against the reviewed head shows the intended retirement remains outstanding.
Latest release retains legacy behavior: The v2026.9.7 source still contains fetchHistorySnapshot, unknown-method handling, and the health decoder's extraction fallback. This PR is not obsolete release cleanup.
Findings None None.
Security None None.

How this fits together

The macOS app reads Gateway responses to populate session previews, health status, and pairing prompts. These decoders turn RPC payloads into native display state while existing connection and approval owners retain authority.

flowchart TD
  A[macOS menu and health refresh] --> B[Gateway RPC connection]
  B --> C[Structured Gateway responses]
  C --> D[Preview and health decoding]
  D --> E[Preview cache and native status]
  C --> F[Pairing list decoding]
  F --> G[Existing pairing approval owner]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other -135. Total -135 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 12 147 -135
Total 4 12 147 -135

Review metrics

None.

Technical review

Best possible solution:

Use the structured Gateway response path as the single native decoder while preserving supported preview, health, and pairing behavior.

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

Not applicable: this PR retires compatibility code rather than reporting a current bug; source and release contracts support the cleanup boundary.

Is this the best way to solve the issue?

Yes: removing the alternate renderer and unreachable CLI-noise parser is narrower than maintaining parallel decoders, and the supported response mapper remains equivalent.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d1ba4d9bdbd5.

Labels

Label changes:

  • add P3: This is bounded native cleanup of obsolete response handling, with no identified supported-workflow regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER classification exempts this internal cleanup from external-contributor proof. The body discloses that the native preview loader was not exercised against a July reply; server tests and pending native CI are supplemental evidence, not a live run. No stored-data contract changes.

Label justifications:

  • P3: This is bounded native cleanup of obsolete response handling, with no identified supported-workflow regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER classification exempts this internal cleanup from external-contributor proof. The body discloses that the native preview loader was not exercised against a July reply; server tests and pending native CI are supplemental evidence, not a live run. No stored-data contract changes.

Evidence

What I checked:

  • Introduced change and verified merge boundary: Read the pinned merge-base-to-head diff and original preview blob. The test merge's raw parents are the pinned base followed by the exact PR head; its result changes only the same four files. The retained preview mapper, timeout, cache fallback, and error presentation remain equivalent. (apps/macos/Sources/OpenClaw/SessionMenuPreviewView.swift:249, 3f9ea44eb605)
  • Still necessary on current main: Current main retains both the chat-history preview fallback and JSON-noise extraction; comparing the central files against the reviewed head shows the intended retirement remains outstanding. (apps/macos/Sources/OpenClaw/SessionMenuPreviewView.swift:249, d1ba4d9bdbd5)
  • Latest release retains legacy behavior: The v2026.9.7 source still contains fetchHistorySnapshot, unknown-method handling, and the health decoder's extraction fallback. This PR is not obsolete release cleanup. (apps/macos/Sources/OpenClaw/SessionMenuPreviewView.swift:286, c074824a27c9)
  • Supported release contract: The v2026.7.1-2 method catalog explicitly advertises sessions.preview with operator.read scope. Its annotated tag resolves to this source commit. The current catalog also records the method as present by July. (src/gateway/methods/core-descriptors.ts:160, 0790d9f593ad)
  • Older preview fallback lies outside current operator protocol: The January release without sessions.preview uses protocol v3. Current operator/UI connections require v4; the v3 window is limited to node clients and probes. Removing this preview fallback does not newly make those January operator connections incompatible. Public docs: docs/gateway/protocol/versioning.md. (docs/gateway/protocol/versioning.md:20, 3f9ea44eb605)
  • Health producer and historical cutover: Both HealthStore refresh and GatewayProcessManager readiness use Gateway health RPCs. GatewayChannel re-encodes the response payload as JSON, so CLI log noise cannot reach this decoder. The historical commit replaced the shell health invocation with ControlChannel.health in December 2025. (apps/macos/Sources/Clawdis/HealthStore.swift, 293b4960f39b)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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
steipete enabled auto-merge (squash) October 2, 2026 08:41
@steipete
steipete merged commit 2a390ec into main Oct 2, 2026
76 checks passed
@steipete
steipete deleted the deslop/l295-migrations-apps2-macos-20261002 branch October 2, 2026 08:45
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…#163389)

Remove the macOS menu's chat.history fallback for Gateways predating sessions.preview, first shipped in January 2026. Supported July+ replies continue through the existing preview mapper and cache.

Remove health stdout-noise salvage from a CLI route retired in December 2025, plus its obsolete test. Limit the private paired-node response model to the fields actually consumed; retain pending-request metadata and approval authority.

Release context: pre-July Gateway compatibility is retired without changing stored data or public plugin SDK contracts. Reviewed production reduction: 128 lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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