Skip to content

test(e2e): cover the TUI workspace trust prompt - #5389

Merged
RealKai42 merged 1 commit into
mainfrom
codex/issue-024-e2e-workspace
Nov 25, 2026
Merged

RealKai42 merged 1 commit into
mainfrom
codex/issue-024-e2e-workspace

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

Requirement or Bug

新 E2E 的启动环境预先信任工作区,首次打开陌生目录时的信任提示没有端到端覆盖。这个 PR 补上 024 的信任场景。会话读模型和搜索 worker 的默认配置由 #5380 处理。

Bug Reproduction Steps

  1. 在基线分支用 kimiCliEnv() 启动一个干净工作区的 TUI。
  2. KIMI_CODE_TRUST_WORKSPACE 为 1。真实终端直接显示输入框,Trust this folder? 没有出现。

Root Cause

通用 CLI 测试夹具让常规场景可以直接输入。信任提示需要一个保持产品默认信任判断的隔离启动方式。

Code Changes

  • TUI 场景通过 workspaceTrust: 'trust' 或 workspaceTrust: 'exit' 启用首次启动的信任提示。驱动读到真实菜单后,用终端按键选择继续或返回 shell。
  • 信任场景核对项目指令进入模型请求,并在同一测试 home 重启后恢复会话。拒绝场景核对正常退出、终端模式恢复和零模型请求。

Behavior Changes and Affected Users

测试行为 改动前 改动后 受影响人群 适用条件
首次信任工作区 通用夹具直接进入输入框 从真实提示选信任,确认项目指令生效并在重启后保留信任 编写和维护 TUI E2E 的开发者 单面场景显式指定 workspaceTrust: 'trust'
拒绝工作区信任 通用夹具无法走提示退出路径 在提示中按 Esc,确认以 0 退出、恢复终端且模型未收到请求 编写和维护 TUI E2E 的开发者 单面场景显式指定 workspaceTrust: 'exit'

macOS 上使用本地构建的 CLI 验证。临时恢复自动信任时,两条新用例都因看不到提示而失败。还原后,两条用例各重复 15 次,共 30 次通过。TUI 全套 164 条通过,7 条按适用范围跳过。E2E 类型检查、87 条仓库守卫测试、pnpm lint 和重复代码检查均通过。

Checklist

  • 阅读贡献指南并核对复现步骤。
  • 添加两条从真实终端入口运行的回归用例。
  • 核对行为表和 E2E 指南。
  • 测试及测试指南的改动适用 changeset 豁免。

@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f9f57f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T06:05:50.950142Z f9f57f2 PR opened
🔒 Security Review ✅ Completed 2026-11-25T06:08:30.742614Z f9f57f2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@f9f57f2
npx https://pkg.pr.new/@moonshot-ai/kimi-code@f9f57f2

commit: f9f57f2

@RealKai42
RealKai42 merged commit 2da1daf into main Nov 25, 2026
21 of 23 checks passed
@RealKai42
RealKai42 deleted the codex/issue-024-e2e-workspace branch November 25, 2026 07:26
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 25, 2026
Port the testkit half of MoonshotAI#5380: UNIT_TEST_SWITCHES names the defaults that
exist only to speed unit tests, TEST_ENV_DEFAULTS spreads them, and the
fixtures test pins that setting each name to undefined restores product
defaults while telemetry isolation stays on.

Ledger: MoonshotAI#5373, MoonshotAI#5389, MoonshotAI#5431 and MoonshotAI#5423 are not-applicable because the
tests/e2e Playwright suite and its workflow do not exist here. MoonshotAI#5380 is
partial (testkit half landed), and MoonshotAI#5385 is partial: its ACP fake-model
migration remains for the testkit wave while the legacy-e2e freeze does
not apply.
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.

1 participant