Skip to content

feat: 让 cindy_helper 可查看会话排队消息 - #2804

Merged
MagicLizi merged 32 commits into
makecindy:mainfrom
zqchris:cindy/earnest-hawking
Aug 18, 2026
Merged

feat: 让 cindy_helper 可查看会话排队消息#2804
MagicLizi merged 32 commits into
makecindy:mainfrom
zqchris:cindy/earnest-hawking

Conversation

@zqchris

@zqchris zqchris commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

cindy_helper 从只能投递消息扩展为本机任意 session 的完整「会话控制面」:调用方可以查看目标 session 的待处理输入和统一运行状态,修正或撤回自己尚未被消费的消息,在活动 turn 内高优先级插话,并请求 turn 在工具安全边界优雅停止。

这五项共同解决“跨 session 发出控制意图后无法确认、修正或安全干预”的同一个用户结果;任一项缺失都会留下不可观察或不可恢复的控制盲区,因此作为一个完整能力交付。

变更类型

  • feat 新功能
  • fix 缺陷修复
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护
  • 其他:

范围

  • 关联 Issue / 需求:本机会话控制面
  • 本 PR 包含:
    • 排队消息可见:list_session_queue(session_id) 返回来源、入队时间、正文摘要和 consuming 状态;list_sessions 返回轻量 queuedCount
    • 本人排队消息控制:update_session_queued_message / cancel_session_queued_message 只允许操作当前 session 经 send_to_session 投递、且尚未进入 consuming 的消息
    • 高优先级插话:steer_session 严格走 provider 原生 same-turn steer;没有活动 turn、能力不支持或输入边界拒绝时明确失败,不降级为下一 turn
    • 请求式优雅停止:stop_session_turn 等当前并行工具结果全部回到安全边界后发送 provider 软中断;超时或失败返回 unconfirmed,不关闭 transport、不重建 session、不硬杀进程
    • 统一运行状态与探针:把既有 Agent Island、turn 生命周期、错误尾态、持久 session 记录状态和标题工作流语义归并成同一规范投影;侧栏点位与 get_session_runtime 共用,状态变迁暴露订阅钩子
  • 明确不包含:新增 UI;任意来源消息的越权修改、撤回或重排;其它设备上的远程 session 控制;进程硬杀;无关的 Orca team 生命周期重构
  • 用户可见变化:cindy_helper 新增上述只读/控制工具;所有失败均返回结构化错误,不伪造受理,也不把插话静默降级成普通排队消息
  • 是否存在 breaking change:无;新增工具、可选字段和既有 Agent Island session activity payload 的规范状态字段均为向后兼容扩展

架构与 turn 热路径侵入点

  1. Desktop main 已有的 Agent Island 状态机是会话活动的权威主线:它从 maker 事件、interaction 生命周期和 attention 收口出 idle / running / needs-interaction / completed / error,并维护 turn 开始时间、最后活动时间与无正文动作摘要。本 PR 不让 maker-core 平行维护同一组状态字段。
  2. 在零 Electron/React 依赖的 shared 层定义开放式会话状态模型,分离记录生命周期、执行活动和标题工作流语义。未知工作流状态保留开放式 title:* key,新增状态不要求各消费方复制枚举分支。
  3. live projection 直接由 Agent Island 状态机产生;冷 session 用 sessions.status、turn 时间边界、clear boundary 和安全的 error 尾标构造同一模型。冷读只取元数据与尾态,不物化正文。
  4. get_session_runtime 读取 Desktop main 的统一投影;maker-core 仅追加当前 turn generation 与 graceful-stop 状态这类控制 facet。优雅停止的 active tool / interaction 计数继续作为控制状态机内部事实,不再对外充当另一套 session status。
  5. 侧栏左侧呼吸与右侧红/蓝/绿点改为消费统一 projection 的 phase/attention;本地取 Agent Island snapshot,device-link 继续把同一 phase 形状作为远端镜像。视觉 token、优先级和动效不变,不新增 UI。
  6. 状态变迁复用 Agent Island 的单一 publish 出口,并在 service 暴露只读 subscribe/snapshot 接口;未来 Bots 只在上层订阅,不让 shared 或 maker-core 反向依赖 Bot、Renderer 或 Desktop main。
  7. 队列查看/本人编辑撤回共用 sessionQueueControl;steer 与 graceful-stop 只在既有 turn 热路径增加 generation、安全点和 provider 软中断守卫,不改变消息消费语义。
  8. 冷 session 的 queuedCount 在 SQLite 内完成合法形状、scheduler、clear boundary 和已落库 clientId 过滤,不把正文物化或长期保留到内存;恢复入口使用相同判据并 fail-closed。

