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
Copy link
Copy Markdown
Contributor

@smagnuso smagnuso commented May 30, 2026

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.

…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.

1 participant