Skip to content

feat: expose session classification facts - #106832

Merged
RomneyDa merged 15 commits into
mainfrom
feat/session-presentation-contract
Aug 7, 2026
Merged

RomneyDa merged 15 commits into
mainfrom
feat/session-presentation-contract

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Closes #106793

What This Does

Adds optional, non-sensitive facts to each sessions.list row:

  • classification
  • agentId
  • accountId
  • peerKind
  • isMain
  • isBackground

The Gateway derives these facts from the canonical session route without exposing peer identifiers, transcript text, or filesystem paths.

Clients continue to own display. Existing label, displayName, and derivedTitle fields are unchanged; this change adds no Gateway-owned title or subtitle.

User Impact

Session clients can distinguish main, direct, group, thread, cron, heartbeat, subagent, ACP, hook, harness, dreaming, and other session categories without parsing routing keys. Direct peer identifiers are not included.

Evidence

  • Current head: f421ac29d4cb31981dd5fd3158e7f02b0342303c.
  • Focused Gateway classification, schema, row-projection, sessions RPC, and session-utilities tests pass.
  • JSON, Swift, and Kotlin protocol generation is synchronized.
  • Live Parallels verification: a rebuilt Gateway returned direct and cron facts; the Windows Companion app ingested them, rendered the direct session as “Telegram direct message” without the opaque peer identifier, and hid the cron session with background sessions disabled.
  • Coordinated Windows PR: feat(sessions): consume flattened gateway classification openclaw-windows-node#1069.

Compatibility

The fields are additive and optional, so existing clients can ignore them. Clients that use the fields should retain their existing behavior when they are absent from an older Gateway.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 2:41 AM ET / 06:41 UTC.

ClawSweeper review

What this changes

Adds six optional, non-sensitive session classification facts to Gateway session-list rows and propagates them through Android, Swift, and Control UI types.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding: this is a coherent additive Gateway contract with real client propagation and maintainer-confirmed direction. Keep it open for normal protected maintainer review and merge.

Priority: P2
Reviewed head: 624da93929a6d376ad19978d043d2a452ba8efcd
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong focused coverage and credible production-boundary proof support a normal protected maintainer merge decision.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR records a rebuilt Gateway and real Windows client consuming direct and cron metadata with the intended display and background-filtering outcome.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR records a rebuilt Gateway and real Windows client consuming direct and cron metadata with the intended display and background-filtering outcome.
Evidence reviewed 6 items Canonical owner boundary: The Gateway row producer derives the facts once while constructing each session row, rather than requiring every client to parse opaque keys.
Additive protocol contract: All six fields are optional, with open string values for future classifications and peer kinds.
Coverage and privacy proof: Focused tests cover main, delivery, background, and opaque-peer cases; RPC assertions verify the projected facts do not include group or direct peer identifiers.
Findings None None.
Security None None.

How this fits together

Gateway session listing projects stored session state into rows for web and native clients. The new facts classify routes and background work without exposing peer identifiers or transcript content.

flowchart LR
  A[Stored session key] --> B[Gateway row projection]
  B --> C[Classification facts]
  C --> D[Session list protocol]
  D --> E[Web and native clients]
  E --> F[Session display and filtering]
Loading

Decision needed

Question Recommendation
Should the explicitly accepted six-field session-row contract merge on this exact head? Approve the accepted contract: Merge after normal exact-head checks, retaining the documented optional and open-value compatibility behavior.

Why: The PR is protected and authored by a repository member; merge acceptance remains an owner decision despite no actionable patch defect.

Before merge

  • Resolve merge risk (P1) - This public session-row contract spans independently released Gateways and clients, so consumers must continue tolerating absent fields and unknown string values during version skew.
Agent review details

Security

None.

PR surface

Source +195, Tests +267, Other +153. Total +615 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 7 195 0 +195
Tests 6 271 4 +267
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 8 154 1 +153
Total 21 620 5 +615

Review metrics

Metric Value Why it matters
Session-row contract 6 optional fields added The new public fields cross independently released Gateway and client versions.
Production versus tests production +262/-0; tests +358/-5 The production growth is justified by the new cross-client Gateway contract, with focused coverage across protocol, Gateway, Android, and Swift.

Stored data model

Persistent data-model change detected: serialized state: packages/gateway-protocol/src/schema/session-classification.test.ts, serialized state: packages/gateway-protocol/src/schema/sessions-row.ts, serialized state: src/gateway/server.sessions.store-rpc.test.ts, serialized state: src/gateway/session-classification.test.ts, serialized state: src/gateway/session-classification.ts, serialized state: src/gateway/session-utils-creators.test.ts, and 6 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #106793
Summary: This PR is the linked implementation candidate for the canonical session-presentation request.

Members:

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

Merge-risk options

Maintainer options:

  1. Merge with version-skew compatibility (recommended)
    Accept the additive contract while retaining optional fields and client fallback behavior for older Gateways.

Technical review

Best possible solution:

Merge the Gateway-owned additive projection while preserving optional-field behavior for older Gateways and unknown future classifications.

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

Not applicable: this PR adds a session-list capability rather than repairing a reported failing behavior; the changed behavior is nevertheless covered by focused source tests and a rebuilt-Gateway client run.

Is this the best way to solve the issue?

Yes: deriving classification once in the Gateway row producer is the narrowest maintainable solution, avoiding duplicated parsing policy in every client.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded session-list contract improvement with limited user-impact blast radius.
  • merge-risk: 🚨 compatibility: Separately released clients and Gateways must handle the new optional fields across version skew.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR records a rebuilt Gateway and real Windows client consuming direct and cron metadata with the intended display and background-filtering outcome.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR records a rebuilt Gateway and real Windows client consuming direct and cron metadata with the intended display and background-filtering outcome.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Introduced the current session-row utility split, canonical delivery-state work, and cross-client session telemetry. (role: feature-history owner; confidence: high; commits: be815ae5c907, 73bba03e4c5a, 0b080b9c2ed7; files: src/gateway/session-utils-row.ts, src/gateway/session-utils.types.ts, packages/gateway-protocol/src/schema/sessions-row.ts)
  • Vincent Koc: Recent history includes generated native-model maintenance and current-main work adjacent to the session-row surface. (role: recent adjacent contributor; confidence: medium; commits: 9b736a42c69b, 3fba74802bf3; files: apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift, src/gateway/session-utils-row.ts)

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.

History

Review history (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-30T09:06:54.122Z sha a2187dc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T10:27:17.570Z sha f421ac2 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T11:07:12.153Z sha f421ac2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-01T23:14:09.165Z sha f421ac2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T02:04:52.633Z sha 326e899 :: needs changes before merge. :: [P1] Classify spawned delivery sessions from persisted state
  • reviewed 2026-08-06T10:52:54.391Z sha b8d62a1 :: needs changes before merge. :: [P2] Carry classification facts through Android session rows
  • reviewed 2026-08-06T12:51:13.966Z sha a1e7920 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T13:46:01.781Z sha a1e7920 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 13, 2026
@RomneyDa
RomneyDa force-pushed the feat/session-presentation-contract branch from 7de8fbd to fc1297b Compare July 14, 2026 09:17
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 14, 2026
@RomneyDa
RomneyDa force-pushed the feat/session-presentation-contract branch from fc1297b to 63ff2e8 Compare July 14, 2026 23:21
@RomneyDa RomneyDa self-assigned this Jul 15, 2026
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 16, 2026
@RomneyDa
RomneyDa force-pushed the feat/session-presentation-contract branch from 63ff2e8 to eab6316 Compare July 21, 2026 03:00
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 21, 2026
@RomneyDa
RomneyDa force-pushed the feat/session-presentation-contract branch from eab6316 to b5919d8 Compare July 21, 2026 03:02
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 22, 2026
@RomneyDa
RomneyDa force-pushed the feat/session-presentation-contract branch from b5919d8 to 0fed180 Compare July 30, 2026 06:28
@RomneyDa
RomneyDa marked this pull request as ready for review July 30, 2026 06:32
@openclaw-barnacle openclaw-barnacle Bot added the app: android App: android label Aug 6, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 6, 2026
@RomneyDa
RomneyDa force-pushed the feat/session-presentation-contract branch from a1e7920 to 624da93 Compare August 7, 2026 06:14
@openclaw-barnacle openclaw-barnacle Bot removed the app: macos App: macos label Aug 7, 2026
@RomneyDa
RomneyDa merged commit 2a0bbd2 into main Aug 7, 2026
130 checks passed
@RomneyDa
RomneyDa deleted the feat/session-presentation-contract branch August 7, 2026 06:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 8, 2026
* feat: expose session presentation metadata

* fix: restrict session titles to safe display metadata

* fix: preserve saved session display names

* fix(protocol): tolerate future session presentation values

* fix(gateway): keep direct peer names out of presentation

* fix(protocol): connect session presentation to native rows

* fix(gateway): canonicalize session presentation metadata

* fix(gateway): satisfy session presentation CI checks

* feat(gateway): flatten session classification facts

* fix: repair session classification generated models

* fix(gateway): canonicalize session classification keys

* fix(gateway): classify spawned delivery sessions

* fix(android): retain session classification facts

* test(android): make scripted gateway calls concurrency-safe

* test(live-updater): isolate fixture git commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

Expose structured session presentation metadata

1 participant