UI 变化

为何必须触碰 UI 文件

状态探针不能另造一套运行状态,必须与用户已经在侧栏看到的运行中、正常结束、错误结束和等待决策状态共用同一事实源。侧栏状态链路涉及的七个 renderer 文件正是原有散装状态推导、消费和回归所在:AutomationSessionGroupItem.tsxSessionCard.tsxSessionItem.tsxsidebarRightStatus.tsagentIslandActivity.ts,以及对应的 sidebarAttentionBadge.test.tssessionCardReviewRegressions.test.ts。因此,本 PR 必须把这些消费点的数据源统一切换到 projectSidebarSessionActivity 投影;否则状态探针与侧栏仍可能对同一 session 给出两套结论。

这不是新增或重做 UI,而是观感零变化的数据源重构:颜色、图标、布局、状态优先级、呼吸动效和用户可见文案均保持不变。行为一致性回归覆盖本地与 device-linked 远程会话、运行态与错误尾态并存、urgency-only、重启或通知清零等组合;其中 sidebarAttentionBadge.test.ts 验证远程活动镜像与错误/运行 facet 的组合,sessionCardReviewRegressions.test.ts 验证本地和远程列表项都消费同一投影。

  • 引用的设计规范:沿用 docs/design-rules/DESIGN.md 的既有语义 token 与运行态动效,不新增视觉规则

怎么验证的

自动验证

当前状态投影回归:

VITE_CINDY_AUTH_REGION=global pnpm --filter desktop exec vitest run   src/renderer/__tests__/sidebarAttentionBadge.test.ts   src/renderer/features/cc-agent/sidebar/__tests__/sessionCardReviewRegressions.test.ts   src/main/agent-island/__tests__/service.test.ts
结果:PASS,3 个文件、150 tests

pnpm --filter @cindy/maker-shared exec vitest run src/__tests__/sessionActivity.test.ts
结果:PASS,3 tests

pnpm --filter desktop run --if-present typecheck
pnpm --filter @cindy/maker-shared run --if-present typecheck
pnpm --filter @cindy/mcps run --if-present typecheck
结果:全部 PASS

最新 review 修复验证:

VITE_CINDY_AUTH_REGION=global pnpm --filter desktop exec vitest run   src/renderer/__tests__/sidebarAttentionBadge.test.ts   src/renderer/features/cc-agent/sidebar/__tests__/sessionCardReviewRegressions.test.ts
结果:PASS,2 个文件、37 tests

pnpm --filter @cindy/maker-core exec vitest run   src/agents/pi/__tests__/pi-startsession-cleanup.test.ts
结果:PASS,1 个文件、19 tests

pnpm --filter desktop run --if-present typecheck
pnpm --filter @cindy/maker-core run --if-present typecheck
结果:全部 PASS
pnpm --filter @cindy/maker-core exec vitest run <4 个会话控制相关测试文件>
结果:PASS,4 个文件、580 tests

pnpm --filter @cindy/maker-core exec vitest run src/session-control.test.ts src/agents/codex/index.test.ts
结果:PASS,2 个文件、494 tests

pnpm --filter desktop exec vitest run <6 个统一状态相关测试文件>
结果:PASS,6 个文件、172 tests

pnpm --filter @cindy/maker-shared exec vitest run src/__tests__/sessionActivity.test.ts
结果:PASS,3 tests

