From a086088b4e834edec208c1a908c5f9715a699f8d Mon Sep 17 00:00:00 2001 From: Sam Magnuson Date: Mon, 30 Mar 2026 12:11:33 -0700 Subject: [PATCH] Fix deferred buffer display racing with session bootstrap When session-strategy is 'prompt, the buffer display is deferred to avoid showing an empty buffer before the user selects a session. However, it subscribes to 'session-selected, which fires before the session resume/load and model set complete. This means the buffer may never visibly appear if display-buffer runs before bootstrap finishes, or the "Loading..." active message persists indefinitely. Subscribe to 'prompt-ready instead, which fires after the full bootstrap chain (session load, model set, prompt display) completes. --- agent-shell.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent-shell.el b/agent-shell.el index 4f278ee..aed206a 100644 --- a/agent-shell.el +++ b/agent-shell.el @@ -2810,7 +2810,7 @@ variable (see makunbound)")) ;; display the buffer. (agent-shell-subscribe-to :shell-buffer shell-buffer - :event 'session-selected + :event 'prompt-ready :on-event (lambda (_event) (agent-shell--display-buffer shell-buffer))) (agent-shell--display-buffer shell-buffer))))