Skip to content

fix(desktop): prevent "Composer is not available" error on boot after v0.17 upgrade - #49979

Closed
Andy365-365 wants to merge 3 commits into
NousResearch:mainfrom
Andy365-365:fix/composer-unbound-v2
Closed

fix(desktop): prevent "Composer is not available" error on boot after v0.17 upgrade#49979
Andy365-365 wants to merge 3 commits into
NousResearch:mainfrom
Andy365-365:fix/composer-unbound-v2

Conversation

@Andy365-365

Copy link
Copy Markdown

What does this PR do?

Add a defensive safeSetText wrapper around aui.composer().setText() in composer/index.tsx. When the assistant-ui composer core binding is not yet established (e.g. during boot or session switch), setText throws "Composer is not available". The wrapper catches this specific error and defers the call to the next frame via requestAnimationFrame, giving the binding time to resolve. Other errors rethrow normally.

Related Issue

Fixes #49903

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

File: apps/desktop/src/app/chat/composer/index.tsx (+28 lines, -5 lines)

  • Added safeSetText — a useCallback wrapper that catches "Composer is not available" and retries on the next frame
  • Replaced aui.composer().setText() with safeSetText() in:
    • clearDraft — clears composer on session switch
    • loadIntoComposer — restores draft text on mount / session switch
    • insertText — external text injection (defensive)
    • insertInlineRefs — inline ref insertion (defensive)
  • Updated clearDraft's useCallback dependency from [aui] to [safeSetText]

How to Test

  1. Upgrade from v0.16.0 to v0.17.0 (or set localStorage.setItem('hermes.desktop.composerPopout.enabled', 'true'))
  2. Launch Hermes Desktop
  3. Verify the composer input is responsive — no "Composer is not available" in DevTools Console
  4. Switch between sessions — composer should load draft text without errors
  5. Paste text, use voice input, trigger /slash commands — all interactions work normally

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (N/A: the bug requires assistant-ui core binding to be unresolved at boot, which cannot be reproduced in an isolated test environment)
  • I've tested on my platform: Ubuntu 24.04

Documentation & Housekeeping

  • N/A — no documentation, config, or architecture changes needed

Screenshots / Logs

N/A — the fix prevents a console error, no visual change.

When the assistant-ui composer core binding is not yet established
(e.g. during boot or session switch), aui.composer().setText() throws
'Composer is not available'. This was reported after upgrading to
v0.17.0 where the composer popout refactor introduced a timing window
where the boot-time useEffect fires before the binding resolves.

Add a safeSetText wrapper that catches the error and defers to the
next frame via requestAnimationFrame, giving the binding time to
resolve. Applied to all setText call paths including loadIntoComposer,
clearDraft, insertText, and insertInlineRefs.

Fixes NousResearch#49903
@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists labels Jun 21, 2026
setPreviewTarget() only set the preview target and selected the right rail tab,
but never called setPaneOpen('preview', true). After the user closed the preview
panel (dismissPreviewTarget), the pane open state remained false, so subsequent
browser_navigate calls loaded content but the panel stayed hidden.
@Andy365-365
Andy365-365 marked this pull request as draft June 21, 2026 14:04
@Andy365-365
Andy365-365 marked this pull request as ready for review June 21, 2026 14:04
@alt-glitch alt-glitch added comp/desktop Electron desktop app (apps/desktop/*) and removed comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 26, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused desktop investigation. This automated hermes-sweeper review found that the requested behavior is already implemented on current main.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(desktop): v0.17.0 throws "Uncaught Error: Composer is not available" — input becomes unresponsive after upgrade

4 participants