feat(commands): add /name to rename the current session from chat#88581
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 9:59 PM ET / 01:59 UTC. Summary PR surface: Source +177, Tests +257, Docs +1. Total +435 across 5 files. Reproducibility: not applicable. this is a feature PR rather than a bug report. Source and tests show the intended command path, while the remaining gap is current-head real behavior proof. Review metrics: 2 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 guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge only after current-head proof shows Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR rather than a bug report. Source and tests show the intended command path, while the remaining gap is current-head real behavior proof. Is this the best way to solve the issue? Unclear until maintainer product review: the implementation is narrow and reuses label validation plus the command-metadata seam, but it adds a built-in command and another label-write path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20dd2be0f25e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +177, Tests +257, Docs +1. Total +435 across 5 files. View PR surface stats
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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10e1499272
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIFs for the /name chat command.
Motion-trimmed clips: Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-88581/run-26709617380-1/index.json |
Document that /name writes the session label directly (matching peer chat commands like /goal), so already-open session lists pick up the new label on their next sessions.list reload rather than via a live push. Addresses ClawSweeper/Codex review note about session-change notification parity on PR openclaw#88581. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The Codex P2 finding (no This PR documents the current refresh-on-reload behavior honestly in |
|
Follow-up from reviewing #88690 / #88598: the missing live That means this #88479 is less directly affected because it already uses the existing |
Address Codex review on PR openclaw#88581: - Fall back to the in-memory params.sessionEntry when the store has no row yet, so a brand-new native slash session can be named from its first /name command instead of failing with 'no active session to name'. - Persist the rename through resolved.normalizedKey and drop legacy/ case-folded alias keys (mirroring persistResolvedSessionEntry) so the canonical entry is updated and sessions.list stops surfacing the stale alias row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
09f23a8 to
d94210b
Compare
Adds a `/name <title>` slash command so users can name or rename the current session directly from any chat channel, instead of only through the web/admin session manager. This keeps parallel sessions easy to tell apart from within the chat flow. Behaviour: - `/name <title>` sets the session label, reusing the canonical `parseSessionLabel` validation (trim, non-empty, max 512 chars) and the same cross-store uniqueness rule enforced by the web `sessions.patch` path, so chat naming behaves identically to the session manager. - `/name` with no argument shows the current name plus a locally derived `deriveSessionTitle` suggestion without mutating anything (no LLM). - Only authorized senders can rename (rejectUnauthorizedCommand), matching /goal. The label surfaces everywhere sessions.list is shown (TUI, web, CLI, MCP). The handler resolves the session via resolveSessionStoreEntry so renames land on the canonical entry even when the store still holds a legacy or case-folded key alias, and excludes those aliases from the uniqueness scan to avoid false conflicts. Failed renames skip the store write. Registers the command in commands-registry.shared.ts and the handler in loadCommandHandlers, documents it in docs/tools/slash-commands.md, and adds unit tests covering rename, no-arg suggestion, duplicate-label rejection, unauthorized senders, disabled text commands, and persisted-name re-read. Part of the chat-native session naming feature (follows the web in-chat rename PR). Relates to openclaw#85502 and openclaw#54397. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address Codex review on PR openclaw#88581: - Fall back to the in-memory params.sessionEntry when the store has no row yet, so a brand-new native slash session can be named from its first /name command instead of failing with 'no active session to name'. - Persist the rename through resolved.normalizedKey and drop legacy/ case-folded alias keys (mirroring persistResolvedSessionEntry) so the canonical entry is updated and sessions.list stops surfacing the stale alias row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route successful /name renames through the shared command session metadata seam so subscribed session lists receive sessions.changed like /goal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Clownfish 🐠 reef update Thanks for the work on this. Clownfish could write to this branch, so it kept the fix in the original PR instead of making a new one. Source PR: #88581 fish notes: model gpt-5.5, reasoning medium; reviewed against 37a67b8. |
3a64046 to
37a67b8
Compare
…enclaw#88581) * Add /name chat command to rename the current session Adds a `/name <title>` slash command so users can name or rename the current session directly from any chat channel, instead of only through the web/admin session manager. This keeps parallel sessions easy to tell apart from within the chat flow. Behaviour: - `/name <title>` sets the session label, reusing the canonical `parseSessionLabel` validation (trim, non-empty, max 512 chars) and the same cross-store uniqueness rule enforced by the web `sessions.patch` path, so chat naming behaves identically to the session manager. - `/name` with no argument shows the current name plus a locally derived `deriveSessionTitle` suggestion without mutating anything (no LLM). - Only authorized senders can rename (rejectUnauthorizedCommand), matching /goal. The label surfaces everywhere sessions.list is shown (TUI, web, CLI, MCP). The handler resolves the session via resolveSessionStoreEntry so renames land on the canonical entry even when the store still holds a legacy or case-folded key alias, and excludes those aliases from the uniqueness scan to avoid false conflicts. Failed renames skip the store write. Registers the command in commands-registry.shared.ts and the handler in loadCommandHandlers, documents it in docs/tools/slash-commands.md, and adds unit tests covering rename, no-arg suggestion, duplicate-label rejection, unauthorized senders, disabled text commands, and persisted-name re-read. Part of the chat-native session naming feature (follows the web in-chat rename PR). Relates to openclaw#85502 and openclaw#54397. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(name): seed native sessions and persist renames via canonical key Address Codex review on PR openclaw#88581: - Fall back to the in-memory params.sessionEntry when the store has no row yet, so a brand-new native slash session can be named from its first /name command instead of failing with 'no active session to name'. - Persist the rename through resolved.normalizedKey and drop legacy/ case-folded alias keys (mirroring persistResolvedSessionEntry) so the canonical entry is updated and sessions.list stops surfacing the stale alias row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(name): emit session metadata changes Route successful /name renames through the shared command session metadata seam so subscribed session lists receive sessions.changed like /goal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(commands): add /name to rename the current session from chat * fix(docs): document the /name slash command --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Agent <agent@example.com> Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
…enclaw#88581) * Add /name chat command to rename the current session Adds a `/name <title>` slash command so users can name or rename the current session directly from any chat channel, instead of only through the web/admin session manager. This keeps parallel sessions easy to tell apart from within the chat flow. Behaviour: - `/name <title>` sets the session label, reusing the canonical `parseSessionLabel` validation (trim, non-empty, max 512 chars) and the same cross-store uniqueness rule enforced by the web `sessions.patch` path, so chat naming behaves identically to the session manager. - `/name` with no argument shows the current name plus a locally derived `deriveSessionTitle` suggestion without mutating anything (no LLM). - Only authorized senders can rename (rejectUnauthorizedCommand), matching /goal. The label surfaces everywhere sessions.list is shown (TUI, web, CLI, MCP). The handler resolves the session via resolveSessionStoreEntry so renames land on the canonical entry even when the store still holds a legacy or case-folded key alias, and excludes those aliases from the uniqueness scan to avoid false conflicts. Failed renames skip the store write. Registers the command in commands-registry.shared.ts and the handler in loadCommandHandlers, documents it in docs/tools/slash-commands.md, and adds unit tests covering rename, no-arg suggestion, duplicate-label rejection, unauthorized senders, disabled text commands, and persisted-name re-read. Part of the chat-native session naming feature (follows the web in-chat rename PR). Relates to openclaw#85502 and openclaw#54397. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(name): seed native sessions and persist renames via canonical key Address Codex review on PR openclaw#88581: - Fall back to the in-memory params.sessionEntry when the store has no row yet, so a brand-new native slash session can be named from its first /name command instead of failing with 'no active session to name'. - Persist the rename through resolved.normalizedKey and drop legacy/ case-folded alias keys (mirroring persistResolvedSessionEntry) so the canonical entry is updated and sessions.list stops surfacing the stale alias row. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(name): emit session metadata changes Route successful /name renames through the shared command session metadata seam so subscribed session lists receive sessions.changed like /goal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(commands): add /name to rename the current session from chat * fix(docs): document the /name slash command --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Agent <agent@example.com> Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>




