Skip to content

fix(agent-core-v2): drop literal decision clauses from system prompt and auto reminder - #3894

Merged
7Sageer merged 1 commit into
MoonshotAI:mainfrom
7Sageer:prompt-decision-literalism
Sep 18, 2026
Merged

7Sageer merged 1 commit into
MoonshotAI:mainfrom
7Sageer:prompt-decision-literalism

Conversation

@7Sageer

@7Sageer 7Sageer commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Related Issue

No tracking issue — this comes out of an A/B agent-harness benchmark analysis (details below in Problem). Happy to file/link one if a maintainer prefers.

Problem

Two literal decision clauses in the default agent context were being quoted verbatim by the model to justify wrong choices under ambiguity, observed repeatedly in an A/B benchmark where two agent harnesses ran the same model on the same task set:

  1. Do what was asked — no less, no more … Leave out anything the ask does not call for. (system prompt, Delivering work) — in tasks whose wording was under-specified, the model cited this clause to reject industry-convention solutions as "not requested", then went off to build a heavier "literal" solution that the verifier did not accept. The same model in the other harness (without this clause) picked the conventional solution and passed.
  2. Make a reasonable decision and continue without asking the user. (auto permission mode reminder + the matching permission-policy denial text) — in an all-or-nothing task with undeclared external contracts (layout/format conventions), multiple failing runs cited this sentence at the exact decision point as license to gamble on a single contract and hard-code it, instead of writing convention-robust code. A passing run under the identical clause shows it is a probability amplifier, not a deterministic trap — but the license wording is what the model reached for when it gambled.

The bar for a prompt clause should be: "when the model quotes it at an ambiguous decision point, is its advice always right?" These two fail that bar precisely where steering matters most. Meanwhile both clauses' functional cores are either redundant (the stated-goals sentence already covers "do what was asked") or must stay (the AskUserQuestion ban in auto mode — in headless runs a stalled question is worse than a wrong guess).

What changed

  • system.md (Delivering work): Do what was asked — no less, no more, and nothing different. … Leave out anything the ask does not call for. → Do what was asked. Goals the user states explicitly count as part of the ask. Keeps the stated-goals主干, removes the literalism that was citable as a rejection license.
  • permission-mode-auto-enter-reminder.md: Do NOT call AskUserQuestion while auto mode is active. Make a reasonable decision and continue without asking the user. → Do NOT call AskUserQuestion while auto mode is active; decide and continue. The functional ban stays; the "reasonable decision" license goes.
  • auto-mode-ask-user-question-deny.ts: same wording alignment for the policy denial message shown when the model does call AskUserQuestion in auto mode.

Deliberately not touched: neighboring clauses whose failures were one-off collisions (single case, with passing runs under the same clause), and no new clauses were added — steering text always lags the model, and every added line is a new thing the model can quote as a rejection license.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's approve comment). — none yet; see Related Issue above.
  • I have added tests that prove my feature works. — prompt/.md text carries no behavior assertions; the ts string change is covered by existing permissionPolicyService tests (98/98 pass locally).
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update. — no docs reference the changed sentences.

Copilot AI balanced review requested due to automatic review settings September 18, 2026 07:55
@changeset-bot

changeset-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 002bf08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@7Hanrui

7Hanrui commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@codex review

@pkg-pr-new

pkg-pr-new Bot commented Sep 18, 2026 •

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

commit: 002bf08

@7Sageer
7Sageer force-pushed the prompt-decision-literalism branch from 5796f8d to ea38c9a Compare September 18, 2026 07:59
@7Sageer
7Sageer force-pushed the prompt-decision-literalism branch from ea38c9a to 002bf08 Compare September 18, 2026 08:16
@7Sageer
7Sageer merged commit 910aba2 into MoonshotAI:main Sep 18, 2026
15 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 18, 2026
7723qqq added a commit to 7723qqq/kimi-code that referenced this pull request Sep 19, 2026
… and auto reminder (MoonshotAI#3894)

Two upstream text alignments: the 'Delivering work' paragraph loses its
'no less, no more, and nothing different' clause, and the auto-mode enter
reminder's AskUserQuestion line becomes 'decide and continue'. The fork's
AutoModeAskUserQuestionDeny message is fork-authored ('Auto mode cannot
ask interactive questions') and stays as-is.
7723qqq added a commit to 7723qqq/kimi-code that referenced this pull request Sep 19, 2026
All deltas since merge base 1b89e4b now carry verdicts: MoonshotAI#3885 and
MoonshotAI#3894 ported, MoonshotAI#3896/MoonshotAI#3892/MoonshotAI#3887/MoonshotAI#3889 not-applicable (engine architecture
differs structurally — reasoning in the allowlist), the remaining eight
tracked as ROADMAP §6.1 items 22-28 with the prerequisite chain recorded
(models.dev proxy, trace id capture, steer id design pass). Gate exits 0.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Oct 5, 2026
Step 7 of the incremental sync to 2.1.1: 21 upstream commits over 263
files. 24 conflicts, concentrated in the provider/registry import path
(api_key_env, registry import) and the media-read layer where the fork's
inline media reading sits on top of upstream's ReadMediaFile guidance.

Upstream's changes in this step, all absorbed:
- Stop listing unavailable media tools in subagent menus and clarify
  Read errors for images and videos (MoonshotAI#3878)
- Providers can read their API key from a named environment variable
  (api_key_env in config.toml or the provider API) (MoonshotAI#3762)
- Keep follow-up messages sent during a turn from appearing twice after
  a session reload (MoonshotAI#3896)
- Session index compaction on startup, faster CLI startup, faster
  session list and resume on large workspaces, and incremental
  background search indexing (MoonshotAI#3889)
- Rename kimi install-app to kimi install-desktop, keeping the old name
  as a hidden alias (MoonshotAI#3864)
- Restore thinking display for OpenAI-compatible providers that send a
  reasoning string next to an unrecognized reasoning_details array
  (MoonshotAI#3910)
- Fix kimi -p exiting early and cancelling the active turn when a cron
  task fires (MoonshotAI#3875)
- Drop literal decision clauses from the system prompt and the auto
  permission mode reminder (MoonshotAI#3894)
- select_tools points out already-available tools to call directly and
  suggests announced names for near-miss selections (MoonshotAI#3885)
- Fix deleting or archiving a session sometimes never finishing (MoonshotAI#3887)
- Keep follow-up messages attached to their turn; undo the host turn
  instead of the follow-up alone (MoonshotAI#3891, MoonshotAI#3906)
- Remove the system-prompt rule that forbade all file access outside the
  working directory (MoonshotAI#3879)
- Stop workspace file watchers from scanning an unbounded project root;
  add [watch] enabled / KIMI_CODE_WATCH to disable watching (MoonshotAI#3892)

Fork behaviour that had to survive:
- the i18n layer: the registry-import and provider api_key_env strings
  went through `t()` with en/zh entries (providerApiKey,
  registryAuthRequired, providerAuthRequired, subtitleDefault,
  tokenLabel)
- the fork's inline media reading in the read tool, kept over
  upstream's ReadMediaFile guidance
- the provider/registry import path, where the fork's custom-registry
  flow and upstream's api_key_env support had to be reconciled

The merge also drops the unused READ_MEDIA_FILE_TOOL_NAME constant that
came in with this step (the fork reads media inline), keeping the lint
gate green.

Verified: typecheck clean across every package and app; full suite
17752 passed / 0 failed / 81 skipped / 1 todo; lint 0 errors.
@7Sageer
7Sageer deleted the prompt-decision-literalism branch October 14, 2026 08:03
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