Skip to content

feat(ui): inline rename in the in-chat session picker - #88479

Closed
BSG2000 wants to merge 0 commit into
openclaw:mainfrom
BSG2000:feature/chat-session-name
Closed

BSG2000 wants to merge 0 commit into
openclaw:mainfrom
BSG2000:feature/chat-session-name

Conversation

@BSG2000

@BSG2000 BSG2000 commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Problem: The in-chat session picker only lets users switch sessions. Renaming still requires the admin "Sessions" tab, which is cumbersome when juggling several parallel, topic-specific chats — exactly the friction reported in [Feature]: Topic/Session Management UI #54397.
  • Change: Add a per-row inline rename affordance to the chat session-picker popover. An edit button on each row opens an inline input seeded with the current label; Enter / Save commits, Escape / Cancel discards.
  • Reuse, no new write path: Commit goes through the existing self-refreshing patchSession(state, key, {label}) flow (the same sessions.patch + loadSessions() path the admin Sessions tab already uses). Empty/whitespace input clears the label via normalizeOptionalString, matching admin-tab semantics exactly.
  • Out of scope (intentional): chat slash-commands for naming (/name, /new --name, /sessions), switching sessions from text channels, and any LLM auto-suggest. Those are planned as separate, smaller PRs.
  • Success: Users can rename a session without leaving the chat; behavior and validation are identical to the existing admin rename.

Linked context

Related #54397, #85502

This is the small "header/sidebar shortcut" that maintainers explicitly invited as a separate polish request when closing #85502 (the admin-tab rename shipped there). It also advances the chat-native session-management UX discussed in #54397. I deliberately did not put Closes # because neither issue is a 1:1 match — happy to add one if a maintainer prefers.

Real behavior proof (required for external PRs)

  • Behavior addressed: Rename a session inline from the in-chat session picker (open picker → edit icon on a row → type a new label → Enter/Save), including clear-on-empty and Cancel/Escape.

  • Real environment tested: A live self-hosted OpenClaw gateway (v2026.5.27, Node v22, on WSL2/Ubuntu-24.04) serving this PR branch's built control-ui, driven through a real Chromium browser via Playwright. The browser authenticates against the running gateway over the actual WebSocket control channel and exercises the production render path end to end. Endpoint, tokens, and other session labels are redacted.

  • Exact steps or command run after this patch:

    • Built this branch's control-ui and pointed the running gateway at it; confirmed it was live with curl -fsS http://127.0.0.1:<port>/healthz → 200.
    • Drove the real UI with a Playwright script (node rename_e2e.js, headless Chromium): connect to the gateway → open the in-chat session picker → click a row's inline edit icon → type a new label → press Enter to commit → re-read the session list to confirm persistence → restore the original label.
  • Evidence after fix (browser console + control-channel capture):

    $ curl -fsS http://127.0.0.1:<port>/healthz   ->   200
    $ node rename_e2e.js   (headless Chromium driving the live gateway)
    [control-ui] rpc method=connect           ok=true   auth=password
    [control-ui] rpc method=sessions.subscribe ok=true
    [control-ui] rpc method=sessions.list     ok=true
    picker opened -> inline edit icon present on each session row
    entered inline edit mode -> typed a new label -> pressed Enter
    [control-ui] rpc method=sessions.patch    ok=true   durationMs=69
    [control-ui] rpc method=sessions.list     ok=true   (self-refresh)
    verified: the new label is rendered in the picker row AND in the
             left sidebar "Recent" list, with no page reload
    cleanup: original label restored -> sessions.patch ok=true
    
  • Observed result after fix: Clicking a row's edit icon enters inline edit mode seeded with the current label. Pressing Enter commits through the existing sessions.patch flow (ok=true) and the self-refreshing sessions.list immediately shows the new name in both the picker row and the sidebar "Recent" list — no page reload and without opening the admin Sessions tab. Cancel/Escape and closing the picker mid-edit discard the draft and leave the label unchanged. The new name persisted across a fresh sessions.list read; the original label was then restored.

  • What was not tested: Non-web channels (this is a Control UI surface only), and exact visual pixel styling across physical devices/browsers other than headless Chromium. The commit path is the same patchSession flow the admin Sessions tab already uses, which is additionally covered by the DOM-level regression tests in ui/src/ui/views/chat.test.ts.

Tests and validation

  • Added 4 focused tests in ui/src/ui/views/chat.test.ts under "chat session controls": commit via Enter, clear-on-whitespace via Save, cancel via Escape, and discard-on-close (regression guard so closing the picker mid-edit cannot leak a stale rename/draft).
  • pnpm tsgo:test:ui, pnpm ui:i18n:check, oxlint and oxfmt all green on the changes.

Risk checklist

  • User-visible behavior change? Yes — a new rename control in the chat session picker.
  • Config/env/migration change? No.
  • Security/auth/secrets/network/tool-exec change? No new write path or permission surface; reuses the existing sessions.patch flow already used by the admin rename.
  • Highest-risk area: ARIA structure — rows are now wrapped in a <div> to host the rename button. Mitigation: wrappers are marked role="presentation" so options remain owned by the listbox. Note: this picker was already a loose listbox (button options, no roving tabindex); a deeper list/listitem refactor is intentionally left out of scope.
  • Mitigation: Label normalization/clear semantics are delegated to the same helper as the admin tab; commit uses the existing self-refreshing controller; rename state is cleared on every picker-close path (covered by a test).

Current review state

  • Next action: Maintainer review of the UX placement and the ARIA role="presentation" approach.
  • Bot/reviewer comments addressed: N/A (initial submission).

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 31, 2026
@clawsweeper

clawsweeper Bot commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 5:30 AM ET / 09:30 UTC.

Summary
The PR adds inline session rename controls to the Control UI chat session picker, with new picker rename state, cache refresh handling, i18n strings, styles, and chat-view regression tests around the existing sessions.patch path.

PR surface: Source +391, Tests +1633. Total +2024 across 44 files.

Reproducibility: not applicable. this is a new Control UI affordance, not a current-main bug report. The PR body supplies live gateway/Chromium proof for the intended user flow, and the branch adds focused DOM regression coverage for the cache and rename-state cases.

Review metrics: 1 noteworthy metric.

  • Session label write surfaces: 1 added in chat picker. The PR adds another UI entry point that mutates persisted session labels, so maintainers should notice the session-state sequencing risk before merge.

Stored data model
Persistent data-model change detected: serialized state: ui/src/ui/chat/session-controls.ts, serialized state: ui/src/ui/controllers/sessions.ts, unknown-data-model-change: ui/src/ui/chat/session-controls.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Have a maintainer choose the canonical Control UI rename/history UX before merging overlapping branches.

Mantis proof suggestion
A short visual proof would materially help maintainers judge the inline editor placement and save/cancel/clear behavior, even though the functional proof is sufficient. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: capture the Control UI chat session picker inline rename flow, including edit, save, cancel, clear-to-default, and the refreshed picker/sidebar labels.

Risk before merge

Maintainer options:

  1. Choose the canonical rename model before merge (recommended)
    Have a maintainer decide whether this inline picker editor, the broader accessible picker/sidebar model, or a consolidated branch owns Control UI session rename behavior before overlapping PRs merge.
  2. Land this as the narrow picker path
    Maintainers can intentionally merge this PR first and require broader session-history/sidebar PRs to adapt to its inline editor and cache-refresh behavior.
  3. Pause in favor of the broader branch
    If maintainers want the combined accessibility/sidebar model to be canonical, pause or close this PR after preserving any unique race/cache tests worth carrying over.

Next step before merge

  • [P2] No mechanical repair remains from this read-only pass; the blocker is maintainer choice between overlapping Control UI session rename/history implementations.

Security
Cleared: No concrete security or supply-chain concern found; the PR changes Control UI/i18n/CSS/tests only and adds no dependency, workflow, lockfile, secret, permission, or download-execute surface.

Review details

Best possible solution:

Maintainers should choose the canonical Control UI session rename/history model, then either land this narrow inline editor or fold its tested cache/race behavior into the selected broader session-history branch.

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

Not applicable: this is a new Control UI affordance, not a current-main bug report. The PR body supplies live gateway/Chromium proof for the intended user flow, and the branch adds focused DOM regression coverage for the cache and rename-state cases.

Is this the best way to solve the issue?

