Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Show the model variant of a running subagent in the `spawn_agent` tool call details table when the server sends one.
- Bugfix: kill commands not covered by the deletion guards (`backward-kill-sentence`, `backward-kill-sexp`, `kill-line`, `kill-region`, etc.) could cross the prompt/context markup and corrupt the chat prompt area, making RET fail with `args-out-of-range` (#305). Kills are now clamped to the prompt field (and blocked above it), the transient-area refresh skips instead of signaling on a corrupted block, and `eca-chat-clear-prompt` (`C-c C-d`) rebuilds the prompt markup when it is broken.

- Perf: cache the pending tool call approval status instead of rescanning the whole chat buffer on every mode-line/tab-line/header-line redisplay, which made Emacs sluggish on long chats (#307).
Expand Down
2 changes: 2 additions & 0 deletions eca-chat.el
Original file line number Diff line number Diff line change
Expand Up @@ -3960,6 +3960,7 @@ Append STATUS symbol. Optional PARENT-ID for nested rendering."
(-let* ((agent-name (plist-get args :agent))
(task (plist-get args :task))
(model (plist-get details :model))
(variant (plist-get details :variant))
(step (plist-get details :step))
(max-steps (plist-get details :maxSteps))
(usage-str (eca-chat--subagent-usage-str id))
Expand Down Expand Up @@ -4013,6 +4014,7 @@ Append STATUS symbol. Optional PARENT-ID for nested rendering."
(eca-chat--content-table
`(("Agent" . ,agent-name)
("Model" . ,model)
,@(when variant `(("Variant" . ,variant)))
,@(when task `(("Task" . ,(concat task "\n\n"))))
,@(when output-text `(("Output" . ,(concat "\n" output-text))))))
nil
Expand Down
27 changes: 27 additions & 0 deletions test/eca-chat-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,33 @@ When MANUAL is non-nil the tool call requires manual approval."
(expect (overlay-get (eca-chat--get-expandable-content "parent-1")
'eca-chat--tool-call-status)
:to-equal eca-chat-mcp-tool-call-loading-symbol))
(kill-buffer buf))))

(it "shows the subagent variant row when details carry one"
(let ((buf (eca-chat-test--make-render-buffer)))
(unwind-protect
(eca-chat--with-current-buffer buf
(eca-chat--tool-call-subagent-details
"sub-1" (list :agent "test-agent" :task "task")
"Calling subagent" nil nil
eca-chat-mcp-tool-call-loading-symbol nil
(list :type "subagent" :model "test-model" :variant "high"))
(eca-chat--expandable-content-toggle "sub-1" t nil)
(expect (buffer-string) :to-match "Variant")
(expect (buffer-string) :to-match "high"))
(kill-buffer buf))))

(it "omits the subagent variant row when details have none"
(let ((buf (eca-chat-test--make-render-buffer)))
(unwind-protect
(eca-chat--with-current-buffer buf
(eca-chat--tool-call-subagent-details
"sub-2" (list :agent "test-agent" :task "task")
"Calling subagent" nil nil
eca-chat-mcp-tool-call-loading-symbol nil
(list :type "subagent" :model "test-model"))
(eca-chat--expandable-content-toggle "sub-2" t nil)
(expect (buffer-string) :not :to-match "Variant"))
(kill-buffer buf)))))

(describe "eca-chat--apply-markdown-markup-visibility"
Expand Down
Loading