Skip to content

[Bug]: Control UI session names can disappear even though label is still persisted #98742

Description

@BSG2000

Bug type

UI/state regression

Beta release blocker

No

Summary

Control UI/WebChat session names can appear to disappear even though the server-side session store still has the user-provided label.

This looks like a display/rehydration mismatch rather than true data loss: /name <label> persists label in agents/<agentId>/sessions/sessions.json, but some UI/session-list paths appear to render only derivedTitle/displayName/the raw session key after reloads, gateway restarts, or visible dashboard session-family rotations.

What happened

A dashboard session was renamed with /name <custom-label>.

Later, the same visible dashboard session appeared unnamed / UUID-like in the Control UI, making it look as if the name was lost.

Local state inspection showed the label was still present:

{
  "key": "agent:main:dashboard:<uuid>",
  "sessionId": "<current-session-id>",
  "usageFamilyKey": "agent:main:dashboard:<same-uuid>",
  "usageFamilySessionIds": [
    "<older-session-id-1>",
    "<older-session-id-2>",
    "<older-session-id-3>",
    "<current-session-id>"
  ],
  "sessionFile": "agents/main/sessions/<current-session-id>.jsonl",
  "label": "<custom-label>"
}

The active transcript for <current-session-id>.jsonl contained only the rename command and assistant acknowledgement:

session
user: /name <custom-label>
assistant: <ack>

So the user-visible name was not actually removed from sessions.json; it was either not used by the UI after state refresh, or not propagated into the field the UI currently renders.

Expected behavior

A manually named session should consistently render the user-provided label across:

  • current chat header / active session display
  • session picker/list rows
  • page reloads / WebSocket reconnects
  • gateway hot restarts
  • session-family rotations where the visible dashboard key keeps the same usageFamilyKey but sessionId changes

Title fallback should consistently be something like:

derivedTitle ?? displayName ?? label ?? key

or the server should materialize displayName from label for all session-list/change payloads that UI clients consume.

Evidence from source inspection

Related code suggests the model has multiple display fields:

  • src/sessions/session-label.ts parses user-editable labels.
  • src/gateway/session-utils.ts builds session rows with both label and displayName; one path appears to fall back from displayName to entry.label.
  • src/tui/tui-command-handlers.ts session picker title uses session.derivedTitle ?? session.displayName, while session.label is only included in searchText.
  • src/acp/translator.ts already maps title as derivedTitle ?? displayName ?? label ?? key.

That inconsistency makes it plausible that some clients render raw keys even when label is still persisted.

Related issues

Privacy note

The example above is sanitized. The real local session key, label, and session IDs were only used to verify persistence locally; no private prompt content or identifying label is required to reproduce the field-mapping issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions