Skip to content

fix(kimi): enable delegated sessions with confirmed native YOLO mode - #711

Merged
BytePioneer-AI merged 3 commits into
BytePioneer-AI:mainfrom
liki-0814:codex/fix-kimi-delegation
Nov 3, 2026
Merged

BytePioneer-AI merged 3 commits into
BytePioneer-AI:mainfrom
liki-0814:codex/fix-kimi-delegation

Conversation

@liki-0814

@liki-0814 liki-0814 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Kimi Code 无法接收委派:Coordinator 创建委派会话时始终传入 unattended-full-access,但 Kimi Adapter 在打开会话前直接返回 unsupported。

将该执行意图映射到原生 ACP mode=yolo,复用现有 set_config_option 配置与回执校验。只有原生确认 currentValue=yolo 才返回会话;未确认时关闭 Transport 并报错。显式指定 default、plan 或 auto 与无人值守意图冲突时,在创建前拒绝。普通会话继续使用原生默认配置。

改动限定在 Kimi Adapter、聚焦测试与现有能力边界文档,无公共契约或 Host 委派路由改动。与 Pi 状态刷屏修复 PR 独立。

Related issues

N/A

Test plan

macOS,Node 24.22.2:

  • npx tsc -b packages/adapters/kimi-code:通过。
  • npx vitest run --config tests/vitest.config.js packages/adapters/kimi-code/test:Kimi 包全部 13 个测试文件、174 项通过。新增覆盖普通会话未指定/显式 default 执行策略与未指定/default/plan/auto/yolo 权限模式的 10 种组合,确认不会自动升权;另覆盖委派默认映射、显式 yolo、三种冲突权限模式,以及原生未确认时的失败与 Transport 清理。原有恢复、Fork、回滚、模型/Thinking、会话执行与交互、历史、安装和导入等回归一并通过。
  • 修改的 TypeScript 文件通过 ESLint;四个修改文件通过 Prettier;git diff --check 通过。
  • 真实 Kimi Code 2.4.0:通过 ACP 查询确认 yolo 的原生含义为 Auto-approve everything,并验证配置回执;再通过构建后的 KimiAdapter.open(create, unattended-full-access) 创建会话,确认 initialState.effectivePermissionModeId 为 yolo,随后关闭 Adapter。另通过同一构建后的 Adapter 创建普通会话(不传 executionPolicy 或 permissionModeId),实测仍为原生 default。

真实验证未发送模型请求;未进行完整的 Host CLI 委派任务、Desktop UI 或跨 Harness 递归委派验证。本次修复范围是接收委派时的原生权限配置。

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 新功能
    • Kimi 委派会话现支持无人值守全权限模式,并使用原生 yolo 权限模式。
    • 普通会话未指定权限模式时,继续使用 Kimi 原生默认值。
  • 错误修复
    • 仅在 Kimi 确认已启用所需权限后,才会创建无人值守会话;未确认时会关闭连接并报错。
    • 无人值守全权限请求若明确指定其他权限模式,将被拒绝。

Kimi 适配器现在允许无人值守完全访问请求使用原生 yolo 模式。未指定模式时,适配器请求 yolo;显式指定其他模式时,请求返回 invalidRequest。测试和文档覆盖模式选择及原生模式未确认时的处理。

Changes: Kimi 委派权限模式

Layer / File(s) Summary
请求模式、原生确认与验证
packages/adapters/kimi-code/src/kimi-adapter.ts, packages/adapters/kimi-code/test/kimi-adapter.test.ts, packages/adapters/kimi-code/test/review-regressions.test.ts, docs/harnesses/capability-boundaries.md
无人值守请求未指定权限模式时,适配器请求原生 yolo 模式;显式指定其他模式时返回 invalidRequest。原生模式未获确认时返回 nativeFailure 并关闭 Transport。测试覆盖普通模式、无人值守模式及确认失败路径;文档说明权限边界。

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: 范围:适配器

Suggested reviewers: bytepioneer-ai, gy212

Merge Risk: Minimal · previous review 6081e

Kimi selects and verifies yolo for unattended sessions. No merge-blocking issue was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed 标题准确概括了主要改动:为 Kimi 启用委派会话,并确认原生 YOLO 模式。表述简洁且与变更集一致。
Description check Passed 描述明确说明了委派会话、原生 YOLO 模式、配置回执校验、冲突权限模式处理和测试结果,与变更集直接相关。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f24bbdf and 6081ec0.

Files selected for processing: 1
  • packages/adapters/kimi-code/test/kimi-adapter.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

Recent review details
Context from checks skipped due to timeout: 3
  • GitHub Check: CodeRabbit
  • GitHub Check: Check ubuntu-22.04
  • GitHub Check: Check macos-15
Additional context used
Code guidelines: 1
AGENTS.md — auto-discovered
Path-based instructions: 1
Source excerpt: `codexhost` runs external Agent Harnesses as independent Threads inside Codex Desktop, preserving the official shell and native Codex path.

CodeRabbit inference engine (AGENTS.md)

Files:

  • packages/adapters/kimi-code/test/kimi-adapter.test.ts

@BytePioneer-AI
BytePioneer-AI merged commit 9a2310e into BytePioneer-AI:main Nov 3, 2026
4 checks passed
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