Skip to content

feat(auto-review): 增加当前模型轻量审查基础设施 - #1226

Merged
MagicLizi merged 9 commits into
makecindy:mainfrom
zqchris:auto-review-native-fallback
Jul 31, 2026
Merged

feat(auto-review): 增加当前模型轻量审查基础设施#1226
MagicLizi merged 9 commits into
makecindy:mainfrom
zqchris:auto-review-native-fallback

Conversation

@zqchris

@zqchris zqchris commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

增加 Auto-review 的轻量审查基础设施:统一 allow / block / ask 决策协议,并提供可复用的“当前会话模型单次审查”委托器。输入仅包含当前意图、待执行动作与有限工作区信息,输出、耗时和上下文均有硬上限。

本 PR 是两片改造中的第一片,只增加能力,不接入 Claude Code 或 Codex 的现有审批路径,因此单独合入不会改变用户行为。第二片负责原生优先、当前模型兜底和最少打扰策略,并在本 PR 合入前保持依赖分支 / draft,避免乱序合入。

变更类型

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

范围

UI 变化

不涉及。

  • 引用的设计规范:不涉及。

怎么验证的

自动验证

pnpm --filter @cindy/maker-core exec vitest run src/agents/shared/auto-review-decision.test.ts src/agents/shared/auto-review.test.ts --maxWorkers=1 --minWorkers=1
结果:135 tests passed(重放至最新 main 并完成 review 加固后)

pnpm --filter desktop exec vitest run src/main/maker-host/__tests__/autoPermissionReviewer.test.ts src/main/utility-model/__tests__/oneShotCandidates.test.ts --maxWorkers=1 --minWorkers=1
结果:47 tests passed

pnpm --filter desktop run typecheck
结果:通过

pnpm check:dco
结果:通过

手工验证

使用两种当前会话模型做了最小上下文实机探针:普通 typecheck 动作为 allow,清理构建产物在意图对齐时为 allow,向主分支强推为 ask。同时验证了 OpenAI ChatGPT Codex 路由不发送其不支持的 max_output_tokens 参数,生产形状请求返回有效紧凑 JSON。

未执行的验证

未在本机运行无界全仓 pnpm test:unit:该机器曾被全仓高并发测试卡死,本地按定向单 worker 验证,完整门禁交由 CI。

风险

风险分类

  • 无已知风险
  • SQLite / migration
  • system prompt
  • 协议兼容
  • 权限 / 安全 / 用户数据
  • 原生层 / fingerprint / OTA
  • 跨平台差异
  • 其他:

影响与回滚

  • 影响范围:新增的轻量 reviewer prompt、决策解析和 one-shot 参数传递;本 PR 尚无运行期调用方,不改变现有权限结果。意图与工作区信息有界,超过 4,096 字符的灰区动作会在调用模型前静默拦截;Core 与 host 的独立 8 秒超时、1024 字符输出上限和严格 schema 解析共同限制上下文与失败面。未知自定义 Codex 路由若以 400/422 拒绝可选字段,会在同一总超时内用最小 wire body 重试一次;输出大小仍由本地解析上限约束。
  • 回滚 / 降级方式:回滚本 PR commit 即可;不涉及持久化、migration、wire protocol、mobile fingerprint 或用户数据格式。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名(git commit -s,见 DCO
  • UI 改动已在「UI 变化」注明引用的设计规范章节(不涉及 UI 则跳过)
  • 未提交凭证、令牌或授权文件
  • 已补充必要文档
  • 已确认测试结果或说明未执行原因

@zqchris
zqchris requested a review from a team as a code owner July 31, 2026 13:26
Copilot AI review requested due to automatic review settings July 31, 2026 13:26
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

本 PR 增加当前会话模型的轻量 Auto-review 基础设施。

  • 新增 allowblockask 三态决策协议、本地预判、证据完整性检查及超时降级。
  • 新增有界且经过结构转义的审查提示、严格输出解析和 Maker host 委托器。
  • 为 one-shot provider 请求增加推理强度与输出上限传递,并兼容拒绝可选参数的路由。
  • 补充决策、提示边界、超时、异常输出及 provider 请求形状测试。

Confidence Score: 5/5

当前变更看起来可以安全合入。

未发现仍然存在的阻塞性故障;先前报告的审查标签闭合路径已通过统一 JSON 序列化及尖括号转义消除。

Important Files Changed

Filename Overview
packages/maker-core/src/agents/shared/auto-review-decision.ts 新增 Auto-review 请求与决策协议、本地裁决分层、输入证据检查、委托超时及保守降级。
apps/desktop/src/main/maker-host/auto-permission-reviewer.ts 新增有界提示构造、载荷结构转义、严格响应解析和 host 侧轻量审查委托器;先前标签闭合问题已修复。
apps/desktop/src/main/utility-model/oneShotCandidates.ts 为 provider one-shot 请求传递推理强度和输出上限,并为不兼容可选字段的自定义路由提供最小请求重试。
packages/maker-core/src/agents/base-agent.ts 扩展 host 与 session 接口,为后续 Auto-review fallback 路由提供委托和切换能力。
apps/desktop/src/main/maker-host/tests/autoPermissionReviewer.test.ts 覆盖提示载荷最小化、标签转义、输入上限、输出解析、超时和异常降级行为。
apps/desktop/src/main/utility-model/tests/oneShotCandidates.test.ts 覆盖各 provider 的推理参数、输出上限、能力例外和无可选字段重试请求形状。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AutoReviewRequest] --> B[本地确定性规则]
    B -->|明显安全| C[allow]
    B -->|高影响边界| D[ask]
    B -->|灰区| E{证据完整且大小合规?}
    E -->|否| F[block]
    E -->|是| G[当前会话模型轻量审查]
    G -->|有效三态 JSON| H[返回模型决策]
    G -->|超时、异常或畸形输出| F
