Skip to content

[Bug]: chat pane rename seeds from the rendered title, persisting the account suffix into stored labels #124307

Closed

Description

@vyctorbrzezowski

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The Control UI chat pane seeds its inline rename input with the rendered session title, so a partially edited submit persists presentation as a stored user label; with account-qualified sessions this stores the account discriminator into the label and renders a doubled account suffix.

Steps to reproduce

Requires a channel with more than one account configured, so sessions carry a non-default accountId (for example a cards Telegram account alongside the default).

  1. Open a Control UI chat pane on a session with a non-default account and no stored label — for example agent:main:telegram:cards:direct:42 with a Gateway displayName of Alice. The pane title reads Alice · cards.
  2. Click the pane title to start the inline rename. The input is pre-filled with Alice · cards.
  3. Edit only the leading part and submit — for example type VIP in front, leaving the tail intact, so the value is VIP Alice · cards.
  4. Observe the stored label is now VIP Alice · cards.
  5. Repeat step 2-3 but edit the tail instead, for example to Alice · cards2, and submit.

Expected behavior

An editable field should be seeded with data the user owns — the stored label, or at most the undecorated name — so a rendered discriminator can never become persisted data. The Sessions page and the sidebar rename dialog already behave this way: both seed from the stored label (ui/src/pages/sessions/sessions-page.ts uses normalizeOptionalString(row.label) ?? "", and ui/src/components/session-organizer-controller.ts uses normalizeOptionalString(session.userLabel) ?? ""), so neither can persist a derived string. The chat pane is the remaining surface that does not.

Actual behavior

The chat pane seeds the rename input with the resolved display name, and a partial edit persists it verbatim:

  • ui/src/pages/chat/chat-page-pane-render.ts:76 sets the pane title from resolveSessionDisplayName(resolvedKey, row), which appends " · <accountId>" for a non-default account.
  • ui/src/pages/chat/chat-pane-session-menu.ts:256 seeds the input with this.headerRenameInitialValue = customLabel ?? this.paneTitle, so an unlabeled row pre-fills with the rendered title.
  • commitHeaderRename guards only the completely untouched case: unchangedDerivedTitle = this.headerRenameInitialLabel === null && trimmed === this.headerRenameInitialValue.trim(). Any partial edit falls through to an ordinary label write and is persisted verbatim via patchChatSessionLabel → sessions.patch({ label }) (ui/src/pages/chat/chat-state-route.ts:81).

Step 3 above therefore stores VIP Alice · cards as a real user label — presentation captured as user data, which then outranks every later derivation.

Step 5 shows the residual rendering defect. #124228 added an idempotence check in withAccountDisambiguator (ui/src/lib/session-display.ts) that leaves a name alone when it already ends in the exact suffix, so VIP Alice · cards renders correctly. That check only matches the exact tail: a label edited to Alice · cards2 still renders Alice · cards2 · cards.

The check is a deliberate guard against this producer, not a fix for it — the account is still frozen into user state, and the guard sits at the display end rather than at the surface that writes the data.

OpenClaw version

main at bf4ec4b (unreleased; the account suffix ships in #124228)

Operating system

macOS 15 (Darwin 25.3.0). The path is Control UI browser code and is not platform-specific.

Install method

pnpm dev / source checkout

Model

Not applicable — Control UI display and session-label persistence path; no model is involved.

Provider / routing chain

Not applicable — no provider request is involved. The account identity comes from the Gateway's route projection onto the session row (src/gateway/session-classification.ts).

Additional provider/model setup details

Not applicable.

Logs

Not applicable - no error is logged. The write succeeds; the defect is that the
persisted value is a rendered string rather than user-authored data.

Screenshots, recordings, and evidence

Traced in source as cited above and confirmed against bf4ec4b58af by driving the pane methods directly: beginHeaderRename on a cards row with displayName: Alice and no label pre-fills Alice · cards, and committing VIP Alice · cards calls sessions.patch with exactly { label: "VIP Alice · cards" }.

Impact and severity

  • Affected: Control UI users with more than one account configured on a channel, using the chat pane inline rename. The seeding problem itself affects any session whose title is derived rather than stored; the account suffix is what makes it visible.
  • Severity: Low-to-moderate. No data loss and no crash. A derived string becomes user state, and one edit shape renders a visibly wrong title.
  • Frequency: Deterministic for the described edit shapes; only reachable through the chat pane rename, since the sidebar and Sessions page already seed from the stored label.
  • Consequence: Session labels silently capture presentation. Once stored, the label outranks later derivation, so a session keeps a stale account discriminator even if its account changes, and tail edits render a doubled suffix.

Additional information

Context and constraint for whoever picks this up:

  • fix(ui): disambiguate multi-account session labels #124228 introduced the account suffix and moved the sidebar rename onto the stored label. It deliberately did not change the chat pane, and recorded this as a follow-up in its description.
  • The chat pane's seed-from-rendered-title behavior is intentional: it arrived with the header session menu in feat(ui): move chat view toggles into a header session menu #121452, and the unchangedDerivedTitle guard exists precisely so an untouched derived title is not persisted. It is pinned by ui/src/pages/chat/chat-pane.test.ts ("cancels and skips unchanged labels", which sets paneTitle = "Derived title"). So this is not a matter of deleting the pre-fill — an inline title edit conventionally starts from the displayed text, and simply seeding empty would change that affordance for every session, not only account-qualified ones.
  • The likely shape is to expose the undecorated resolved name from ui/src/lib/session-display.ts and seed the editable field from that, keeping the account suffix as display-only decoration. That would remove the only known producer of suffixed stored labels, at which point the endsWith idempotence check in withAccountDisambiguator can be deleted and its comment retired.
  • Related but separate: src/gateway/server-methods/agent-session-patch.ts re-persists the existing label on each turn without routing through parseSessionLabel, which entrenches a once-stored bad label. Worth checking while in this area.

Activity

  1. added
    bug
    bug:behavior
    on Aug 15, 2026
  2. added
    maintainer
    on Aug 15, 2026
  3. added
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:session-state
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    P2
    on Aug 15, 2026
  4. clawsweeper commented on Aug 15, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 15, 2026, 7:47 PM ET / 23:47 UTC.

    Summary
    Keep open: current main still lets a partial chat-pane rename persist a rendered account suffix. This member-owned, maintainer-labelled issue needs a small UI-direction decision before repair.

    Reproducibility: yes. —current source provides a high-confidence path: an unlabeled non-default-account row supplies a suffixed pane title, and a partial edit is passed to sessions.patch. It was not executed locally because this review is read-only.

    Root-cause cluster
    Relationship: canonical
    Canonical: #124307
    Summary: This issue is the canonical remaining producer-side follow-up; the merged display-disambiguation PR made the behavior visible but explicitly left this path unresolved.

    Members:

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

    Maintainer decision needed

    Question Recommendation
    For an unlabeled chat-pane rename, should the editor preserve the header’s prefilled-name affordance with an undecorated base name, or align with the sidebar and Sessions page by starting blank? Prefill the undecorated base name: Pass a structured base name to the editor while rendering the account discriminator separately, preserving the chat-header editing affordance.

    Why: Both choices prevent future persistence of presentation data, but they intentionally differ in the established inline-rename experience and should not be selected by automation.

    Next step
    A focused repair is feasible, but a maintainer must first choose whether unlabeled inline renames preserve a base-name prefill or begin blank.

    Review details

    Best possible solution:

    Carry an undecorated editable session name separately from the rendered account discriminator into the chat pane, and retain the display idempotence guard for labels already stored.

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

    Yes—current source provides a high-confidence path: an unlabeled non-default-account row supplies a suffixed pane title, and a partial edit is passed to sessions.patch. It was not executed locally because this review is read-only.

    Is this the best way to solve the issue?

    No for removing the idempotence guard: prevention at the chat-pane producer is the right layer, but the guard must continue protecting labels already captured by current main.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Removing the suffix idempotence guard would regress labels already captured by the current-main producer; a user-authored or previously persisted label cannot be safely distinguished from a leaked display suffix.

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

    Label changes

    Label changes:

    • add P2: This is a deterministic, limited-surface persistence and title-rendering defect without data loss, security impact, or a blocked setup path.
    • add impact:session-state: A display-only account discriminator can become a durable session label and later outlive the derivation it came from.
    • add impact:ux-friction: Affected users can see a doubled or stale account suffix after an ordinary inline rename.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
    • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

    Label justifications:

    • P2: This is a deterministic, limited-surface persistence and title-rendering defect without data loss, security impact, or a blocked setup path.
    • impact:session-state: A display-only account discriminator can become a durable session label and later outlive the derivation it came from.
    • impact:ux-friction: Affected users can see a doubled or stale account suffix after an ordinary inline rename.
    Evidence reviewed

    What I checked:

    Likely related people:

    • SebTardif: Authored the current-main multi-account display commit whose resolver documents the chat-header rename interaction. (role: recent display-behavior contributor; confidence: high; commits: bf4ec4b58af0; files: ui/src/lib/session-display.ts)
    • steipete: History identifies the merged header session-menu commit as the origin of this rename surface. (role: header-session-menu feature owner; confidence: medium; commits: 9d77e5c3b75b; files: ui/src/pages/chat/chat-pane-session-menu.ts, ui/src/pages/chat/chat-pane.test.ts)
    • vyctorbrzezowski: Recent history shows work on the sidebar session controller, whose stored-label rename behavior is the closest established sibling contract. (role: recent adjacent session-UI contributor; confidence: medium; commits: 5014839937b9; files: ui/src/components/session-organizer-controller.ts)
    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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2bugbug:behaviorclawsweeper-recovery-stuckclawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:session-stateimpact:ux-frictionissue-rating: 🦞 diamond lobstermaintainer

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions