diff --git a/README.org b/README.org index a8f28691..5ebf67db 100644 --- a/README.org +++ b/README.org @@ -20,12 +20,13 @@ 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]]) ----- 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))