Loading

Reviews (9): Last reviewed commit: "fix(auto-review): minimize incompatible ..." | Re-trigger Greptile

Comment thread apps/desktop/src/main/maker-host/auto-permission-reviewer.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: 46d272f50c

ℹ️ 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/shared/auto-review-decision.ts Outdated
Comment thread apps/desktop/src/main/maker-host/auto-permission-reviewer.ts Outdated
Signed-off-by: zqchris <chrisz83@gmail.com>
@zqchris
zqchris force-pushed the auto-review-native-fallback branch from 46d272f to 77ccc4e Compare July 31, 2026 13:31

Copilot AI 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.

Pull request overview

本 PR 为 Auto-review 增加“当前会话模型轻量审查”的基础设施:在 maker-core 侧统一 allow / block / ask 的决策协议与最小审查上下文,并在 Desktop host 侧提供可复用的 one-shot 审查 prompt/解析器与调用封装;同时补齐 utility one-shot 的推理强度提示与对部分 Responses 兼容端点的参数形状适配,并配套单元测试。

Changes:

  • @cindy/maker-core 新增 Auto-review 决策 schema、最小请求结构、delegate 协议与本地/委托融合裁决入口,并导出相关类型。
  • 在 Desktop main 新增轻量 auto permission reviewer(prompt 构建、输出解析、日志与失败降级),用于 vendor reviewer 不可用时的兜底路径。
  • 在 utility one-shot 请求链路中透传 reasoningEffort,并为特定 Responses 端点增加 max_output_tokens 兼容开关,补齐对应测试。

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/maker-core/src/agents/shared/auto-review-decision.ts 新增 Auto-review 决策类型、最小请求、delegate 协议与裁决入口(本地规则 + 可选委托)。
packages/maker-core/src/agents/shared/auto-review-decision.test.ts 覆盖本地 deterministic 分支不调用 delegate、灰区 delegate 结果透传、异常/非法输出 fail-closed。
packages/maker-core/src/agents/index.ts 对外导出 Auto-review 决策相关类型与 ReviewableAction 类型。
packages/maker-core/src/agents/base-agent.ts 在 AgentDeps / SessionHandle 上扩展轻量 reviewer 依赖与 fallback hook(含 deprecations)。
apps/desktop/src/main/utility-model/oneShotCandidates.ts one-shot 请求链路透传 reasoningEffort;为部分 Responses 端点禁用 max_output_tokens。
apps/desktop/src/main/utility-model/tests/oneShotCandidates.test.ts 断言 ChatGPT Codex 路由 body 形状:包含 reasoning.effort 且不发送 max_output_tokens。
apps/desktop/src/main/maker-host/auto-permission-reviewer.ts 新增 Desktop host 侧轻量 reviewer:最小 payload prompt、紧凑 JSON 解析、输出/原因截断与日志。
apps/desktop/src/main/maker-host/tests/autoPermissionReviewer.test.ts 覆盖 prompt 最小化、越界截断、解析容错与异常降级路径。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop/src/main/maker-host/auto-permission-reviewer.ts
Comment thread packages/maker-core/src/agents/shared/auto-review-decision.ts Outdated
Copilot AI review requested due to automatic review settings July 31, 2026 13:33

@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: 77ccc4e430

