agent-shell 0.78 更新
摘要
agent-shell 0.78 引入了持久化提示和引导功能,用于在 Emacs 中与 AI 代理交互,并支持新的代理如 Antigravity 和 Qoder CLI。
<p><a href="https://lobste.rs/s/ujn9jm/agent_shell_0_78_updates">评论</a></p>
查看缓存全文
缓存时间: 2026/09/24 13:01
# agent-shell 0.78 更新
来源:https://xenodium.com/agent-shell-0-78-updates
2026年9月22日——又是一个月,又是一次 agent-shell (https://github.com/xenodium/agent-shell) 更新。如果您错过了上一篇文章,可以查看 0.73 更新 (https://xenodium.com/agent-shell-0-73-updates)。
与往常一样,本文将突出介绍主要亮点,但如果您想了解详尽细节,请查看完整的变更列表 (https://github.com/xenodium/agent-shell/compare/v0.73.2...v0.78.2)。
## 什么是 `agent-shell`?
agent-shell (https://github.com/xenodium/agent-shell) 是一个原生 Emacs (https://www.gnu.org/software/emacs/) 模式,用于与由 ACP(Agent Client Protocol (https://agentclientprotocol.com/))驱动的 AI 代理进行交互。
## 新增支持的代理
又有两个新代理加入家族,通常可通过 `M-x agent-shell` 使用,或通过以下方式显式启动:
- Antigravity (https://antigravity.google/docs/ide/extensions)(由 Google 提供),PR #795 (https://github.com/xenodium/agent-shell/pull/795),由 @tychoish (https://github.com/tychoish) 贡献。通过 `M-x agent-shell-start-antigravity-agent` 启动。
- Qoder CLI (https://qoder.com/),PR #831 (https://github.com/xenodium/agent-shell/pull/831),由 @unship (https://github.com/unship) 贡献。通过 `M-x agent-shell-start-qoder-agent` 启动。
## 随时提示
这可能是本次发布中影响最大的功能。它易于发现且非常实用,预计会有很多人使用。
典型的 shell 体验是提供一个提示符。用户输入并提交命令,等待命令执行完成,然后 shell 提示符才会再次出现。
基于 `comint-mode`,`agent-shell` 以前也是如此。也就是说,直到现在。
从 v0.78 版本开始,`agent-shell` 始终在缓冲区末尾提供一个可写的提示符。提交后,提示符会立即返回,而代理正忙于处理当前轮次。再次输入并提交,`agent-shell` 会根据需要自动将您的请求排入队列。
虽然排队本身不是一个新功能,但通过 shell 提示符排队在认知负担方面提供了一个免费优化。像往常一样提交提示(通过 `RET` 绑定),让 `agent-shell` 决定是立即处理还是稍后排队。
持久提示默认通过 `agent-shell-persistent-prompt-enabled` 启用。如果您不喜欢,可以轻松禁用:
```
(setopt agent-shell-persistent-prompt-enabled nil)
```
视口的组合缓冲区无论怎样都存在,从那里提交内容也会经过完全相同的逻辑处理。
## 引导运行中的轮次
从本次发布开始,`agent-shell` 还能够引导轮次(前提是代理支持 `_session/steering` ACP 扩展)。引导功能使您可以在飞行中纠正提示,而无需取消或等待提示处理完成。目前,我知道 `Claude` 和 `Codex` 支持 ACP 引导,但如果您知道其他支持代理,请告知。
通过 `M-x agent-shell-prompt-steer` 引导进行中的轮次,体验与现有的 `M-x agent-shell-prompt-queue` 类似。即在小缓冲区中提示用户输入文本。话虽如此,我们现在有了新的持久提示,而且正如我们所知,`RET` 绑定会根据需要自动排队。现在,您还可以通过 `M-RET` 绑定提交来引导。
非常感谢 @OSadovy (https://github.com/OSadovy),他在 PR #777 (https://github.com/xenodium/agent-shell/pull/777) 中承担了引导功能的实现工作。
## 可配置的 RET
由于 `RET` 和 `M-RET` 分别根据需要进行排队和引导,默认行为可通过 `agent-shell-busy-submit-default-function` 配置(默认排队),而 `M-RET`(或 `C-u RET`)路径使用 `agent-shell-busy-submit-override-function`(默认引导)。这两个自定义选项都接受函数,因此如果您想要不同的行为,可以通过类似方式交换功能:
```
(setopt agent-shell-busy-submit-default-function
#'agent-shell-busy-submit-steer)
(setopt agent-shell-busy-submit-override-function
#'agent-shell-busy-submit-queue)
```
两者都适用于任何在轮次中提交提示的情况,无论是 shell 提示符还是视口的组合缓冲区。作为 Emacs 用户,我们希望有各种各样的自定义,因此也可以使用自定义函数来实现与提供功能略有不同的需求。
## 拖放
虽然我们已经可以使用 `C-y` 粘贴剪贴板中的截图,但现在我们可以将文件从外部文件管理器拖放到 shell 或视口缓冲区。图像会预览,其他任何文件则作为 `@path` 链接附加。
感谢 @dustinfarris (https://github.com/dustinfarris) 贡献的 PR #825 (https://github.com/xenodium/agent-shell/pull/825)。同时,@dustinfarris (https://github.com/dustinfarris) 还修复了文件提及中路径包含空格的问题(PR #824 (https://github.com/xenodium/agent-shell/pull/824))。
### macOS 免费小功能
这么久以来,我一直不知道 macOS 截图工具生成的临时缩略图是可拖拽的,因此您现在可以直接将其拖放到您的 `agent-shell` 会话中。
感谢 @dustinfarris (https://github.com/dustinfarris) 提供的提示!
## 显示费用
如果您想关注 token 成本,现在可以在上下文使用指示器之后显示会话的累积费用。
目前默认关闭,可通过以下方式选择启用:
```
(setopt agent-shell-show-cost-indicator t)
```
请注意,仅对通过 ACP 报告费用的代理显示费用。感谢 @mrcnski (https://github.com/mrcnski) 贡献的 PR #834 (https://github.com/xenodium/agent-shell/pull/834)。
## 搜索折叠的缓冲区
`agent-shell` 默认折叠很多内容(工具调用、思考过程、分组),如果您想要更紧密的 `isearch` 集成,需要额外的帮助。感谢 @mrcnski (https://github.com/mrcnski) 在 PR #832 (https://github.com/xenodium/agent-shell/pull/832) 中的贡献,折叠的部分现在会遵守 `search-invisible` 设置。
搜索完成后,它还会重新折叠之前展开的内容,包括分组。同时感谢 @Gleek (https://github.com/Gleek) 贡献的 PR #827 (https://github.com/xenodium/agent-shell/pull/827):展开片段现在不再破坏 `isearch` 的匹配数据。
## 斜杠命令识别
斜杠命令补全现在以更地道的方式在所有三个界面(shell 提示符、视口组合缓冲区、小缓冲区)中提供:仅当 `/` 前面是空白字符时才触发。感谢 @izeigerman (https://github.com/izeigerman) 贡献的 PR #810 (https://github.com/xenodium/agent-shell/pull/810)。
`@` 之后的文件补全保持不变。
## 复制最后输出
我们现在有 `M-x agent-shell-copy-last-output`,无论光标位置如何,它都会获取最近的输出,因此您可以从缓冲区的任何位置提取最新响应。
## 链接改进
链接获得了一些值得一提的修复/改进:
- 现在可以链接 `code` 代码跨度内的文件引用(PR #781 (https://github.com/xenodium/agent-shell/issues/781)、#782 (https://github.com/xenodium/agent-shell/issues/782),感谢 @OSadovy (https://github.com/OSadovy))。
- 表格内的链接现在可操作。
- 链接在流式传输时现在更稳定。
- 指向本地目录的链接现在会在 `dired` 中打开。
- 链接上的光标传感器提示不再错位。
## 带前缀参数的视口分页
在上一页/下一页使用 `C-u N` 现在移动 N 个交互项,而不是一个,负前缀则反向翻页。向前移动超过最新的交互项会恢复一个已暂停的组合快照,因此 `C-u N` 的作用相当于按 N 次按键,而不是在您草稿之前就停止。感谢 @liaowang11 (https://github.com/liaowang11) 贡献的 PR #813 (https://github.com/xenodium/agent-shell/pull/813)。
## 表格外观
继上个月的表格工作之后,普通数据行现在有了自己的外观,并且每个表格外观都继承自一个基础外观。如果您想整体重新设计表格样式,现在只需在一个地方修改即可。感谢 @mrcnski (https://github.com/mrcnski) 贡献的 PR #822 (https://github.com/xenodium/agent-shell/pull/822)。
## 会话处理
- 会话列表现在在底层进行分页,会请求可用会话直到代理用尽(PR #809 (https://github.com/xenodium/agent-shell/pull/809),由 @KarimAziev (https://github.com/KarimAziev) 贡献)。如果您希望限制会话列表数量,`agent-shell-session-list-page-limit` 接受一个正整数。
- 重启 shell 现在会保留窗口布局。
## 公共函数
### `agent-shell-session-id`
`agent-shell-session-id` 返回当前 ACP 会话 ID。说到这里,还有 `M-x agent-shell-copy-session-id` 用于当您只想将其放入 kill-ring 时使用。
### OpenCode 配置选项
`agent-shell-opencode-default-model-variant` 有点局限,因此已被 `agent-shell-opencode-default-config-options` 替换,这是一个关联列表,包含 OpenCode 在启动新 shell 时在“可用配置选项”下提供的所有选项:
```
(setopt agent-shell-opencode-default-config-options
'(("model" . "anthropic/claude-opus-4-5")
("effort" . "high")
("mode" . "plan")))
```
选项按列出的顺序应用,顺序很重要。感谢 @nhojb (https://github.com/nhojb) 贡献的 PR #739 (https://github.com/xenodium/agent-shell/pull/739)。
## 新的第三方包
又有四个包加入:
- agent-shell-org-config (https://github.com/lllShamanlll/agent-shell-org-config):在 org-roam 中保存 `agent-shell` 代理、项目和技能定义。
- agent-shell-permission-transient (https://github.com/Jamie-Cui/agent-shell-permission-transient):一个紧凑的 Transient 界面,用于响应排队的权限请求。
- agent-shell-queue (https://github.com/tychoish/agent-shell-queue):用于 `agent-shell` 会话的灵活提示/shell 队列。
- agent-shell-queue-transient (https://github.com/mrcnski/agent-shell-queue-transient):用于 `agent-shell` 中提示队列的 Transient 界面。
## Markdown 覆盖渲染器现已退役
随着新的渲染器已经提供更丰富的 Markdown 体验一段时间,已弃用的 `markdown-overlays` 渲染器已移除。
## 内务管理
如果您查看了该期间的提交日志 (https://github.com/xenodium/agent-shell/compare/v0.73.2...v0.78.2),您会看到这又是忙碌的一个月。自上次发布以来,发布了 153 次提交,关闭了 32 个问题,合并了 25 个拉取请求。截至撰写本文时,积压工作为 16 个开放问题和 6 个开放 PR(上次分别为 11 个和 5 个)。
稍微缩小视野,以下是自三月以来积压工作的变化情况:
旁注:此图表是使用我的 emacs-skills (https://github.com/xenodium/emacs-skills) 仓库中共享的 `/github-activity` 技能生成的。
从图中可以明显看出我成为父亲 (https://xenodium.com/and-then-there-were-three) 的时间,但您也可以看到我设法将情况降了下来,此后一直保持在一个相当稳定的水平。
所有这一切都需要每天关注 👉暗示暗示 (https://github.com/sponsors/xenodium) 👈
## agent-shell 需要您的支持
如今(尤其是在工作场所),供应商中立的工具比以往任何时候都更重要,有几种方法可以帮助维持 `agent-shell` 的发展。有些需要花钱,有些只需点击一下。我们都表示感谢;)
`agent-shell` 由我(一名独立开发者)构建和维护,而它经常在工作场所与之竞争的工具则拥有资金充裕的团队。花在 `agent-shell` 上的时间本可以用于其他能支付账单的工作,因此如果它对您有用,请考虑赞助该项目。如果您的雇主从您使用 `agent-shell` 中受益,请鼓励他们也参与进来,他们通常可以提供个人无法提供的规模支持。
### GitHub 星标以增加曝光度
GitHub 星标有助于增加曝光度,吸引新用户和潜在赞助者。为 agent-shell (https://github.com/xenodium/agent-shell/) 点星不花一分钱,并且可能有助于带来更多资金,因此如果您不介意点击几下,该项目真的需要再来一个 GitHub 星标 (https://github.com/xenodium/agent-shell/)。
## 拉取请求
感谢所有贡献者带来的这些改进!
- #739 (https://github.com/xenodium/agent-shell/pull/739):添加 opencode 模型变体自定义(@nhojb (https://github.com/nhojb))
- #772 (https://github.com/xenodium/agent-shell/pull/772):仅当被要求时才询问是否终止 shell(@OSadovy (https://github.com/OSadovy))
- #777 (https://github.com/xenodium/agent-shell/pull/777):将提示引导到运行中的轮次,而不是排队(@OSadovy (https://github.com/OSadovy))
- #794 (https://github.com/xenodium/agent-shell/pull/794):用 `comint-highlight-prompt` 标记恢复的提示(@OSadovy (https://github.com/OSadovy))
- #795 (https://github.com/xenodium/agent-shell/pull/795):添加 `agent-shell-antigravity`(@tychoish (https://github.com/tychoish))
- #796 (https://github.com/xenodium/agent-shell/pull/796):添加 `agent-shell-queue` 链接(@tychoish (https://github.com/tychoish))
- #801 (https://github.com/xenodium/agent-shell/pull/801):在子字符串过滤器中剥离副本,而不是通过 yank-handler(@OSadovy (https://github.com/OSadovy))
- #802 (https://github.com/xenodium/agent-shell/pull/802):修复聊天提示缩进(@nhojb (https://github.com/nhojb))
- #804 (https://github.com/xenodium/agent-shell/pull/804):停止实时提示在每次按键时闪烁(@alberti42 (https://github.com/alberti42))
- #808 (https://github.com/xenodium/agent-shell/pull/808):修复视口提示字体锁定外观优先级(@liaowang11 (https://github.com/liaowang11))
- #809 (https://github.com/xenodium/agent-shell/pull/809):处理 ACP 会话/列表分页(@KarimAziev (https://github.com/KarimAziev))
- #810 (https://github.com/xenodium/agent-shell/pull/810):提示开始时的斜杠命令补全(@izeigerman (https://github.com/izeigerman))
- #812 (https://github.com/xenodium/agent-shell/pull/812):在 agent-shell 中显示 Pi 终端输出(@timfel (https://github.com/timfel))
- #813 (https://github.com/xenodium/agent-shell/pull/813):为视口分页添加带前缀参数的页面跳转(@liaowang11 (https://github.com/liaowang11))
- #821 (https://github.com/xenodium/agent-shell/pull/821):根据 `Package-Requires` 下限检查依赖项(@alberti42 (https://github.com/alberti42))
- #822 (https://github.com/xenodium/agent-shell/pull/822):为普通表格数据行添加外观(@mrcnski (https://github.com/mrcnski))
- #824 (https://github.com/xenodium/agent-shell/pull/824):为路径包含空格的文件提及加引号(@dustinfarris (https://github.com/dustinfarris))
- #825 (https://github.com/xenodium/agent-shell/pull/825):附加拖放到 shell 或视口缓冲区的文件(@dustinfarris (https://github.com/dustinfarris))
- #827 (https://github.com/xenodium/agent-shell/pull/827):展开片段时保留 isearch 匹配数据(@Gleek (https://github.com/Gleek))
- #828 (https://github.com/xenodium/agent-shell/pull/828):在相关项目中添加 `agent-shell-org-config`(@lllShamanlll (https://github.com/lllShamanlll))
- #830 (https://github.com/xenodium/agent-shell/pull/830):通过 LobeHub CDN 修复提供商图标下载(@tjohnman (https://github.com/tjohnman))
- #831 (https://github.com/xenodium/agent-shell/pull/831):添加 Qoder CLI ACP 后端(@unship (https://github.com/unship))
- #832 (https://github.com/xenodium/agent-shell/pull/832):遵守 `search-invisible`(@mrcnski (https://github.com/mrcnski))
- #834 (https://github.com/xenodium/agent-shell/pull/834):在标题中显示会话费用(@mrcnski (https://github.com/mrcnski))
- #837 (https://github.com/xenodium/agent-shell/pull/837):在 README 中添加 `agent-shell-queue-transient` 链接(@mrcnski (https://github.com/mrcnski))
喜欢 `agent-shell`?希望看到它进
相似文章
agent-shell 0.63 更新
agent-shell 0.63 新增了对新 AI 智能体(Oh My Pi、Grok Build)的支持,并进行了多项改进,例如首选智能体配置、自定义 Markdown 渲染器以及活动分组功能,以减少输出中的冗余信息。
agent-shell 0.55 更新
agent-shell 0.55 新增对 CodeBuddy、Hermes 和 Kimi Code 等新 AI 代理的支持,强调供应商中立的 ACP。该更新还讨论了生态系统变化,并呼吁社区支持。
agents-cli
Agents-cli 是一个命令行界面工具,可使编码代理部署 AI 代理。
我在我的 shell 中嵌入了一个 AI 代理。现在它可以运行交互式程序。
作者介绍了 'agent-sh',这是一个开源项目,将 AI 代理直接嵌入到 shell 中,以管理交互式程序和终端命令,无需手动复制粘贴。
Deep Agents v0.7(6分钟阅读)
LangChain发布了Deep Agents v0.7,这是一个更精简的智能体框架,通过移除默认系统提示、精简工具描述以及将TodoListMiddleware设为可选,将基础输入令牌减少了65%,并在多个模型上验证了性能相当。