Skip to content

[Bug]: Desktop composer not ready on new session — first Enter fails, message stays in input, needs second send #63210

Description

@bgexpert

Description
In Hermes Desktop (Windows 10, build from 2026-07-12, version files 0.18.2), when opening a new chat (or switching sessions) and sending the first message:

  1. The message text from the previous chat remains visible in the composer input field.
  2. Pressing Enter the first time does nothing — the message stays in the input and is not sent.
  3. Pressing Enter a second time sends the message and clears the input; after that the chat works normally.

Reproduces 100% of the time on the first message of every new session.

Root cause (from logs + bundle analysis)
desktop.log contains:

[hermes] [renderer console] Uncaught Error: Composer is not available
(file:///.../win-unpacked/resources/app.asar/dist/assets/index-BK_BHFlU.js:4103)

In the renderer bundle, the composer wrapper classes (rCi/iCi thread-composer, aCi edit-composer) throw Composer is not available when _composerApi.getState() returns null. The send()/setText()/reset() methods all guard with if(!t)throw Error("Composer is not available"). On a fresh session the composer API state is null at the moment of the first Enter, so the send is dropped; by the second Enter the composer has mounted and getState() is non-null, so it works. This is a session-switch / mount-timing race in the Desktop UI layer (similar class to issue #46563).

Steps to reproduce

  1. Open Hermes Desktop.
  2. Start a new chat (or switch to a different session).
  3. Type a message and press Enter once.
  4. Observe: message is not sent, text remains in input.
  5. Press Enter again -> message sends and input clears.

Expected
First Enter sends the message and clears the input; the input should not retain text from a previous session when a new session is opened.

Environment

  • OS: Windows 10
  • Hermes: 0.18.2 (version files consistent)
  • Desktop build: win-unpacked, resources/app.asar/dist/assets/index-BK_BHFlU.js
  • Already tried: clearing %APPDATA%\Hermes\Local Storage\leveldb (composer-drafts cache) — did NOT fix it, confirming it is a runtime mount-timing bug, not stale cache.

Possible fix direction
Make the composer wrapper resilient to null state: queue send()/setText() and flush once _composerApi.getState() becomes available, instead of throwing Composer is not available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/desktopElectron desktop app (apps/desktop/*)sweeper:implemented-on-mainSweeper: behavior already present on current mainsweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions