Repository navigation
Description
Summary
KIMI_CODE_LEGACY_FLAG=1 is silently ignored by both the interactive TUI and kimi -p in 0.43.1 — sessions start on the agent-core-v2 engine regardless of the flag. In 0.41.0 the same setup correctly falls back to the legacy engine. The changelog documents this removal only for kimi acp (0.40.0); the TUI and print-mode removals are not documented anywhere.
Environment
- Windows 11, native single-binary install (
~/.kimi-code/bin/kimi.exe) - Launch env:
KIMI_CODE_LEGACY_FLAG=1,KIMI_CODE_HOMEset explicitly - Model via
KIMI_MODEL_*env (provider typekimi, modelkimi-k3)
Expected (0.41.0, same launcher)
Session evidence markers:
wire.jsonlline 1:"protocol_version":"1.4"- session log line 1:
provider=kimi [[permission.rules]]fully honored: allow-listed literal commands run without prompts; deny rules hard-refuse.
Actual (0.43.1, same launcher)
Both a new interactive TUI session and a kimi -p session show:
wire.jsonlline 1:"protocol_version":"1.5"- session log line 1:
provider=openai
i.e. the v2 engine despite KIMI_CODE_LEGACY_FLAG=1.
Consequence (consistent with #2100, which is still open): under v2 the user [[permission.rules]] are not loaded —
- allow rules dead: an allow-listed literal command (
date) triggered a manual approval prompt; - deny rules dead:
git push origin master(in an isolated test repo) was NOT refused by the configured deny rule (it was only stopped by an external PreToolUse hook we run ourselves).
So 0.43.1 removes the last fallback for users who depend on permission.rules: previously the legacy engine provided a working path; now every surface (acp since 0.40.0, and TUI/-p as of this release) forces v2, where rules are ignored.
Changelog gap
- 0.40.0 changelog: "The
kimi acpsubcommand no longer honorsKIMI_CODE_LEGACY_FLAG" — documented. - 0.42.0 / 0.43.0 / 0.43.1 changelog: no mention of TUI or print mode dropping the flag.
Request
- Confirm whether dropping
KIMI_CODE_LEGACY_FLAGfor TUI and-pis intentional. - If intentional: please document it in the changelog and publish the migration path / sunset timeline for deployments that rely on
[[permission.rules]](which require the legacy engine today, cf.kimi webManual mode ignores user-configured[[permission.rules]]allow rules (over-prompts) #2100). - If unintentional: please restore the flag for TUI and
-p.
Happy to provide wire logs, session logs, or a minimal repro script if useful.
Activity
Comandante-Supremo commentedon Sep 19, 2026
Confirming the deny-rules-dead half on 0.43.0 (darwin arm64, native install) with a controlled repro that isolates the effect from the
git pushshape #3820 used.Setup
~/.kimi-code/config.toml:default_permission_mode = "yolo",[permission].dangerous_command_guard = false.19
[[permission.rules]]denyentries (positions 1–19), 9allowentries after (positions 20–28), catch-allpattern = "Bash"last.Probe rule added at position 1:
Nothing earlier in the rules list matches
echo kimi-deny-probe-target. The catch-allBashallow at the end is documented as reachable only when no earlier rule matches.Repro
Launched a fresh
kimiin tmux (rules loaded at session start per docs; status bar confirmed "Ask When Needed"). Prompt:Result
The tool executed. No approval prompt, no rejection.
Wire timeline for the turn (
~/.kimi-code/sessions/<workdir>/session_<id>/agents/main/wire.jsonl, filtered to the interesting rows):Zero permission-check events between
tool.callandtool.result. Full event-kind census for the turn contains exactly one permission event — the initialpermission.set_mode → yoloat row 3 — and no rule-evaluation record of any kind. Consistent with the "rules never made it into the session" reading you and others have traced: the policy chain is being skipped, not just mismatching.Also reproduced in
automode: the same probe underkimi -p "..."produces the same outcome. Note this session auto-transitions fromyolotoautoearly in the turn (per #2099), so it's an auto-mode datapoint, not yolo-via--p.Not tested:
manualmode (would need a human at the approval prompt to distinguish "deny fires before prompt" from "prompt appears" cleanly).Adds vs the existing #3820 evidence: #3820's deny evidence is a
git pushrefusal that came from an external hook — the native deny path was inferred as dead from the absence of a rule-side refusal. This adds an isolated Bash probe on a hook-free command (echo) with a rule at position 1 that exactly matches, plus the wire showing no permission events fired. Same conclusion, tighter isolation.Happy to share the full wire.jsonl on request.