Repository navigation
飞书:Agent 工作台(默认关)——每个 Agent 一个话题,话题里转发、作答和 /ls /tail /stop - #62
Merged
Merged
Conversation
…ls from the topic, /ls /tail /stop
All behind new extension settings, off by default (workbench, workbench_chat, workbench_asks,
workbench_commands); while off nothing is read or sent and /agent, 自动代答, the inbox, Persona's
channel and thread follow-ups behave as before.
- workbench.py: the hub's Agent list (agents.read) as one topic per Agent in the user's own group,
the first message the status edited in place; the user's lines in a topic go to that Agent
(agents.control, one client_msg_id each) and its answer comes back split by characters and UTF-8
bytes with code fences closed and reopened, formatted or plain when the format is refused.
- workbench_asks: waiting questions put in their topic; a number answers through
POST /api/v1/interactions/{id}/choose (rev as Persona's askRev), y/n through …/resolve; answered
elsewhere is taken back with the channel's own logic (channel.ended_for_good / take_back, moved
out of ChannelBridge unchanged).
- workbench_commands: /ls, /tail (GET …/screen, agents.read), /stop (…/interrupt), /help answered
by the extension, no model.
- No new hub or Feishu permission.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Nothing is asked of the hub (an answer, a line, /stop) nor reacted for a line of the account signed in before another one did (checked right before each call). - A topic whose opening send has an unknown outcome is never sent again under another key: its echo is looked for among the group's last messages and adopted as the topic's root. - The send journal's keys are each account's own. - An answer that did not all go out (or a restart cut off) is posted again the next rounds, at most 3 times; each piece still goes once. - A question answered elsewhere: the history read again each round, a failed take-back tried again (5 rounds), one cut off by a restart looked at again. - A reply that quotes one of several waiting questions answers that one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt right before a take-back Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 飞书:新设置「Agent 工作台」「工作台话题群」「工作台:话题里作答」「工作台:指令不过模型」,全部默认关。 打开后每个 Agent 在你指定的群里有一个话题,首楼原地显示状态;话题里的话转给这个 Agent,回复分片回到话题; 可选在话题里回答 Agent 的问题和批准(编号、y/n),以及 /ls、/tail、/stop 不经过模型。 - 核心:渠道的「问题是否结束」「撤回」抽成共用函数,行为不变;不新增 hub 或飞书权限。 - 微信:只因核心改动升版本,行为不变。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
把同事「飞书打通 Claude」方案(lark-cli 长连接 + Claude Code Hook + tmux)里好用的部分吸收进飞书扩展,做成 Agent 工作台。实现上只用 Persona hub 已有接口和扩展已声明的权限,不依赖 tmux,不装 Claude Code Hook,不改任何电脑上的
~/.claude或~/.codex。所有新功能都是扩展设置开关,默认关闭;关着时什么都不读、不发,/agent、自动代答、收件箱、Persona 渠道、话题追问转发都和原来一样。新设置(只在飞书扩展里):
workbench「Agent 工作台」workbench_chat「工作台话题群」workbench_asks「工作台:话题里作答」workbench_commands「工作台:指令不过模型」core/openmate_core/workbench.py):每 15 秒用agents.read读一次 hub 的 Agent 列表(和「Agent 进度」页同一个接口,不限 Claude Code,含 Codex、各台电脑)。正在执行、等你确认的 Agent,以及打开工作台之后有过动静的 Agent,各开一个话题(每轮最多新开 5 个,打开时不会刷屏)。首楼是状态消息,原地编辑:🟡 执行中 / 🟠 等你确认 / 🟢 待命 / ⚫ 已结束,加项目、分支、Agent 和模型、电脑、最近指令、更新时间。状态一变就改,同一状态最多 5 分钟改一次。你在话题里发的话用agents.control发给这个 Agent:每条消息带一个client_msg_id,重试不会发重复;接单时贴 🤔,回复后换成 ✅。这一轮的回复带 AI 标记回到话题。不在 Agent 话题里的消息照旧交给/agent。GET /api/v1/interactions,把 Agent 等你回答或批准的问题和选项发到它的话题。在话题里回复编号,走POST …/choose(带rev,算法移植自 Persona 的askRev,已和 Goencoding/json的结果逐位核对)。回复 y/n 批准或拒绝,n 后面可以写原因,走POST …/resolve的allow或approve。直接写文字就作为回答。作答后问题消息改成「✅ 已作答:…」。在别处答了的问题,用和 Persona 渠道同一套逻辑撤回:channel.py里的_ended和_take_back抽成了模块函数ended_for_good和take_back,行为不变,渠道测试全过。只有你能决定的卡片,hub 不让扩展批准(agents.control只允许拒绝),话题里会提示去 App 处理。/tail:hub 有读终端的接口GET /api/v1/sessions/{mid}/{sid}/screen,属agents.read,见 Persona 的server/internal/extwire/scopes.go。读不到画面时(比如 Codex app-server 会话没有终端),改给它最近几条记录。/ls(列 Agent 状态)、/tail [行数](默认 40,最多 120)、/stop(…/interrupt)、/help,都由扩展直接回答,不调用模型。/agent发送没有分片,这次只用在工作台的回复上,/agent的行为没改。按字符(6500)和 UTF-8 字节(18000)两个上限切分;切点落在代码块里时,前一片补上闭合,后一片用原来的开头行(```python)重新打开。超过 10 片时只发前 9 片,加一句「后面还有约 N 字,请在 Persona App 里看全文」。先发 Markdown 格式,飞书不收格式时改发纯文本。工作台发出的每条消息(包括状态编辑)都以你的身份发在这个群里,都记进 hub 的「以你身份发出的消息」记录(
setting: "workbench"),同一个 key 只发一次。README 写明了这是第五种不逐条确认的消息,默认关闭。权限
agents.read/agents.control里,test_feishu.ManifestTest.test_permissions固定了权限列表,没有改。newer_post。怎么验证的
bash scripts/test.sh全部通过。tests/test_workbench.py,共 28 个测试:ask_rev和 Go 算出的值一致;各类问题的回答方式。/agent照常开对话;工作台群和渠道群相同时,渠道照旧接管所有消息;其他群和工作台群主消息里的/agent照旧。ask_changed时按标签作答、y/n 和被 hub 拒绝时的提示、在别处答了自动撤回;/ls、/tail(读到画面和读不到画面两种)、/stop;指令开关关着时,这些话和普通消息一样发给 Agent。workbench模块不存在。其中「关着时行为不变」那一组测的就是行为没变,换成旧代码的等价写法也会通过。test_feishu.ManifestTest.test_configuration的设置列表加上四个新设置,并断言默认都是关。审查
本机 codex 只读审查了两轮。AGENTS.md 指定的
gpt-6.2-astra在本机中转上返回 404 Model not found,改用本机默认模型(auto_model/alwaysday1_max)。第一轮找出 7 个问题:
都在 77fccfa 修了。
第二轮确认 7 个都修好,默认关闭时现有行为没有回归,也没有重复发送或发到群外。另外提了两个低概率边界问题,在 bd79aea 里收紧:认领话题根只在发送前后 5 分钟内找最早的一条;撤回前再确认一次账号。
没改的一条:Agent 超过 200 个时只读前 200 个,和「Agent 进度」页一样。
版本
openmate-feishu 0.11.79、openmate-wechat 0.1.72。改了
core/,两个扩展都升了版本;微信扩展没有新设置,行为不变。没做的
/rename、/new、/resume、/kill:不在这次范围里;其中/new和/resume要新开会话,会改变 Agent 的生命周期。…/keys只给完整凭据,不给扩展,见scopes.go。🤖 Generated with Claude Code