Repository navigation
revert: remove experimental auto review - #5649
Conversation
🦋 Changeset detectedLatest commit: cd2ae91 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
7d85de1 to
682737a
Compare
|
@codex review |
commit: |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
`bun scripts/upstream-ledger.mjs --refresh` at upstream/main 4eb2919 added 126 rows, so every open upstream commit and every PR it references now has a ledger row: 0/596, down from 125 at 8bf8ba3 and 126 at the fetched tip. The refresh only reads `upstream/main ^ main`, so the three release-2.6.2 commits named by the mission (MoonshotAI#4875/MoonshotAI#4905/MoonshotAI#4922) gained rows with the refresh's row shape. Settled with live probes in this tree: - ported: MoonshotAI#5533 (docs 2.8.1 changelog), MoonshotAI#4875 (registry search_url and feedback_url plus the feedback service), MoonshotAI#4905 (Kimi upload status validation in packages/core), MoonshotAI#4922 (swarm task events in sessionTaskFeed), MoonshotAI#5438 (unload only declared dynamic tools), MoonshotAI#5592 (dynamic tool replacement order), MoonshotAI#5595 (append-log known length), MoonshotAI#5573 (skill roots for every work dir), MoonshotAI#5576 (date reminder cwd comparison), MoonshotAI#5618 (session titles for skill openers), MoonshotAI#5638 (frozen loop tool baseline), MoonshotAI#5626 (legacy turn-input origins) - partial: MoonshotAI#5505 (processLiveness source and consumers present; the upstream unit test file was never carried), MoonshotAI#5571 (program-resume and OSC 7577 present; the upstream test helper was never carried), MoonshotAI#5532 (gitService half present; fsService still leaks the environment lease at fsService.ts:1133 and :1267), MoonshotAI#5557 (app-client icon registry kept; the move to app-ui was never carried) - not-applicable: MoonshotAI#4655 (upstream reverted auto review in MoonshotAI#5649), MoonshotAI#5333 (PLAYBOOK:111 deliberate flat experimental flags) M39's "likely present" list was checked, not trusted: MoonshotAI#5438 is present (upstream test passes), MoonshotAI#5487 is not (nativeStartSettleMs/leg.nativeSettled absent), MoonshotAI#5635 is not (ToolsSettled absent), MoonshotAI#5429 needs a visual probe. The remaining 194 pending rows stay open with their reasons; no feature was ported and no upstream-drift allowlist entry was added. Verification: verify -> 332 closed rows, 332 carry every file of their PR; 317 probes pass, 2 foreign-runner skips, 0 fail; a second verify is byte-identical (ledger sha256 cbf53638...). Probe tests 29 pass; bun run lint and node scripts/checks/ratchet.mjs green.
Requirement or Bug
回退 #4655(
14affd12d5)引入的实验特性 Auto Review。该特性默认关闭,尚未进入正式版(仅出现在 canary 构建中)。回退后权限判断恢复为单一静态策略链,Bash与 MCP 调用不再发送给独立模型复核。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
核心思路:基于最新
main(87058b9085)对14affd12d5执行 revert。未被后续提交触碰的文件逐字节恢复到 #4655 之前;之后被其他提交改过的重叠文件只摘除 Auto Review 片段,保留后续演进。flowchart TD A["工具调用进入权限门"] --> B["PermissionPolicy.evaluate(context) 按当前模式求值"] B --> C{"静态策略结果"} C -- "ask" --> D["沿用两阶段审批询问用户"] C -- "approve" --> E["直接放行"] C -- "deny" --> F["返回否决结果"]删除
features/autoReview/整个目录及useAutoReviewHint;权限门移除registerReviewer钩子,恢复原有的两阶段permitting处理(以及 #4655 删除前同样无生产调用方的authorize()接口);PermissionPolicy.evaluate恢复只按当前模式求值,非交互宿主恢复在构造期跳过危险命令策略。KAP、SDK、TUI、Desktop/Web、VS Code、ACP、vis 与双语文档中的auto_review/approval_detail字段、事件与展示同步移除,并重新生成config-manifest.toml、state-manifest.d.ts、wire-manifest.d.ts与 KAP schema。关键决策
resolveMaxOutputTokensprovider-catalog/model/completion-budget.tsscripted-generate.ts的错误分支isError2(error)!(error instanceof ChatProviderError)ChatProviderError继承Error2,旧判断会让 mock provider 错误无法直接抛出kap-server/src/protocol/interaction.tsapprovalInteractionRequestSchema(删除approval_detail)z.objectGenericTool.vue的empty-textemptyTextcomputed(与BrowserToolDetails.vue一致)jscpd对.vue<template #body>倒置行号产生的空串指纹碰撞,渲染行为不变loopService.ts、openapi.json、app-components、externalHooks测试)$ref)main不变,修掉回退带回的.sort()和未使用导入oxlint-ratchet.json阅读指南:
packages/agent-core-v2/src/agent/permissionGate/与permissionPolicy/(恢复静态策略链与构造期危险命令开关)→packages/kap-server/src/protocol/(协议字段移除)。其余为features/autoReview/整体删除、各端字段/事件透传与展示代码的对应删除,以及重新生成的 manifest / schema,可略读。Behavior Changes and Affected Users
yolo/auto(含kimi -p)下的Bash与 MCP 调用KIMI_CODE_EXPERIMENTAL_AUTO_REVIEW=1、KIMI_CODE_EXPERIMENTAL_FLAG=1或[experimental] auto_review = true开启实验的 TUI、print、headless、Tower、SDK 用户[auto_review]配置节、[experimental] auto_review、KIMI_CODE_EXPERIMENTAL_AUTO_REVIEWeffort、timeout_ms[auto_review]节按未知配置节产生 warning 诊断并忽略,不阻断启动tool_call.auto_review字段、approval_detail字段与auto_review.*WS 事件HOST_API_LEVEL保持 1@moonshot-ai/klient调用方Reviewing…,复核拒绝/失败时在审批卡片显示标题与理由auto_review.*wire 记录与autoReview.*状态的会话auto_review_decision[secondary_model].default_effort校验[secondary_model]的用户(无行为变化)@moonshot-ai/kimi-code-sdk、@moonshot-ai/agent-core-v2)ApprovalReviewDetail、formatApprovalReviewTitle受影响模块与测试覆盖:
permissionGate.test.ts、permissionPolicyService.test.ts、toolExecutor.test.ts、externalHooks/integration.test.ts(默认路径与危险命令/非交互分支)。configManifest.test.ts、stateManifest.test.ts、subagent/configSection与forkParity.test.ts([secondary_model]校验与 manifest 同步)。apiSurface.test.ts(schema 与HOST_CONTRACT摘要已更新,apiLevel保持 1)、sessions.test.ts、conversation.test.ts、klient/test、node-sdk/test、acp-server/test。approval-panel.test.ts、kimi-tui-message-flow.test.ts、transcript-projection.test.ts、app-components/test/genericTool.test.ts、app-core/test、tests/scenarios。验证结论:在 Linux(Node 24,16 vCPU)跑通整仓
pnpm lint(0 errors / 0 warnings,棘轮无新增)、整仓pnpm typecheck,以及受影响的 473 个测试文件、8662 个用例(含上述全部模块)。未验证:Windows、macOS 桌面端专项。验证明细与两项需维护者知悉的环境/工具问题
沙盒中 4 个未触碰的测试文件超时(已证实为基线既有问题,未在本 PR 修改):
packages/app-components/test/composerMenuViewportClamp.test.tspackages/app-client/test/actionToastDismiss.test.tspackages/app-client/test/exportToastFacade.test.tspackages/app-client/test/session-observation-integration.test.ts在同一 Linux 环境中对未改动的
main运行这 4 个文件,出现完全相同的 5s/10s 超时,与本次 revert 无关。本次改动涉及的所有测试文件均通过。check:duplication的jscpd空串指纹碰撞及规避方式(已通过,无需豁免):纯 revert 状态下
pnpm run check:duplication origin/main会把未改动的GoalTool.vue:19与GrepTool.vue:57(60 tokens)误报为新增重复。根因是[email protected]的基线指纹算法缺陷(baseline.rs / shared.rs):.vue内嵌 HTML 扫描对<template #body>起始处记录的start.line > end.line(如19 -> 16、48 -> 33),extract_lines用saturating_sub计算出长度 0,导致这类克隆的文本切片全为空串,指纹全部退化为同一个snippet_pair_hash("", "")。main基线中有 2 个此类空指纹(BackgroundTaskTool<->CronTool、GoalTool<->GrepTool)。回退移除GenericTool.vue中的reviewHint分支后,GenericTool<->WaitForTool成为第 3 个空指纹克隆,超出mark_new的 multiplicity 计数。本 PR 未改动
GoalTool.vue、GrepTool.vue、WaitForTool.vue等无关组件,而是将GenericTool.vue的:empty-text三元表达式提取为emptyTextcomputed(+3/-1 行,与BrowserToolDetails.vue写法一致,渲染行为完全不变),消除与WaitForTool.vue的 61-token 空指纹对齐,check:duplication已验证 0 退出通过。jscpd的.vue行号倒置问题可后续单独修复。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.