Summary
Adds a
/name <title>chat slash command so users can name or rename the current session directly from any chat channel, instead of only through the web/admin session manager. This makes it easy to keep parallel sessions thematically distinct from within the chat flow.This is the command-side follow-up to the web in-chat rename work (#88479) and continues the chat-native session-naming feature discussed in #54397. It builds on the session manager rename shipped for #85502 (where a maintainer noted that an additional in-chat shortcut "should be a separate polish request") ├ö├ç├ this PR is that shortcut for text channels.
Behaviour
/name <title>sets the current session'slabel. It reuses the canonicalparseSessionLabelvalidation (trim, non-empty, max 512 chars) and the same cross-store uniqueness rule enforced by the websessions.patchpath. The label then surfaces everywheresessions.listis shown (TUI, web, CLI, MCP)./name(no argument) shows the current name plus a locally derivedderiveSessionTitlesuggestion without mutating anything (no LLM call). Apply it with/name <suggestion>.rejectUnauthorizedCommand), matching/goal.Implementation notes
resolveSessionStoreEntryinside the store mutator, so a rename lands on the canonical entry even when the store still holds a legacy/case-folded key alias, and excludes those aliases from the uniqueness scan to avoid false conflicts. Failed renames (invalid/duplicate label, no active session) skip the store write.applySessionsPatchToStore(which performs cfg-heavy model resolution); writing the label insideupdateSessionStorekeeps the handler cfg-independent and unit-testable.Known limitation ├ö├ç├ session-change notification (review note)
ClawSweeper/Codex correctly flagged that, unlike the web
sessions.patchRPC, this command writes the label directly and does not emit asessions.changedevent, so already-open session lists refresh on their nextsessions.listreload rather than via a live push. This matches the behaviour of peer in-chat session commands such as/goal, because the command-handler pipeline (HandleCommandsParams) has no gateway broadcast context. Emittingsessions.changedfrom the command path requires threading a broadcast signal up to the gateway chat layer; I'll address that as a dedicated follow-up so this command PR stays small and reviewable. The behaviour is documented indocs/tools/slash-commands.md.Testing
commands-name.test.ts): rename + persistence, no-arg suggestion (no mutation), duplicate-label rejection, unauthorized sender, disabled text commands, persisted-name re-read whenparams.sessionEntryis absent.tsgo:core,tsgo:test:src, oxlint, oxfmt, the registry tests, and the slash-commands doc test (the command is documented).Scope
Out of scope here (planned follow-ups):
sessions.changednotification parity,/new --name <title>, a/sessionslist command, and an optional LLM-based name suggestion.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Real behavior proof
Behavior or issue addressed:
/name <title>renames the current chat session by writing the validated label to the session store, returns a non-continuing command reply, and synchronizesparams.sessionEntryso downstream command handling sees the renamed session.Real environment tested: Branch-local OpenClaw checkout on
pr88581(999a154f237025277256bf48ec1c59469ad7bab3) on Windows, using pnpm 11.2.2/tsx against OpenClaw's real session-store implementation and a temporary on-disksessions.jsonstore. This uses the PR command handler path directly with authorized web-chat command params; no mocks were used for the store write/read.Exact steps or command run after this patch:
Evidence after fix: Terminal output from the branch-local command-path proof:
Observed result after fix: The
/namecommand returned a rename reply, stopped further command processing (shouldContinue: false), persistedlabel: "PR 88581 real proof"to the on-disk session store, and refreshedparams.sessionEntry.labelto the same value.What was not tested: I did not capture an end-to-end live WhatsApp/Telegram/Discord transcript for this PR. Live
sessions.changedpush notification parity is intentionally left to #88690 and the remaining review thread rather than adding a divergent emitter in this PR.Proof limitations or environment constraints: This is real branch-local terminal evidence against OpenClaw's actual session-store code path, not a live external-channel screenshot. A maintainer can add Mantis/live-channel proof if required before merge.