hermes - 💡(How to fix) Fix TUI: queued prompts follow the active live session after switching sessions [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

ui-tui/src/hooks/useQueue.ts currently keeps a single queueRef / queuedDisplay for the composer:

const queueRef = useRef<string[]>([])
const [queuedDisplay, setQueuedDisplay] = useState<string[]>([])

That state is not keyed by session_id / sid, while QueuedMessages renders composer.queuedDisplay regardless of which live session is active.

Fix Action

Fixed

Code Example

const queueRef = useRef<string[]>([])
const [queuedDisplay, setQueuedDisplay] = useState<string[]>([])
RAW_BUFFERClick to expand / collapse

Bug Description

In the TUI, queued composer prompts are stored in one shared composer queue instead of being scoped to the active live session. When multiple live sessions exist in the same TUI process, a prompt queued while viewing session A remains visible after switching to session B.

This is similar in shape to #35652 (multi-live-session events need owner scoping), but this report is specifically about the local TUI composer /queue / busy-input queue state.

Steps to Reproduce

  1. Start hermes --tui.
  2. Open or create two live sessions, A and B.
  3. In session A, queue a prompt with /queue follow-up for A or by submitting input while busy_input_mode=queue.
  4. Switch the TUI view to session B.
  5. Observe the queued prompt panel.

Expected Behavior

The queued prompt created in session A should remain owned by session A:

  • it should not be visible as session B's queue;
  • editing/deleting/draining queued prompts should operate on the queue for the session that owns them;
  • switching back to session A should show A's queued prompts again.

Actual Behavior

The queued prompt display follows the current TUI view. The underlying queue is effectively shared at the composer level, so switching from A to B can make A's queued prompt appear under B.

Root Cause

ui-tui/src/hooks/useQueue.ts currently keeps a single queueRef / queuedDisplay for the composer:

const queueRef = useRef<string[]>([])
const [queuedDisplay, setQueuedDisplay] = useState<string[]>([])

That state is not keyed by session_id / sid, while QueuedMessages renders composer.queuedDisplay regardless of which live session is active.

Proposed Fix

Key the TUI composer queue by live session id and update the active queue bucket when $uiSessionId changes. The active queueRef should point at the current session's queue bucket so existing enqueue/dequeue/edit paths continue to work, while the display is refreshed on session switch.

I have a fix branch ready that adds a small session-scoped queue manager and regression tests.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix TUI: queued prompts follow the active live session after switching sessions [1 pull requests]