Skip to content

[Bug] /session command doesn't create session until first message sent #5931

@WigglyBot123

Description

@WigglyBot123

Summary

When using /session <name> to switch to a new session in the webchat or TUI, the session does not appear in the session dropdown/picker until a message is actually sent.

Steps to Reproduce

  1. Open webchat Control UI
  2. Run /session chat1
  3. Run /session chat2
  4. Open the session dropdown

Expected

chat1 and chat2 should appear in the session list immediately after switching.

Actual

Only previously-used sessions appear. The new sessions are not visible until you send a message to them.

Root Cause

/session <name> only updates the client-side session key (stored in localStorage for webchat, or in state for TUI). The session entry is not created in sessions.json until there's actual activity (message sent/received). The session list (sessions.list) is populated from sessions.json.

Suggested Fix

When switching sessions via /session, call sessions.patch with the session key to ensure it gets created in the store (even if empty). The sessions.patch handler already supports creating new sessions:

// In setSession (tui-session-actions.js or webchat equivalent)
await client.patchSession({ key: nextKey });

This creates the session entry immediately, making it visible in dropdowns.

Workaround

Send any message to the session, or manually call sessions.patch via the gateway API.

Version

2026.1.30

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions