fix(desktop): guard composer mutations when the composer core isn't bound (#49903) - #51728
Merged
Merged
Conversation
…ound The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
pai-scaffolde
pushed a commit
to pai-scaffolde/hermes-agent
that referenced
this pull request
Jun 28, 2026
…ound (NousResearch#51728) The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (NousResearch#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (NousResearch#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ound (NousResearch#51728) The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (NousResearch#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (NousResearch#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…ound (NousResearch#51728) The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (NousResearch#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (NousResearch#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…ound (NousResearch#51728) The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (NousResearch#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (NousResearch#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
15 tasks
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…ound (NousResearch#51728) The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (NousResearch#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (NousResearch#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…ound (NousResearch#51728) The desktop composer threw an uncaught "Composer is not available" at startup and the input went unresponsive (NousResearch#49903). assistant-ui's composer mutators (setText/send/…) throw when the thread's composer core isn't bound yet; the read path is null-safe but the writes are not. ChatBar pushes draft text via aui.composer().setText() from mount-time effects (draft restore, clearDraft, external inserts), and the v0.17.0 popout refactor (NousResearch#49488) widened the unbound window by moving the composer out of the contain wrapper into a sibling of the thread — so the throw surfaced as an uncaught error that wedged the input. Wrap every composer mutation in a setComposerText helper that swallows the unbound-core throw. The contentEditable DOM + draftRef already hold the text and the draft-editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The desktop composer no longer throws
Uncaught Error: Composer is not availableat startup, and the input stays interactive after upgrading to v0.17.0. Fixes #49903.Root cause: assistant-ui's composer mutators (
setText/send/…) throwComposer is not availablewhen the thread's composer core isn't bound yet (@assistant-ui/corecomposer-runtime.ts). The read path (useAuiState(s => s.composer.text)) is null-safe, but the writes are not.ChatBarpushes draft text viaaui.composer().setText()from mount-time effects (draft restore →loadIntoComposer,clearDraft, external inserts). The v0.17.0 popout refactor (#49488) widened the unbound window by moving the composer out of thecontainwrapper into a sibling of the thread, so the throw began surfacing as an uncaught error that wedged the input — emitted twice (initial mount + session-resolve), matching the report's back-to-back errors.Changes
apps/desktop/src/app/chat/composer/index.tsx: add asetComposerTexthelper that wrapsaui.composer().setText()in a try/catch swallowing the unbound-core throw; route all 9setTextcall sites through it. The contentEditable DOM +draftRefalready hold the text and the draft⇄editor sync re-applies it once the core attaches, so the draft is never lost — only the premature state push is skipped.composer-text-guard.test.tsx: regression test — the guard absorbs the throw at startup (no uncaught error, input usable) and writes through once the core is bound.Validation
Composer is not available, input deadnpm run typecheck(apps/desktop): cleannpm run --prefix apps/desktop build: ✓ builtvitest run composer-text-guard.test.tsx: 2/2 passedInfographic