Skip to content

fix(cli): 修复 bots list 的 isSelf 判定 - #17

Merged
deepcoldy merged 2 commits into
masterfrom
fix/bots-list-is-self
May 19, 2026
Merged

deepcoldy merged 2 commits into
masterfrom
fix/bots-list-is-self

Conversation

@DeepColds

Copy link
Copy Markdown
Collaborator

摘要

  • listChatBotMembers() 返回群内每个 bot 对应的 larkAppId
  • botmux bots list 用 larkAppId === 当前 session.larkAppId 判定 isSelf
  • 增加重复 cliId 场景的回归测试,避免多个 Codex/同 CLI bot 时 self 判定全为 false

验证

  • pnpm exec tsc --noEmit
  • pnpm vitest run test/list-chat-bot-members.test.ts test/prompt-builder.test.ts
  • pnpm run build

deepcoldy added 2 commits May 19, 2026 11:16
- listChatBotMembers 的返回类型从内联重复 3 次的对象字面量提取为 ChatBotMember 类型别名
- 删除测试中未被 listChatBotMembers 调用的 getAllBots / getBot / getBotClient mock
- 测试新增 afterEach 清理 mkdtempSync 创建的 tmpdir
@deepcoldy
deepcoldy merged commit 9487e2e into master May 19, 2026
@deepcoldy
deepcoldy deleted the fix/bots-list-is-self branch May 19, 2026 04:04
sensuossss added a commit that referenced this pull request Jun 24, 2026
按多 agent review 逐条修(合入 master 前):

High
- #1 runtime: revisit 后 D#001/D#002 同 node.id 并发,inFlight/nodeControllers/
  nodeAbortCleanups 改按 dispatchKey(instance) 存取 + 守卫删除;cancel 按 instance
  abort。原先无守卫 inFlight.delete(node.id) 会删掉活着的新实例 → 整 run 误崩。
- #2 host: architect 手搓 BotSnapshot 漏 disableCliBypass → 受限 bot 在 architect
  步骤悄悄提权。改用权威 botToSnapshot()。
- #3 architect: 复用 attempts/001 不清旧 manifest,watcher 见旧 manifest 直接
  finish('ok') → revise-dag 后修订不生效。dispatch 前 rmSync(attemptDir)。
- #4 test: 加 runWorkflow 集成测试,断言 restricted override 真的写进 worker 的
  req.botSnapshot.disableCliBypass(降权红线看门)。

Medium
- #5/#12 daemon-run: driveV3Run 顶部记 wasAlreadyTerminal,已终态短路,避免
  coalesce 重驱 / "/start" 重试重发 gate 卡与 done/failed 消息。
- #6 security: gate handler 的 waitId 未校验就 path-join → 加 isValidWaitId
  (含 # 给 A#001-gate 形态) 拦 ../ 逃逸。
- #7 dashboard: catalog 前缀路由用 startsWith 误吞 runId 以 catalog 开头的 v3 run
  详情页 → 改带边界正则。(本就是合并时我引入的)
- #8 daemon: 线程内 "/workflow new" grill fall-through 时 cmdContent 仍是字面量,
  被待回答 ask 拦截器当答案吞掉 → ask 拦截加 !threadGrill。
- #9 test: 补 manifest 软链逃逸(symlink→外部)的拒绝用例,防 realpath 被简化成 resolve。

Nit
- #16 v3-blocked handler: String(formValue) 把 object/array 强转成非空垃圾过校验
  → 改 typeof==='string'。
- #17 v3.ts: 抽 isTerminalRunStatus(),统一 poll/loop 的终态停轮判定(消死代码)。

校验:pnpm build 通过;v3/daemon/dashboard 相关单测全绿(含新增 2 条)。
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