ℹ️ 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/utility-model/oneShotCandidates.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@zqchris 👋 这个 PR 还有 5 条 review conversation 没 resolve(packages/maker-core/src/agents/shared/auto-review-decision.ts / apps/desktop/src/main/maker-host/auto-permission-reviewer.ts / apps/desktop/src/main/utility-model/oneShotCandidates.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

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

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/maker-core/src/agents/shared/auto-review-decision.ts:43

  • reviewAction() 的返回值包含 prompt(见 packages/maker-core/src/agents/shared/auto-review.ts:45-109),语义是需要升级用户确认;但这里仅把 prompt-each-time 映射成 ask,会把 prompt 当成“灰区”继续走 delegate(甚至在 delegate 缺失时直接 block)。这会导致本应走本地确定性“需要确认”的动作在 fallback 路径下被误判(可能被模型放行、或无 delegate 时被静默拦截),与注释“明显红线仍由本地规则确定”不一致。建议把 prompt 也映射到 ask
  if (localVerdict === 'auto-approve') return { verdict: 'allow' };
  if (localVerdict === 'prompt-each-time') return { verdict: 'ask' };
  if (!delegate) {

Signed-off-by: zqchris <chrisz83@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 13:41
Signed-off-by: zqchris <chrisz83@gmail.com>

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/maker-core/src/agents/shared/auto-review.ts:62

  • ReviewVerdict 里的 promptauto-review.ts 的模块注释中仍被描述为“升级用户确认(可本会话记住)”(packages/maker-core/src/agents/shared/auto-review.ts:20-21),但本 PR 新增的 auto-review-decision.ts 已将 prompt 显式映射为内部灰区 needs-review,并可能走 host 侧轻量 reviewer 后返回 block(不一定触发用户确认)。这会让后续维护者误解 prompt 的语义,尤其是新增/调整 adapter 时更容易把 prompt 当成 UI 行为。建议同步更新 auto-review.ts 的判定档说明,把 prompt 解释为“需要进一步审查/升级到外层裁决层”,避免与 UI 的 ask 混用。
  | { kind: 'session-state' }
  | { kind: 'file-write'; path: string | undefined }
  | { kind: 'exec'; command: string }
  | { kind: 'network'; target?: string; operation?: string }
  | { kind: 'other' };

Copilot AI review requested due to automatic review settings July 31, 2026 13:46

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

apps/desktop/src/main/maker-host/auto-permission-reviewer.ts:140

  • 这里用 Promise.race 做超时兜底时,未对 deps.requestText() 的“落败 promise”附加 catch;如果 requestText 在超时返回后才 reject,Node 可能触发 unhandledRejection(同时请求也会继续跑到结束)。建议在 race 前把 requestText 包一层 .catch(() => null) 来吞掉后续 reject,避免进程级告警/崩溃风险。
      const text = await Promise.race([
        deps.requestText(request, buildAutoPermissionReviewPrompt(request)),
        new Promise<typeof REVIEW_TIMEOUT>((resolve) => {
          timeout = setTimeout(() => resolve(REVIEW_TIMEOUT), REVIEW_TIMEOUT_MS);
        }),
      ]);

Comment thread packages/maker-core/src/agents/shared/auto-review-decision.ts Outdated
Signed-off-by: zqchris <chrisz83@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 14:02

@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: a07f1c2ea8

ℹ️ 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/shared/auto-review-decision.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@zqchris 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/shared/auto-review-decision.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

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

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/maker-core/src/agents/shared/auto-review-decision.ts:107

  • 这里直接 await delegate(request) 没有任何超时兜底;如果 host 侧 delegate 永不 settle(例如请求挂死或漏了超时),resolveAutoReviewDecision 会一直卡住,和上方注释“超时/不可用时灰区一律 block、且不应 hold tool callback open”的承诺不一致。建议在 core 侧也用 Promise.race 加一个硬超时(与 host 的 8s 对齐即可),超时按 null/非法结果处理并走 block 降级。
  try {
    const decision = await delegate(request);
    if (
      decision?.verdict === 'allow'
      || decision?.verdict === 'block'

Signed-off-by: zqchris <chrisz83@gmail.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: 746f27cdc4

ℹ️ 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-host/auto-permission-reviewer.ts Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (3)

apps/desktop/src/main/maker-host/auto-permission-reviewer.ts:139

  • 这里用 Promise.race 实现 8s deadline,但超时分支不会 abort 正在进行的请求。结合上面的 AbortSignal 扩展后,建议在超时时调用 controller.abort(),以便及时释放 HTTP 连接并避免后台持续跑请求。
      const text = await Promise.race([
        deps.requestText(request, buildAutoPermissionReviewPrompt(request)),
        new Promise<typeof REVIEW_TIMEOUT>((resolve) => {
          timeout = setTimeout(() => resolve(REVIEW_TIMEOUT), REVIEW_TIMEOUT_MS);
        }),

apps/desktop/src/main/maker-host/auto-permission-reviewer.ts:14

  • 目前超时只让 Promise.race 先返回,但不会取消底层的 requestText(网络请求仍会继续占用连接/算力),在高频审批场景里可能造成并发堆积。建议在 deps 层暴露可选 AbortSignal,让 reviewer 在超时时主动 abort。

This issue also appears on line 135 of the same file.

export interface AutoPermissionReviewerDeps {
  requestText(request: AutoReviewRequest, prompt: string): Promise<string | null>;
  logger: AutoPermissionReviewerLogger;

packages/maker-core/src/agents/shared/auto-review-decision.ts:61

  • missingReviewEvidencenetwork 只检查了 target,但 ReviewableAction 已支持 operation 字段;如果 adapter 只填了 operation(例如用它承载搜索词/操作描述),这里会被误判为“缺少证据”并直接 block,导致不必要的 fail-closed。建议把 operation 也纳入“证据充分”的判断。
    case 'network':
      return action.target?.trim()
        ? null
        : 'Network review needs a concrete destination or query.';

@MagicLizi

Copy link
Copy Markdown
Contributor

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

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

Signed-off-by: zqchris <chrisz83@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 15:07

@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: a4b9c1c44c

ℹ️ 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/utility-model/oneShotCandidates.ts

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

apps/desktop/src/main/maker-host/auto-permission-reviewer.ts:138

  • 这里用 Promise.race 实现 8s 超时只会让 reviewer 提前返回 null,但不会取消正在进行的 deps.requestText(...)。在 fallback reviewer 这种“失败必须尽快 fail-closed”的链路里,这会在超时后继续占用网络/上游并产生额外成本。建议用 AbortController 在超时触发时中止底层请求(并把 signal 透传给实现侧)。
      const text = await Promise.race([
        deps.requestText(request, buildAutoPermissionReviewPrompt(request)),
        new Promise<typeof REVIEW_TIMEOUT>((resolve) => {
          timeout = setTimeout(() => resolve(REVIEW_TIMEOUT), REVIEW_TIMEOUT_MS);
        }),

Comment thread packages/maker-core/src/agents/shared/auto-review-decision.ts
Signed-off-by: zqchris <chrisz83@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 15:36

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/maker-core/src/agents/shared/auto-review-decision.ts:79

  • ReviewableActionnetwork 新增了 operation? 字段,但 missingReviewEvidence 目前只检查 target。这会导致仅填了 operation(例如“search”/“GET”)但没有 target 的网络动作被当作“证据缺失”直接 block,与类型设计不一致。建议把判定改为:targetoperation 任一非空即可视为有足够证据进入灰区审查。
    case 'network':
      return action.target?.trim()
        ? null
        : 'Network review needs a concrete destination or query.';

@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: e2c9fa9613

ℹ️ 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/utility-model/oneShotCandidates.ts
Signed-off-by: zqchris <chrisz83@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 16:04

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/maker-core/src/agents/shared/auto-review-decision.ts:79

  • ReviewableActionnetwork 动作现在包含 operation?: string,但 missingReviewEvidence() 只检查 target。这会导致即便提供了 operation(符合错误文案里“destination or query”的表述)也会被当作证据不足直接 block,行为与类型/文案不一致。建议改为 targetoperation 任一存在即可视为证据齐全(或相反:如果必须有 target,就把 operation 去掉/把文案改成只要求 target)。
    case 'network':
      return action.target?.trim()
        ? null
        : 'Network review needs a concrete destination or query.';

@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: d6924fa942

ℹ️ 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/utility-model/oneShotCandidates.ts Outdated
Signed-off-by: zqchris <chrisz83@gmail.com>
Copilot AI review requested due to automatic review settings July 31, 2026 16:33

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/maker-core/src/agents/shared/auto-review-decision.ts:149

  • resolveAutoReviewDecision 目前只校验 delegate 返回的 verdict 三态就直接透传 decision,但没有对 reason 做任何长度/类型约束;如果 delegate 直接回传模型原文(或被上游注入超长 reason),这里会把未受限的字符串继续向后传播,破坏“输出硬上限”的安全边界。建议在 core 层也做一次最小清洗:仅保留 verdict,并对 reason 做 trim + 截断(与 host 侧 240 上限对齐)。
        || decision?.verdict === 'ask'
      )
    ) {
      return decision;
    }

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

审查通过,零 P0/P1。fail-closed 设计与 anti-injection 措施到位。

@MagicLizi
MagicLizi merged commit b43447d into makecindy:main Jul 31, 2026
5 of 6 checks passed
@MagicLizi

Copy link
Copy Markdown
Contributor

fail-closed + Unicode 编码隔离不可信输入的设计,给后面想接入更多自动审查场景打了个好底子。timeout 全在 finally 里清也是该有的细节。

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.

3 participants