setComposerCursor was deferred inside requestAnimationFrame while setPrompt was called synchronously. This caused an intermediate render where composerTrigger was computed with the new prompt text but the old cursor position, briefly reopening the command menu with incorrect results. Moving setComposerCursor alongside setPrompt ensures both states update in the same render cycle.