Unclear as a product decision: the narrow implementation reuses sessions.patch and appears technically sound, but the best overall solution depends on whether maintainers want this inline editor or the broader accessible picker/sidebar model to be canonical.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority Control UI session-management feature with limited blast radius but non-trivial persisted session-label behavior.
  • merge-risk: 🚨 session-state: The PR mutates persisted session labels from a new picker surface and adds async cache/pending-state handling that can affect visible session state.
  • 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 body includes after-fix live-output proof from a self-hosted gateway and real Chromium browser using the production WebSocket control channel; later changes are covered by focused regression tests.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live-output proof from a self-hosted gateway and real Chromium browser using the production WebSocket control channel; later changes are covered by focused regression tests.
Evidence reviewed

PR surface:

Source +391, Tests +1633. Total +2024 across 44 files.

View PR surface stats
Area Files Added Removed Net
Source 43 508 117 +391
Tests 1 1634 1 +1633
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 44 2142 118 +2024

What I checked:

  • Current main chat picker has no inline rename affordance: Current main renders searchable chat session picker rows as switch-only option buttons; this PR adds a new edit/save/cancel path on those rows rather than duplicating an existing picker rename control. (ui/src/ui/chat/session-controls.ts:704, ec737ee74d9b)
  • Existing Web UI rename path remains the Sessions table label editor: Current main already has the admin Sessions table label input that normalizes edits and calls onPatch(row.key, { label: value }), so this PR is an additional chat-picker shortcut over the same label concept. (ui/src/ui/views/sessions.ts:935, ec737ee74d9b)
  • PR implementation reuses sessions.patch and handles picker rename state: At the PR head, commitChatSessionRename no-ops unchanged labels, sets per-row pending state, calls patchSession with { label }, and reloads or invalidates the picker cache after success. (ui/src/ui/chat/session-controls.ts:774, df19ab9c38db)
  • PR controller path returns success/failure without a new RPC contract: The PR changes patchSession to return a boolean, clears sessionsError before the request, still sends sessions.patch, and refreshes sessions through loadSessions after success. (ui/src/ui/controllers/sessions.ts:1201, df19ab9c38db)
  • PR render dependencies include rename state: The guarded chat controls dependency list includes rename key, draft, and pending keys, addressing the prior stale guarded-render issue for the inline editor. (ui/src/ui/app-render.ts:1041, df19ab9c38db)
  • PR tests cover the high-risk rename/cache cases: The PR head includes chat-view tests for commit, whitespace clear, cancel, close-discard, cache reload, stale reloads, per-row pending state, stale failures, displayName-only rows, no-op saves, and accessible per-row labels. (ui/src/ui/views/chat.test.ts:4406, df19ab9c38db)

