From 7a2a0f3520f86b5b2c40bb360091105f529d4dd0 Mon Sep 17 00:00:00 2001 From: Tim Visher <34676+timvisher@users.noreply.github.com> Date: Sat, 16 May 2026 12:01:00 -0400 Subject: [PATCH 1/2] Hijack agent-shell-resume-session to use the session picker Repurpose agent-shell-resume-session from an ID-prompt command into a session-picker entry point that calls agent-shell--start with :session-strategy 'prompt. Add a :show-session-id keyword to agent-shell--start that buffer-locally sets agent-shell-show-session-id, so users with an ID in hand can find it via their completion framework's fuzzy matching even when the variable is off globally. Closes agent-shell-ufm. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.org | 1 + agent-shell.el | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index a8f28691..0b8dbc70 100644 --- a/README.org +++ b/README.org @@ -26,6 +26,7 @@ A soft fork of [[https://github.com/xenodium/agent-shell][agent-shell]] with ext - Bug fix for upstream =shell-maker-define-major-mode= mode-map quoting — without it, every =agent-shell-mode= invocation emits =void-function keymap= because the bare keymap value gets spliced into a backquote that re-evaluates =(keymap ...)= as a function call (worth upstreaming separately) - Live-validate workflow doc (=.agents/commands/live-validate.md=) describing the batch-mode rendering verification used for rendering-pipeline changes - =gfm-mode= compose buffer for the interactive =agent-shell-queue-request=, replacing the read-string minibuffer prompt (non-interactive callers still pass =PROMPT= directly) +- =agent-shell-resume-session= repurposed from an ID-prompt command into a session-picker entry point: opens the same fuzzy-completion picker that =agent-shell-session-strategy= ='prompt= uses, and force-shows session IDs in the picker (via a new =:show-session-id= keyword on =agent-shell--start=) so users with an ID in hand can find it via their completion framework ([[https://github.com/timvisher-dd/agent-shell-plus/pull/11][#11]]) ----- diff --git a/agent-shell.el b/agent-shell.el index 3f7c2a04..3e6721ba 100644 --- a/agent-shell.el +++ b/agent-shell.el @@ -1180,19 +1180,20 @@ Works from both shell and viewport buffers." (agent-shell--display-buffer new-shell-buffer))))) ;;;###autoload -(defun agent-shell-resume-session (session-id) - "Resume an existing agent session by SESSION-ID. - -Prompts for agent selection and starts a new shell that resumes -the session identified by SESSION-ID." - (interactive "sSession ID: ") - (when (string-empty-p (string-trim session-id)) - (user-error "Session ID cannot be empty")) +(defun agent-shell-resume-session () + "Resume an existing agent session via the session picker. + +Prompts for agent selection, then starts a new shell that lists known +sessions and lets the user pick one to resume. Session IDs are shown +in the picker (overriding `agent-shell-show-session-id' for this shell) +so users who know an ID can find it via their completion framework." + (interactive) (agent-shell--start :config (or (agent-shell--resolve-preferred-config) (agent-shell-select-config :prompt "Resume with agent: ") (error "No agent config found")) - :session-id session-id + :session-strategy 'prompt + :show-session-id t :new-session t)) ;;;###autoload @@ -2815,7 +2816,7 @@ FUNCTION should be a function accepting keyword arguments (&key ...)." (list (car pair) (cdr pair))) alist))) -(cl-defun agent-shell--start (&key config no-focus new-session session-strategy session-id fork-session-id outgoing-request-decorator) +(cl-defun agent-shell--start (&key config no-focus new-session session-strategy show-session-id session-id fork-session-id outgoing-request-decorator) "Programmatically start shell with CONFIG. See `agent-shell-make-agent-config' for config format. @@ -2823,6 +2824,7 @@ See `agent-shell-make-agent-config' for config format. Set NO-FOCUS to start in background. Set NEW-SESSION to start a separate new session. SESSION-STRATEGY overrides `agent-shell-session-strategy' buffer-locally. +SHOW-SESSION-ID overrides `agent-shell-show-session-id' buffer-locally. SESSION-ID resumes an existing session by its id string. FORK-SESSION-ID forks an existing session by its id string. OUTGOING-REQUEST-DECORATOR is passed through to `acp-make-client'." @@ -2922,6 +2924,8 @@ variable (see makunbound)")) (map-put! agent-shell--state :fork-session-id fork-session-id)) (when session-strategy (setq-local agent-shell-session-strategy session-strategy)) + (when show-session-id + (setq-local agent-shell-show-session-id show-session-id)) ;; Show deferred welcome text, ;; but first wipe buffer content. (let ((inhibit-read-only t)) From 3606dc6b05c8ded9d1c98ba2e0b02117687ea67d Mon Sep 17 00:00:00 2001 From: Tim Visher <194828183+timvisher-dd@users.noreply.github.com> Date: Tue, 19 May 2026 19:37:01 -0400 Subject: [PATCH 2/2] Backfill PR links on prior feature list entries The five rendering-pipeline entries that landed in #7 and the gfm-mode compose buffer entry from #9 went in without PR references. Add them so every bullet in the feature list points back to its PR. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index 0b8dbc70..5ebf67db 100644 --- a/README.org +++ b/README.org @@ -20,12 +20,12 @@ A soft fork of [[https://github.com/xenodium/agent-shell][agent-shell]] with ext - Append-in-place rendering for streamed fragments: tokens append to existing fragment bodies without rebuilding, with boundary-newline normalization so paragraph-break chunks don't compound newlines and an empty =agent_message_chunk= mid-stream is rewritten to a paragraph break so two content blocks in the same turn don't run together ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) - DWIM context insertion: inserted context lands at the prompt and fragment updates no longer drag process-mark past it ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) - Runtime buffer invariant checking with event tracing and violation debug bundles, including head + tail snapshots for long buffers ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) -- Render =session/update= chunks streamed after =session/prompt= resolves so a Claude Code Stop-hook bounce-and-regen turn no longer freezes the buffer mid-conversation -- Surface raw claude-agent-acp SDK messages (including hook lifecycle events) in the debug log when =agent-shell-logging-enabled= is set, so Stop-hook =decision:block= cycles and other hook-driven turn behavior are visible -- Tunable markdown-overlay debounce via =agent-shell-markdown-overlay-debounce-delay= (default 0.15s) for slow terminals or streaming-debug sessions -- Bug fix for upstream =shell-maker-define-major-mode= mode-map quoting — without it, every =agent-shell-mode= invocation emits =void-function keymap= because the bare keymap value gets spliced into a backquote that re-evaluates =(keymap ...)= as a function call (worth upstreaming separately) -- Live-validate workflow doc (=.agents/commands/live-validate.md=) describing the batch-mode rendering verification used for rendering-pipeline changes -- =gfm-mode= compose buffer for the interactive =agent-shell-queue-request=, replacing the read-string minibuffer prompt (non-interactive callers still pass =PROMPT= directly) +- Render =session/update= chunks streamed after =session/prompt= resolves so a Claude Code Stop-hook bounce-and-regen turn no longer freezes the buffer mid-conversation ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) +- Surface raw claude-agent-acp SDK messages (including hook lifecycle events) in the debug log when =agent-shell-logging-enabled= is set, so Stop-hook =decision:block= cycles and other hook-driven turn behavior are visible ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) +- Tunable markdown-overlay debounce via =agent-shell-markdown-overlay-debounce-delay= (default 0.15s) for slow terminals or streaming-debug sessions ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) +- Bug fix for upstream =shell-maker-define-major-mode= mode-map quoting — without it, every =agent-shell-mode= invocation emits =void-function keymap= because the bare keymap value gets spliced into a backquote that re-evaluates =(keymap ...)= as a function call (worth upstreaming separately) ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) +- Live-validate workflow doc (=.agents/commands/live-validate.md=) describing the batch-mode rendering verification used for rendering-pipeline changes ([[https://github.com/timvisher-dd/agent-shell-plus/pull/7][#7]]) +- =gfm-mode= compose buffer for the interactive =agent-shell-queue-request=, replacing the read-string minibuffer prompt (non-interactive callers still pass =PROMPT= directly) ([[https://github.com/timvisher-dd/agent-shell-plus/pull/9][#9]]) - =agent-shell-resume-session= repurposed from an ID-prompt command into a session-picker entry point: opens the same fuzzy-completion picker that =agent-shell-session-strategy= ='prompt= uses, and force-shows session IDs in the picker (via a new =:show-session-id= keyword on =agent-shell--start=) so users with an ID in hand can find it via their completion framework ([[https://github.com/timvisher-dd/agent-shell-plus/pull/11][#11]]) -----