pnpm --filter @cindy/mcps exec vitest run src/__tests__/sessionControlTools.test.ts src/__tests__/lizi_xdtHelperMcpServer.test.ts
结果:PASS,2 个文件、7 tests

pnpm --filter desktop exec vitest run <6 个队列/控制面相关测试文件>
结果:PASS,6 个文件、368 tests

pnpm --filter @cindy/mcps exec vitest run <5 个 cindy_helper 相关测试文件>
结果:PASS,5 个文件、32 tests

pnpm --filter desktop exec vitest run src/main/maker-ipc/__tests__/codexLocalSessions.test.ts
结果:PASS,118 tests

pnpm --filter desktop run --if-present typecheck
pnpm --filter @cindy/mcps run --if-present typecheck
pnpm --filter @cindy/maker-core run --if-present typecheck
结果:全部 PASS

pnpm check:dco
结果:PASS,12 个普通 commit 均有 Signed-off-by;3 个 merge commit 按规则豁免

git diff --check upstream/main
敏感字符串、敏感文件与新增超大文件扫描
结果:PASS

覆盖的关键边界包括:普通排队、direct steer、active turn consuming 投影;只允许修改/撤回本人消息;消息已消费与竞态丢失;无活动 turn、能力不支持、策略阻断和迟到 generation;并行工具、权限/Ask/计划确认安全点;软停止幂等、失败与超时;terminal/close 状态清理;MCP/dynamic interaction 与真实 active item 关联、歧义 fail-closed、completed/迟到 updated 不复活;冷快照清空边界、scheduler、已落库消息去重和损坏快照 fail-closed;统一状态的 live/cold 投影、turn 重新开始计时、无正文摘要与 transition 订阅取消。

VITE_CINDY_AUTH_REGION=global pnpm test:unit:related:脚本因 packages/maker-shared/package.json 变更回退全量。runner 406 passed / 1 skipped;Desktop 25827 passed / 5 skipped,仅 ghostInstallReceipt.test.ts 2 条 macOS 主干基线失败;其余 workspace(含 maker-core 与 Pi RPC resource discovery)全部通过。两条失败来自 readBoundedFileNoFollowSync 用未 realpath 的 /var/... containWithin 根比对 /private/var/... 文件而 fail-closed;相关实现和测试与 upstream/main 完全一致,不属于本 PR 的会话控制面改动。另,本机 apps/desktop/.env 为 CN 区域;Global orphan-reaper 用例在显式 VITE_CINDY_AUTH_REGION=global 下 13/13 通过。

maker-core 核心指标实测(§3.4)

  • 缓存率
    • 影响:无预期影响;本 PR 未改变 system/developer prompt 拼接、tool/MCP 注册、模型输入前缀或 UsageTracker 的 cache 记账。
    • 方法:逐项核对 maker-core diff,并运行 usage-tracker.test.ts 10 tests。
    • 结论:稳定请求前缀、工具面和 cache 记账路径不变。
  • 性能 / 返回速度
    • 影响:observeTurnControl 位于前台事件出口,可能增加每事件开销;provider queue 到 listener 的状态变迁也位于热路径。
    • 方法:临时基准执行 200,000 次观察器调用,并采集 2,000 次 provider queue→listener fan-out;基准文件未提交。
    • 结论:扣除空循环后约 7.5ns/事件;fan-out p50 0.0006ms、p95 0.0013ms、max 0.3074ms。路径内无同步 I/O、网络、await 或正文深拷贝。
  • 返回内容准确性
    • 影响:Codex plan snapshot 增加 runtimeActivity: "snapshot",必须保留原事件内容,同时只排除其 active-tool 生命周期。
    • 方法:运行 translator 79 tests 与 session-control 9 tests,覆盖 native/rollout plan 仍投影为 tool_use、真实 update_plan 仍有对应 tool_result、snapshot 不占用 graceful-stop safe point。
    • 结论:事件类型、顺序、正文和 tool-result 映射不变;只新增 Host 控制元数据。
  • 模型行为 / 工具面
    • 影响:若改变 prompt、thread start/resume 参数或 MCP/dynamic tool 定义,会改变模型行为与可用工具。
    • 方法:核对 thread/startthread/resume、system/developer instructions、MCP/dynamic tool definitions diff,并运行 Codex index 485 tests。
    • 结论:模型输入、模型路由、工具/MCP 可用性与权限分支不变;新增能力位于 Host 会话控制接口和 provider 既有控制通道。

手工验证

未启动 Desktop dev 实例;控制路径通过 MCP tool registration / handler → Desktop control service → maker-core adapter 的集成测试覆盖。侧栏无视觉变化,仅替换状态数据来源。

未执行的验证

  • 未在本机 Windows 环境执行;由 GitHub Windows CI 覆盖。
  • 未启动真实 Desktop dev 做跨进程人工 E2E:dev 鉴权会与正式版互踢,本次没有单独启动授权。

风险

风险分类

  • 无已知风险
  • SQLite / migration
  • system prompt
  • 协议兼容
  • 权限 / 安全 / 用户数据
  • 存量插件兼容(批准状态 / 指纹 / manifest 校验 / 安装布局 / 包格式)
  • 原生层 / fingerprint / OTA
  • 跨平台差异
  • 其他:Agent turn 生命周期与并发控制

影响与回滚

  • 影响范围:本机 cindy_helper、Desktop main 会话输入协调、Agent Island/侧栏状态投影、maker-core turn 生命周期及 Claude Code / Codex / Pi adapter 的软停止能力。
  • SQLite:只读取既有 sessionsmessages 与 queue snapshot 数据;无 schema 或 migration 变更。冷计数按批次在 SQLite 内聚合,损坏快照拒绝计数。
  • 协议兼容:新增 MCP 工具和可选字段;既有 Agent Island session activity payload 向后兼容增加规范状态字段;无新 IPC channel、无 cindy-protocol 或 device-link wire breaking change。
  • 权限与数据:队列正文只按既有 session 数据面返回;修改/撤回必须匹配当前调用 session 的 senderSessionId;规范状态、transition 与探针不含 prompt 正文、工具参数或凭证。
  • 回滚 / 降级方式:回退本 PR 即恢复原有消息发送、Orca 队列控制与用户立即 Stop 行为。adapter 不支持新能力时明确返回 unsupported / unconfirmed,不改变既有 abort 路径。
  • 跨平台:不依赖 POSIX signal 或路径;本地定向测试与 GitHub Windows CI 共同覆盖。
  • 规模说明:该能力横跨 MCP、Desktop main、Agent Island/侧栏和三个 provider adapter,非测试约 2066 行 / 24 文件、测试约 2468 行 / 18 文件;每一块都服务同一个可验收的本机会话控制结果,没有夹带 UI、依赖升级或无关生命周期重构。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名(git commit -s,见 DCO
  • UI 改动已在「UI 变化」注明引用的设计规范章节(无视觉变化)
  • 未提交凭证、令牌或授权文件
  • 已补充必要文档(架构与热路径设计记录在本描述;无额外用户文档入口)
  • 已确认测试结果或说明未执行原因

Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@zqchris
zqchris requested a review from a team as a code owner August 16, 2026 06:48
@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 为 cindy_helper 增加本机会话队列查看、消息控制、same-turn steer、优雅停止和统一运行状态投影。

  • Desktop main 新增权威队列检查、修改/撤回和控制服务,并接入持久化快照及冷会话计数。
  • maker-core 为 Claude Code、Codex 和 Pi 增加 turn generation、安全停止及 provider 控制能力。
  • Agent Island、侧栏与 MCP 工具改为消费统一的会话活动投影。

Confidence Score: 4/5

此 PR 暂不适合合并,因为 Claude Code 自动 continuation 仍可能接收属于上一轮的迟到插话。

Claude 的 task_notification continuation 绕过 Session.send,因此不会推进控制面校验所依赖的 turnGeneration;异步转换中的旧 steer 会在 continuation 将 turnInFlight 恢复为 true 后通过检查并写入共享 inputQueue。

Files Needing Attention: packages/maker-core/src/agents/claude-code/index.ts, packages/maker-core/src/session.ts

Important Files Changed

Filename Overview
apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts 新增队列检查投影及 steer generation、request token、lineage 和 session identity 守卫;先前报告的迟到清理与幽灵消息路径已被覆盖。
apps/desktop/src/main/maker-ipc/sessionQueueInspection.ts 将 pending、可逆 active turn 和 direct steer 合并为稳定去重的队列检查结果,并正确标记 consuming。
packages/maker-core/src/agents/claude-code/index.ts Claude steer 增加转换后的活动检查,但自动 continuation 不推进 Session generation,旧 steer 仍可跨入 continuation。
packages/maker-core/src/session.ts Session 为 send/steer 引入 turn generation 校验,但 generation 仅由显式 send 推进,无法区分 Claude SDK 自动 continuation。
apps/desktop/src/main/maker-ipc/sessionControlService.ts 控制服务在异步消息构造前后绑定 Session identity 与 generation,但其有效性依赖 provider 的每轮 generation 推进。
apps/desktop/src/main/agent-island/service.ts 暴露统一活动快照和 transition 订阅,并继续使用 Agent Island 状态机作为 live 状态源。

Sequence Diagram

sequenceDiagram
  participant Helper as cindy_helper
  participant Control as Desktop控制服务
  participant Session as maker-core Session
  participant Claude as Claude adapter
  participant Queue as Claude inputQueue
  Helper->>Control: steer_session
  Control->>Session: 捕获Session与turnGeneration
  Session->>Claude: steer
  Claude->>Claude: await toClaudeSdkContent
  Note over Claude: 原turn结束
  Claude->>Claude: task_notification触发beginNewTurn
  Note over Session: Session.turnGeneration未推进
  Claude->>Queue: 旧steer写入continuation
Loading

Comments Outside Diff (1)

  1. packages/maker-core/src/agents/claude-code/index.ts, line 5445-5457 (link)

    P1 自动续跑仍接收旧插话

    当 turn A 的 steer 等待 toClaudeSdkContent 转换期间结束、随后 task_notification 启动自动 continuation 时,continuation 不经过 Session.send,因此不会推进控制面校验使用的 turnGeneration;这里看到 turnInFlight 已恢复为 true 后仍将旧插话写入共享 inputQueue,导致 continuation 消费属于 turn A 的消息。

    Context Used: 使用和PR描述相同的语言进行评论 (source)

    Knowledge Base Used: maker-core Agent Abstraction and Codex Implementation

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/maker-core/src/agents/claude-code/index.ts
    Line: 5445-5457
    
    Comment:
    **自动续跑仍接收旧插话**
    
    当 turn A 的 `steer` 等待 `toClaudeSdkContent` 转换期间结束、随后 `task_notification` 启动自动 continuation 时,continuation 不经过 `Session.send`,因此不会推进控制面校验使用的 `turnGeneration`;这里看到 `turnInFlight` 已恢复为 `true` 后仍将旧插话写入共享 `inputQueue`,导致 continuation 消费属于 turn A 的消息。
    
    **Context Used:** 使用和PR描述相同的语言进行评论 ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
    
    **Knowledge Base Used:** [maker-core Agent Abstraction and Codex Implementation](https://app.greptile.com/xindong/-/custom-context/knowledge-base/makecindy/cindy/-/docs/maker-core-agents.md)
    
    ---
    
    For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Prompt To Fix All With AI
### Issue 1
packages/maker-core/src/agents/claude-code/index.ts:5445-5457
**自动续跑仍接收旧插话**

当 turn A 的 `steer` 等待 `toClaudeSdkContent` 转换期间结束、随后 `task_notification` 启动自动 continuation 时,continuation 不经过 `Session.send`,因此不会推进控制面校验使用的 `turnGeneration`;这里看到 `turnInFlight` 已恢复为 `true` 后仍将旧插话写入共享 `inputQueue`,导致 continuation 消费属于 turn A 的消息。

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (27): Last reviewed commit: "fix(desktop): persist steers accepted af..." | Re-trigger Greptile

Comment thread apps/desktop/src/main/maker-ipc/sessionQueueInspection.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c81bd0c3d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts Outdated
Comment thread apps/desktop/src/main/maker-ipc/register.ts Outdated
@MagicLizi MagicLizi added status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) labels Aug 16, 2026
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7352fffdb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/localDb/agentInputQueueSnapshots.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@zqchris 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/localDb/agentInputQueueSnapshots.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4042b7ec5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/maker-ipc/register.ts
Comment thread apps/desktop/src/main/localDb/agentInputQueueSnapshots.ts Outdated
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@zqchris
zqchris marked this pull request as draft August 16, 2026 12:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1027aa6fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/localDb/agentInputQueueSnapshots.ts
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@zqchris
zqchris marked this pull request as ready for review August 16, 2026 15:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48a9d7dbeb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/session.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts
Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81e1801633

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/claude-code/index.ts
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Comment thread apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 503b9145e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/session.ts Outdated
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21bb09b6c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/session.ts Outdated
@zqchris
zqchris marked this pull request as draft August 16, 2026 17:09
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c88efd90cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/maker-ipc/sessionControlService.ts
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20f514f0ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查结果:P1 × 1

P1: list_sessions 批量查询排队数时单条会话异常会打断整批响应

位置: apps/desktop/src/main/maker-ipc/sessionQueueInspection.ts (resolveSessionQueueCounts → listSessionQueuedCounts → list_sessions)

问题: list_sessions 现在对返回页中每个 session 都调用 listSessionQueuedCounts。如果某个 session 的 coordinator 处于 live-but-not-yet-queue-restored 状态(AgentInputCoordinator.getQueueInspectionIfRestored 会抛),或 SQLite 里 queue-snapshot 行损坏(loadAgentInputQueueSnapshotCounts 会抛),整个 list_sessions 调用会硬失败(返回 INTERNAL 错误),而不是仅对该条 session 降级为 0 或省略排队数。

建议: 在 resolveSessionQueueCounts(或其调用处)对单条 session 的 queue-count 查询做 try-catch,失败时降级为 null/0,而不是让一条有问题的 session 拖垮整页查询。


其他方面(read path 权限模型、update/cancel/steer 的 callerSessionId 绑定、跨 session 信息隔离)审查通过,无新增安全问题。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79014749df

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts Outdated
Comment thread packages/maker-core/src/agents/codex/index.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@zqchris 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts / packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 18, 2026
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@MagicLizi MagicLizi removed the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 18, 2026

@MagicLizi MagicLizi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查通过 — 0 P0,1 P1(已确认为设计意图)。

P1 注意事项(不阻断):steerSession/stopSessionTurn/getSessionRuntime 无调用方归属检查(任意本地会话可通过 cindy_helper 控制兄弟会话)。经核实 capabilities.ts 明确记载此为本地信任域设计,与已有 list_session_queue 无归属门控一致。建议在 PR 上补一条产品/安全确认评论。

其余实现精心覆盖了 turn-generation/session-identity 竞态、graceful-stop safe-point 逻辑、队列检查的数据最小化投影。测试充分。

Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@MagicLizi MagicLizi added the status:ci-failed CI 失败(review-pr 自动维护,仅展示) label Aug 18, 2026
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 517150755e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@zqchris 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/maker-ipc/agent-input-coordinator.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi MagicLizi added status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Aug 18, 2026
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@MagicLizi MagicLizi removed the status:threads-open 还有未 resolve 的评审讨论(review-pr 自动维护,仅展示) label Aug 18, 2026
@MagicLizi
MagicLizi merged commit c7e8744 into makecindy:main Aug 18, 2026
11 checks passed
@MagicLizi

Copy link
Copy Markdown
Contributor

会话排队消息观测终于闭环了——从队列快照到实时 steer、分代防赛,整套控制面做得干净利落。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants