Repository navigation
fix(sessions): migrate session naming to canonical title - #95182
jason-allen-oneal wants to merge 26 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 12:59 AM ET / 04:59 UTC. Summary PR surface: Source +93, Tests +234, Docs 0, Other +304. Total +631 across 26 files. Reproducibility: yes. at source level: current main only supports legacy Review metrics: 3 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land after maintainer acceptance of canonical Do we have a high-confidence way to reproduce the issue? Yes at source level: current main only supports legacy Is this the best way to solve the issue? Yes, conditionally: centralizing title normalization and mirroring to legacy label is the best implementation shape I found, provided maintainers accept the new canonical title API and generated-client compatibility impact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2ab3b223ed69. Label changesLabel justifications:
Evidence reviewedPR surface: Source +93, Tests +234, Docs 0, Other +304. Total +631 across 26 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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 re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@openclaw-mantis telegram live proof: verify /name <title> and /name --clear update the same session while gateway title and legacy label lookup still agree. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…esolve, proof script lint cleanup
3f28ea6 to
ad010aa
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence for the /name --clear session naming change.
Motion-trimmed clips: |




What Problem This Solves
Session naming was partly migrated from legacy
labelto canonical user-editabletitle, but the runtime contract was incomplete. New gateway schemas acceptedtitlewhilesessions.createdropped it,sessions.listdid not project or filter it, and the durableSessionEntrytype did not declare the persisted field.Additionally, two regressions existed in the patch path:
sessions.patch({ label: null })andsessions.patch({ title: null })crashed becausenormalizeSessionTitleText(null)callsnull.trim()before the null-clear branch.{ title: null, label: "foo" }were silently accepted — the null won and cleared both fields, ignoring the value the client intended to set.Why This Change Was Made
This completes the title contract while preserving the legacy label mirror:
sessions.createnow passestitleinto the shared patch applier, which mirrors it tolabelfor compatibility.SessionEntrynow declarestitle?: stringas durable session metadata.titlefromtitleor legacylabel.sessions.list({ title })now filters by the same normalized title comparison used by patch and resolve.title: nullandlabel: nullclears are preserved as sentinels before string normalization./name --cleardocumented in slash-commands.md.User Impact
Users and clients can set, clear, list, create, patch, and resolve session names through the canonical
titlefield without breaking existinglabelconsumers./name --clearremoves the session name. Legacy label-only entries still appear as titled rows and remain resolvable through title-based lookup.Evidence
Head SHA:
e988d5d5bfReal behavior proof: session title contract end-to-end
Ran
scripts/proof-session-title.tsagainst the patched modules — exercisessessions-patch.ts,session-label.ts, andsession-utils.tswith real session entries (no mocks, no Telegram).Vitest: all touched tests pass on current head
Regression fix 1: nullable clear sentinels
Bug:
sessions-patch.ts:362-363callednormalizeSessionTitleText()on patch values whenever they were notundefined, includingnull. Causednull.trim()to throw.Fix: Check for
nullexplicitly.nullpasses through as a sentinel; string values still normalized withtrim().normalize("NFC").Regression fix 2: mixed null/string title+label pairs
Bug:
{ title: null, label: "foo" }silently cleared both fields, ignoring the set value.Fix: Explicitly reject when one field is
nulland the other is a non-null string:Docs
docs/tools/slash-commands.mdupdated:/namedescription now documents/name --clear.Lint gate
check-lintpasses on current head.ClawSweeper P2 findings addressed (from previous review)
trim().normalize("NFC")before comparison.GatewaySessionRowinui/src/ui/types.tsnow declarestitle?: string.Mantis live proof
@openclaw-mantishas been asked to capture Telegram live proof (see PR comments). The proof script above validates the same code paths end-to-end.@clawsweeper re-review