feat(sessions): consume flattened gateway classification - #1069
Conversation
|
Codex review: needs changes before merge. Reviewed August 1, 2026, 3:18 PM ET / 19:18 UTC. ClawSweeper reviewWhat this changesThis PR migrates Windows session parsing and tray/chat display logic from a nested Gateway presentation object to flattened session classification fields and a local display resolver. Merge readiness⛔ Blocked until stronger real behavior proof is added - 10 items remain This PR is still necessary but needs changes before merge. It removes a currently supported nested Gateway session payload without retaining that payload as a fallback, and its direct-session privacy guard still accepts Priority: P1 Review scores
Verification
How this fits togetherGateway session payloads are parsed into shared Windows session models, then tray and chat surfaces derive titles, filtering, background state, and agent metadata. This PR changes the compatibility boundary between Gateway-owned session facts and Windows-local display/privacy policy. flowchart LR
Gateway[Gateway session payload] --> Parser[Windows session parser]
Parser --> Facts[Session facts and fallbacks]
Facts --> Resolver[Local display resolver]
Resolver --> Privacy[Direct-peer privacy decision]
Privacy --> Tray[Tray session lists]
Privacy --> Chat[Chat thread projection]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch does not add an execution or dependency surface, but its direct-session display fallback can disclose peer-derived data in user-visible Windows UI. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Prefer flattened fields when present, preserve the existing nested presentation parser as a strictly lower-priority compatibility fallback until the Gateway contract change is shipped, and make all direct-session peer-derived title candidates resolve to the local safe generated title. Do we have a high-confidence way to reproduce the issue? Yes, by source: a session with Is this the best way to solve the issue? No. The flattened contract is a reasonable primary path, but deleting the existing nested path contradicts the stated older-Gateway compatibility claim, and the direct-session title policy must cover Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ac00c5f4977. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
What Problem This Solves\n\nWindows sessions cannot use the new Gateway-derived facts without decoding an unshipped nested session object. That object duplicates existing title fields and makes the app display policy depend on Gateway-owned strings.\n\n## Why This Change Was Made\n\nThis removes the nested session DTO and consumes the Gateway flattened classification, agentId, accountId, peerKind, isMain, and isBackground fields directly. Windows retains its local, localized title resolver and suppresses transport-derived direct-peer display names before rendering them.\n\n## User Impact\n\nWhen connected to the updated Gateway, the Windows app categorizes and filters sessions from canonical derived facts while keeping its own display and localization policy. Older Gateways continue through the existing bounded key fallback.\n\n## Evidence\n\n- Companion to https://github.com/openclaw/openclaw/pull/106832.\n- Fresh Parallels Windows app-snapshot validation passed on final head 9e2b337.\n- The parser and display resolver cover flat session facts, sparse updates, direct-peer privacy, title formatting, tray filtering, and chat projection.\n- Rubber-duck / independent autoreview: clean; the final fallback correction preserved older-Gateway titles when classification is absent.\n\n## Change Type\n\n- [ ] Bug fix\n- [x] Feature\n- [x] Refactor\n- [ ] Docs or instructions\n- [x] Tests or validation\n- [x] Security hardening\n- [ ] Chore or infrastructure\n\n## Scope\n\n- [x] Tray or WinUI UX\n- [ ] Windows node capability\n- [ ] Local MCP or winnode\n- [x] Gateway, connection, or pairing\n- [ ] Setup or onboarding\n- [x] Permissions, privacy, or security\n- [x] Tests, CI, or docs\n\n## Validation\n\nWindows 11 ARM64 Parallels app snapshot pre-openclaw-windows-app-e2e-2026-07-15:\n\n- ./build.ps1: passed, 0 warnings, 0 errors.\n- dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: passed; 3,381 passed, 32 skipped, 0 failed.\n- dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: passed; 2,022 passed, 0 skipped, 0 failed.\n\n## Real Behavior Proof\n\n- Environment tested: Windows 11 ARM64 Parallels app snapshot.\n- PR head or commit tested: 9e2b337.\n- Exact command: OPENCLAW_REPO=/Users/dallin/dev/worktrees/openclaw/session-ux ./scripts/parallels-windows-vm.sh run-tests --ref feat/flatten-session-classification.\n- Evidence after fix: the app parser reads only the six flattened fields; direct-peer display names are never selected as a title when peerKind is direct; absent flat fields retain the bounded legacy-key fallback.\n- Observed result: complete build and both required test projects passed.\n- Screenshot or artifact links verified? N/A — no visual layout change.\n- Not verified or blocked: no live Gateway is configured in the restored app snapshot; protocol-to-Windows behavior is proven through the final parser/display and native suites.\n\n## Security Impact\n\n- New permissions or capabilities? No\n- Secrets or tokens handling changed? No\n- New or changed network calls? No\n- Command or tool execution surface changed? No\n- Data access scope changed? No\n\n## Compatibility and Migration\n\n- Backward compatible? Yes\n- Config or environment changes? No\n- Migration needed? No\n\n## Review Conversations\n\n- [x] I replied to or resolved every bot review conversation addressed by this PR.\n- [x] I left unresolved only conversations that still need maintainer judgment.