Likely related people:

  • Peter Steinberger: History shows substantial recent work in the Control UI session files, including the commit that split chat session controls into the current owner module. (role: recent area contributor; confidence: high; commits: 1fad8efa12cf, 6ff837125475; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/views/sessions.ts, ui/src/ui/controllers/sessions.ts)
  • Tyler Yust: The current chat session dropdown and refresh behavior traces through a focused history commit on the picker surface. (role: chat picker behavior contributor; confidence: medium; commits: 6372242da756; files: ui/src/ui/chat/session-controls.ts, ui/src/ui/views/chat.test.ts)
  • Bradley Priest: History identifies the existing Control UI Sessions label editing path as coming from the session-label support commit. (role: existing label editor introducer; confidence: medium; commits: 51f1f2323508; files: ui/src/ui/views/sessions.ts, ui/src/ui/controllers/sessions.ts)
  • Val Alexander: History shows multi-session selection/deletion and dashboard session-management work in the adjacent Sessions UI path. (role: session management UI contributor; confidence: medium; commits: 36c6d44eca05, f76a3c5225bb; files: ui/src/ui/views/sessions.ts, ui/src/ui/controllers/sessions.ts)
  • BSG2000: Beyond authoring this PR, BSG2000 also has a merged chat-side session naming command that touches the same product slice around user-controlled session labels. (role: recent adjacent session-naming contributor; confidence: medium; commits: b48238aa88b0; files: src/auto-reply/reply/commands-name.ts, ui/src/ui/chat/session-controls.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e46522b11

ℹ️ 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".

Comment thread ui/src/ui/chat/session-controls.ts Resolved
Comment thread ui/src/ui/app.ts Resolved
Comment thread ui/src/ui/chat/session-controls.ts Resolved
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels May 31, 2026
@BSG2000

BSG2000 commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review. I pushed 3f63e9594 (rebased onto the latest main merge) which addresses all three findings:

1. Refresh the picker cache after rename — commitChatSessionRename now reloads the picker-owned cache (loadChatSessionPickerPage) after a successful patch while the picker is open, so the row no longer falls back to the stale chatSessionPickerResult label and a reopen shows the new name.

2. Clear rename state on every picker close — the three app-level dismissal paths in ui/src/ui/app.ts (mobile Escape, outside pointerdown, and the mobile-controls close) now route through the exported closeChatSessionPicker(...) instead of setting chatSessionPickerOpen/chatSessionPickerSurface directly. This clears chatSessionPickerRenameKey/chatSessionPickerRenameDraft on every path (and also fixes a search-timer that those paths previously leaked).

3. Surface rename failures in the picker — patchSession now returns a success boolean and resets sessionsError at the start. On failure, commitChatSessionRename bridges the error into chatSessionPickerError (picker-visible) and restores the inline editor so the typed draft can be retried. The restore is guarded so a late failure cannot resurrect stale edit state after the picker was closed or another row's rename was started in the meantime (async-race safe).

New regression tests cover: cache reload after a successful rename, picker-visible error + editor restore on failure, and the no-restore-after-close race. i18n key chat.selectors.renameFailed was added and synced to all locales.

Quality gates green locally: tsgo UI typecheck, oxlint, oxfmt, ui:i18n:check, and the affected vitest suites (chat.test.ts, controllers/sessions.test.ts, views/sessions.test.ts — 158 tests).

On the proof ask: I still can't attach a running-UI recording from this contribution environment, so the added coverage remains DOM/unit-level with the sessions controller boundary exercised through the real commitChatSessionRename → patchSession/sessions.list path. Happy for a maintainer to capture Mantis proof if that's preferred before merge.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 31, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 31, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@BSG2000

BSG2000 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Updated this branch against current origin/main and resolved the merge conflicts.

What changed in the conflict resolution:

  • preserved the in-chat picker rename coverage while adopting the newer buildChatItems test mock shape from main
  • regenerated the UI i18n fallback metadata after the merge
  • restored the missing live directive import used by the rename input binding

Validation run locally:

  • node scripts\run-vitest.mjs run ui\src\ui\views\chat.test.ts 101 passed
  • npm run ui:i18n:check clean
  • node_modules\.bin\tsc.cmd --noEmit --pretty false --project test\tsconfig\tsconfig.test.ui.json passed

@codex review
@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a7ec7b3a0

ℹ️ 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".

Comment thread ui/src/ui/app-view-state.ts Resolved
Comment thread ui/src/ui/chat/session-controls.ts Resolved
Comment thread ui/src/ui/chat/session-controls.ts Resolved
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jun 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d10fcbb1ba

ℹ️ 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".

Comment thread ui/src/ui/chat/session-controls.ts Resolved
Comment thread ui/src/ui/chat/session-controls.ts Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@BSG2000

BSG2000 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the latest Codex + ClawSweeper rename-picker findings in 0712c24:

  • stale successful renames now re-apply the active picker search when needed, preserving any visible newer rename error
  • per-row rename trigger/input labels now include the visible session label
  • unchanged normalized rename saves skip sessions.patch, avoiding accidental recency bumps
  • stale label clears now also clear cached displayName
  • rename drafts now prefill from the visible session label, including displayName-only rows

Evidence:

  • node_modules/.bin/oxfmt.cmd --check ui/src/ui/chat/session-controls.ts ui/src/ui/views/chat.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-ui.tsbuildinfo
  • node_modules/.bin/vitest.cmd run ui/src/ui/views/chat.test.ts → 143 tests passed

Note: pnpm exec ... currently trips over a lockfile/install issue from the merged remote head (@lydell/[email protected] missing from pnpm-lock.yaml), so I used the existing local binaries/scripts directly for validation.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d4e462432

ℹ️ 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".

Comment thread ui/src/ui/chat/session-controls.ts Outdated
title=${renameLabel}
aria-label=${renameLabel}
?disabled=${renameDisabled}
@click=${() => beginChatSessionRename(state, row.key, label)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid saving disambiguation text as the label

When duplicate session names are present, resolveSessionOptionGroups() appends UI-only scope/key text to label to disambiguate rows, and this passes that rendered label into the rename draft. Opening the editor and pressing Save without edits then compares against the raw row label and persists the disambiguated text (for example Work · <scope>) via sessions.patch, changing the user's label and recency even though they made no rename; seed the editor from the editable row name/display name rather than the picker’s disambiguated label.

Useful? React with 👍 / 👎.

Comment thread ui/src/ui/chat/session-controls.ts Outdated
Comment on lines +583 to +586
normalizeOptionalString(
state.chatSessionPickerResult?.sessions.find((row) => row.key === key)?.label ??
state.sessionsResult?.sessions.find((row) => row.key === key)?.label,
) ?? null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat displayName-backed drafts as unchanged

For rows whose visible name comes from displayName rather than a custom label, the editor is now prefilled from that visible name, but this no-op check still looks only at row.label. Opening such a channel/group session and pressing Save without edits therefore sends sessions.patch with label set to the display name, converting a generated display name into a custom label and bumping recency even though nothing changed; fresh evidence in this revision is that the current-label helper still ignores displayName.

Useful? React with 👍 / 👎.

Comment thread ui/src/ui/chat/session-controls.ts Outdated
Comment on lines +787 to +790
if (!requestIsCurrent) {
if (state.chatSessionPickerOpen) {
updateChatSessionPickerCachedLabel(state, key, label);
if (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh ordering for stale rename successes

When an older save succeeds after the user has already started another edit and there is no active picker search, this stale-success path only patches the cached label. sessions.patch bumps updatedAt and refreshes sessionsResult, but the open picker continues to render chatSessionPickerResult, so the renamed row keeps its old position/timestamp until some later reload; refresh or patch the cached row ordering/metadata here as well.

Useful? React with 👍 / 👎.

@BSG2000

BSG2000 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up after reviewing the ClawSweeper/Codex rename notes:

  • Verified the existing branch already addresses the major picker rename race/cache/accessibility points (close paths, per-row pending state, reload limit, stale cache handling, and row-specific rename labels).
  • Added one missing regression fix: unchanged saves for rows that only have a displayName now no-op instead of sending sessions.patch.
  • Added coverage for display-name-only rows so opening the prefilled editor and pressing Enter does not bump/patch the session.

Validation:

  • oxfmt --check ui/src/ui/chat/session-controls.ts ui/src/ui/views/chat.test.ts
  • vitest run ui/src/ui/views/chat.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-ui.tsbuildinfo

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbff910857

ℹ️ 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".

Comment thread ui/src/ui/chat/session-controls.ts Outdated
? {
...row,
label: label ?? undefined,
displayName: label === null ? undefined : row.displayName,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve display names when clearing stale labels

When a label-clear save succeeds after another rename has made this request stale, this cached-row patch removes displayName as well as label. Channel/group rows can legitimately have both a custom label and a generated display name, and clearing the custom label should reveal the generated name; with no active picker search this stale-success path does not reload, so the picker falls back to the session key/generic channel name until a later refresh.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@BSG2000

BSG2000 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the open Codex picker-rename findings:

  • Rename editing now uses the raw editable label/displayName instead of the rendered picker label, so disambiguation suffixes are not saved as custom labels.
  • DisplayName-only rows are treated as unchanged when the draft matches the displayName.
  • Stale successful renames now refresh the picker page even without an active search, so ordering/timestamps come from the server instead of only patching the cached label.
  • Clearing a stale custom label preserves the generated displayName fallback in the cached row.

Validation:

  • oxfmt --check ui/src/ui/chat/session-controls.ts ui/src/ui/views/chat.test.ts
  • vitest run ui/src/ui/views/chat.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-ui.tsbuildinfo

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 26, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 14, 2026
@BSG2000 BSG2000 closed this Jul 19, 2026
@BSG2000
BSG2000 force-pushed the feature/chat-session-name branch from df19ab9 to 5a6a19c Compare July 19, 2026 19:12
@BSG2000
BSG2000 deleted the feature/chat-session-name branch July 28, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS stale Marked as stale due to inactivity 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