aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-02 00:44:52 -0400
committerCraig Jennings <c@cjennings.net>2026-07-02 00:44:52 -0400
commit6252ec01350bd211e043bb84b31498cc00a11046 (patch)
tree733f1e80ea3d332620cadab18463abc994d57b86
parent2d1571114a5f54d416dddcdf098047b361bf7825 (diff)
downloaddotemacs-6252ec01350bd211e043bb84b31498cc00a11046.tar.gz
dotemacs-6252ec01350bd211e043bb84b31498cc00a11046.zip
fix(ai-term): drop the Agent: echo after an agent swap
The message duplicated the modeline directly above it: the buffer name and the eat state icons already announce which agent is focused, so the echo just lingered as clutter. The no-other-agents echo stays, since it reports something the modeline can't.
-rw-r--r--modules/ai-term.el12
-rw-r--r--tests/test-ai-term--next-single-agent.el7
2 files changed, 12 insertions, 7 deletions
diff --git a/modules/ai-term.el b/modules/ai-term.el
index 43000fb9..7973f7aa 100644
--- a/modules/ai-term.el
+++ b/modules/ai-term.el
@@ -299,9 +299,9 @@ picker and C-; a k closes an agent."
;; erroring, so the swap key doubles as a "start an agent" key.
(cj/ai-term-pick-project))
;; Sole agent, already focused: the rotation wraps back to the same
- ;; agent, so a swap would be a no-op with a misleading "Agent:" echo.
- ;; Say there's nowhere to go instead. A sole agent that is displayed
- ;; but not selected still falls through and gets selected.
+ ;; agent, so a swap would be a silent no-op. Say there's nowhere to
+ ;; go instead. A sole agent that is displayed but not selected still
+ ;; falls through and gets selected.
((and current-dir
(equal next-dir current-dir)
(eq win (selected-window)))
@@ -312,12 +312,14 @@ picker and C-; a k closes an agent."
;; Live agent and an agent window is up: swap it into that window in
;; place (faithful to the prior buffer-only behavior). Detached, or no
;; window yet: show-or-create attaches the tmux session / displays it.
+ ;; No "Agent: <name>" echo after the swap: the modeline already
+ ;; announces the agent (buffer name + eat state), and the duplicate
+ ;; message was echo-area clutter (roam inbox, 2026-07-02).
(if (and win existing (cj/--ai-term-process-live-p existing))
(progn (set-window-buffer win existing) (select-window win))
(cj/--ai-term-show-or-create next-dir name)
(let ((w (get-buffer-window name)))
- (when w (select-window w))))
- (message "Agent: %s" name))))))
+ (when w (select-window w)))))))))
;; ai-term lives under the C-; a prefix (vacated when gptel was archived).
;; The frequent "swap to the next agent" also gets M-SPC for a fast chord.
diff --git a/tests/test-ai-term--next-single-agent.el b/tests/test-ai-term--next-single-agent.el
index f31807d0..1814d937 100644
--- a/tests/test-ai-term--next-single-agent.el
+++ b/tests/test-ai-term--next-single-agent.el
@@ -97,7 +97,10 @@
(kill-buffer buf))))
(ert-deftest test-ai-term-next-two-agents-still-swaps ()
- "Normal: two agents, one focused -> swaps to the other, no no-others message."
+ "Normal: two agents, one focused -> swaps silently to the other.
+The modeline announces the agent (buffer name + eat state), so the swap
+emits no echo-area message (2026-07-02: the \"Agent: <name>\" echo was
+dropped as clutter duplicating the modeline)."
(let ((buf-a (get-buffer-create "agent-buf-a"))
(buf-b (get-buffer-create "agent-buf-b"))
(captured nil))
@@ -117,7 +120,7 @@
(when fmt (setq captured (apply #'format fmt args))))))
(cj/ai-term-next)
(should (eq (window-buffer (selected-window)) buf-b))
- (should (equal captured "Agent: agent-buf-b"))))
+ (should-not captured)))
(kill-buffer buf-a)
(kill-buffer buf-b))))