kimi-code/packages/agent-core/test/tools
Kai 7c889f3a96
fix(agent-core): mark auto-approved plan exits as not user-reviewed (#1638)
* fix(agent-core): mark auto-approved plan exits as not user-reviewed

In auto permission mode ExitPlanMode is approved without user
involvement, but its result read "## Approved Plan:" exactly like a
genuine user approval and the transcript showed a green "Approved"
chip. The model treated that as a signal to start executing, even
when the user had asked it to stop after planning.

- Emit an "auto-approved, not user-reviewed" result with a note that
  execution follows the user's original instructions (v1 + v2).
- Extend the auto-mode reminder: plan approvals are automatic and are
  not a user signal to proceed (v1 + v2).
- Render an "Auto-approved" warning-toned chip in the TUI, keeping
  backward compatibility with the old result marker.
- Document the Auto mode plan-exit behavior in interaction guides.

* fix(agent-core): only mark plan exits as auto-approved in auto permission mode

Address review feedback on the auto-approved plan exit change:

- Branch the direct-execution output on the permission mode in both
  engines: only auto mode yields the "auto-approved, not
  user-reviewed" result and telemetry outcome. In manual / yolo modes
  the direct path means a configured or session allow/ask rule let the
  call through — an explicit user decision that keeps the user-approved
  output, the Approved transcript chip, and the approved outcome.
- Move the v2 rationale out of the method body into the file header,
  per the agent-core-v2 comment convention.
- Drop the absolute "only Auto mode" wording from the interaction
  guides (en/zh).
2026-07-14 11:30:47 +08:00
..
background feat: auto-background timed-out foreground bash commands (#1591) 2026-07-13 21:08:21 +08:00
cron feat(agent-core): rework compaction to keep only user prompts and summary (#1214) 2026-07-01 01:17:30 +08:00
fixtures fix: resume sessions with missing workdir (#1517) 2026-07-09 16:46:57 +08:00
planning fix: require AgentSwarm to run alone (#643) 2026-06-11 13:58:35 +08:00
policies feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00
providers Kimi For Coding 2026-05-22 15:54:50 +08:00
agent.test.ts feat(agent-core): configurable subagent timeout with 2h default (#1562) 2026-07-12 11:48:06 +08:00
ask-user.test.ts feat(agent-core): feed AskUserQuestion answers back as question text and option labels (#1414) 2026-07-06 16:37:54 +08:00
bash-env.test.ts feat: detach foreground tasks to background (#821) 2026-06-20 21:24:22 +08:00
bash-windows-kill.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
bash.test.ts feat: auto-background timed-out foreground bash commands (#1591) 2026-07-13 21:08:21 +08:00
builtin-current.test.ts refactor: move tool-result metadata into a structured note side channel (#1437) 2026-07-07 11:40:27 +08:00
edit.test.ts feat: Harden the default system prompt and built-in tool descriptions (#1102) 2026-06-26 16:56:40 +08:00
enter-plan-mode.test.ts feat: Harden the default system prompt and built-in tool descriptions (#1102) 2026-06-26 16:56:40 +08:00
exit-plan-mode-options.test.ts fix(agent-core): mark auto-approved plan exits as not user-reviewed (#1638) 2026-07-14 11:30:47 +08:00
exit-plan-mode.test.ts fix(agent-core): mark auto-approved plan exits as not user-reviewed (#1638) 2026-07-14 11:30:47 +08:00
fetch-url.test.ts feat(agent-core): slim WebSearch to query-only; fetch page content via FetchURL (#1260) 2026-07-01 18:46:15 +08:00
file-type.test.ts fix(agent-core): report EXIF-rotated image dimensions and raise edge cap to 3000px (#1460) 2026-07-07 21:38:43 +08:00
glob.test.ts chore(telemetry): add ripgrep fallback telemetry (#1203) 2026-06-29 18:30:09 +08:00
goal.test.ts fix: clarify goal blocked audit guidance (#1481) 2026-07-07 22:29:40 +08:00
grep.test.ts chore(telemetry): add ripgrep fallback telemetry (#1203) 2026-06-29 18:30:09 +08:00
image-compress.test.ts test: cut slow suite runtimes and isolate experimental flag from host env (#1595) 2026-07-13 17:45:22 +08:00
image-originals.test.ts feat(agent-core): announce image compression and keep originals readable (#1304) 2026-07-02 19:07:56 +08:00
input-schema-io.test.ts feat(agent-core): feed AskUserQuestion answers back as question text and option labels (#1414) 2026-07-06 16:37:54 +08:00
list-directory.test.ts feat(agent-core): refine system prompt context (#777) 2026-06-15 18:38:42 +08:00
path-guard.test.ts feat: add workspace add-dir support (#812) 2026-06-22 19:42:13 +08:00
plan-mode-hard-block.test.ts fix: require AgentSwarm to run alone (#643) 2026-06-11 13:58:35 +08:00
read-file.test.ts refactor: move tool-result metadata into a structured note side channel (#1437) 2026-07-07 11:40:27 +08:00
read-media-desc.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
read-media.test.ts test: cut slow suite runtimes and isolate experimental flag from host env (#1595) 2026-07-13 17:45:22 +08:00
read.test.ts refactor: move tool-result metadata into a structured note side channel (#1437) 2026-07-07 11:40:27 +08:00
result-builder.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
rg-locator.test.ts refactor: unify path normalization with pathe (#84) 2026-05-27 11:53:24 +08:00
shell-cancel.test.ts feat: detach foreground tasks to background (#821) 2026-06-20 21:24:22 +08:00
shell-quoting.test.ts feat: detach foreground tasks to background (#821) 2026-06-20 21:24:22 +08:00
skill-tool-dispatch.test.ts refactor: decouple agent skill registry (#784) 2026-06-15 20:39:29 +08:00
skill-tool.test.ts feat: Harden the default system prompt and built-in tool descriptions (#1102) 2026-06-26 16:56:40 +08:00
todo-list.test.ts feat: Harden the default system prompt and built-in tool descriptions (#1102) 2026-06-26 16:56:40 +08:00
web-search.test.ts feat(agent-core): slim WebSearch to query-only; fetch page content via FetchURL (#1260) 2026-07-01 18:46:15 +08:00
write.test.ts feat: Harden the default system prompt and built-in tool descriptions (#1102) 2026-06-26 16:56:40 +08:00