Skip to content

make it possible for turns to occur in the stream that are not agent-shell initiated#610

Open
smagnuso wants to merge 1 commit into
xenodium:mainfrom
smagnuso:pr/mux
Open

make it possible for turns to occur in the stream that are not agent-shell initiated#610
smagnuso wants to merge 1 commit into
xenodium:mainfrom
smagnuso:pr/mux

Conversation

@smagnuso

@smagnuso smagnuso commented May 30, 2026

Copy link
Copy Markdown
Contributor

I am working on a muxer called hydra-acp that allows agent-shell to play nicely with the same session running in the terminal (or other clients like slack, browser, etc). The nice thing here is you can switch operating mode from emacs to terminal easily by:

npm install -g @hydra-acp/cli

And adding this to your .emacs:

(setq agent-shell-command-prefix (lambda (_buffer) (and (executable-find "hydra-acp") '("hydra-acp" "launch"))))
(advice-add 'agent-shell--make-acp-client :around
            (lambda (orig-fn &rest args)
              (let* ((buf (plist-get args :context-buffer))
                     (cmd (plist-get args :command))
                     (env (plist-get args :environment-variables))
                     (extra (delq nil
                                  (list (when buf (format "HYDRA_ACP_NAME=%s" (buffer-name buf)))
                                        (when cmd (format "HYDRA_ACP_AGENT=%s" cmd))))))
                (plist-put args :environment-variables (append extra env))
                (apply orig-fn args))))

With this you can then start agent-shell as normal and interact. Then in a terminal just run hydra-acp and the same session shows up in terminal making it easy to switch modes of operation. Similarly you can start in hydra-acp on the terminal and then go to agent-shell and find your session in the session list and join it there.

Thank you for contributing to agent-shell!

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I'm making visual changes, so I'm including screenshots so you can view and discuss.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

@xenodium

xenodium commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Sorry, it's taking me some time to get to some PRs and issues since #500. AFAIK, at present, this isn't possible with current ACP featureset? Having said that, a few months ago, someone wanted something similar in agent-shell and so we added something non-standard. Have a look in agent-shell-experimental.el.

;; session/push: Server-initiated prompt push.  The server sends
;; a request to the client, followed by session/update notifications,
;; concluded by an session_push_end notification.  The client
;; then responds to the original request.

@smagnuso
smagnuso force-pushed the pr/mux branch 2 times, most recently from f0a2f37 to b660d71 Compare July 6, 2026 19:17
@smagnuso

smagnuso commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, it's taking me some time to get to some PRs and issues since #500. AFAIK, at present, this isn't possible with current ACP featureset? Having said that, a few months ago, someone wanted something similar in agent-shell and so we added something non-standard. Have a look in agent-shell-experimental.el.

;; session/push: Server-initiated prompt push.  The server sends
;; a request to the client, followed by session/update notifications,
;; concluded by an session_push_end notification.  The client
;; then responds to the original request.

No worries and congrats on the baby, hope all is going great :)

You're right from current ACP it isn't really possible but there is outstanding rfd to deal with multiplexing that I'm leaning on in hydra. I'm not sure that session/push is quite what we're looking for since the session is really being multiplexed rather than just happening out of band.

…shell initiated but still render by agent-shell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants