Skip to content

Feat remove phases from kimchi leaving plan - #1093

Open
tautvydasLiekis wants to merge 12 commits into
masterfrom
feat-remove-phases-from-kimchi-leaving-plan
Open

tautvydasLiekis wants to merge 12 commits into
masterfrom
feat-remove-phases-from-kimchi-leaving-plan

Conversation

@tautvydasLiekis

@tautvydasLiekis tautvydasLiekis commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What was wrong

Kimchi layered model-controlled workflow phases and legacy multi-model orchestration over ordinary sessions, planning and agents. This added global state, role/model pools, forced model selection and phase-dependent prompts/tool restrictions.

set_phase({ thinking: "medium" }) also had a cross-session side effect: Pi's thinking setter saves the effective level as the global default. A model's phase decision could therefore change High to Medium for subsequent sessions without directly editing settings.json. This PR removes that mutation path; it does not reset existing defaults or change Pi's general settings persistence.

Removed

  • set_phase, /phase, workflow-phase state and parent/child propagation, automatic phase:* tags, phase status/UI, and phase-driven thinking changes.
  • Phase-keyed prompts and the session-wide explore/research/plan/build/review workflow. These are no longer runtime phases the model must switch between.
  • Legacy multi-model mode: --multi-model, the virtual multi-model selection, /multi-model, role/model pools and metadata configuration, session/process state, and forced orchestrator model selection. Retired CLI selections now fail with guidance instead of silently enabling another mode.
  • Multi-model-only prompt/routing/judge-selection branches, the phase-specific review write guard, obsolete orchestration modules and the duplicate src/extensions/model-catalog/ tree. Ordinary permission checks remain.

Changed / added

  • Direct-first execution: main sessions use the single-model prompt path. Delegation remains available when requested; workers inherit the selected model unless explicitly configured otherwise. There is no replacement multi-model orchestrator.
  • Role guidance instead of phase state: ordinary workers receive persona/model-specific role instructions without changing the parent session's phase. Shared Working Practices replace phase-specific guidance where applicable; plain non-Ferment print mode keeps them omitted.
  • Plan-mode handoff: ExitPlanMode replaces submit_plan. The approval/execution flow retains plan persistence, seeds TODOs from approved chunks, sends a compact execution handoff and restores the pre-plan permission/tool state. Child-plan, ACP and headless paths have regression coverage.
  • Model selection: Auto remains available and is the default for fresh main sessions without an explicit launch selection. Explicit CLI/environment choices and resumed sessions are handled separately; Auto routing is not the removed role-based multi-model mode.
  • Ferment integration: V1 uses direct-first execution rather than switching between strict multi-model and relaxed single-model policies. Judge/evaluator selection uses the effective session model instead of legacy role pools. Added/updated tests cover retired inputs, prompt snapshots, planning/tool consistency and preserved execution paths.

What stays

  • Permission modes (default, plan, auto, yolo), plan-mode restrictions, approval UI, and planning guidance. Permission auto and Auto model routing are separate concepts.
  • Ordinary Agent workers/personas, explicit worker model/thinking/budget selection, user-controlled model/thinking changes, and Auto routing.
  • Ferment V1/V2, including their own persisted phases, steps, evaluation and lifecycle state. Removing workflow phases does not remove Ferment's execution model.
  • Normal request tags, model identity/telemetry, tool permissions, continuation and budget controls.

Remaining / out of scope

  • This is not removal of all dynamic behavior: Auto routing, explicit model/thinking selection and Ferment lifecycle transitions remain intentional.
  • src/extensions/agents/thinking-level-policy.ts remains unused by production callers and is a follow-up cleanup candidate.
  • Documentation cleanup was deliberately excluded. README and older benchmark/design docs still contain legacy multi-model references; they are not an accurate description of the new runtime.

The current diff against master changes 183 files, adds 3,104 lines and removes 13,770 (36 whole-file deletions). The scope is simplification plus the retained plan-mode changes, not a claim of improved benchmark score or cost.

Validation

Validated head: 4cdc6aa382dada4bd2e4e185fa47e5d5ab81ad7b, including master 716bd797c9802b20ef1da4ccde7caace26173a22.

  • pnpm run check, pnpm run build, pnpm run build:binary, and diff checks pass. Independent review found no validated merge issues.
  • Prompt/cache/lifecycle checks: 71 tests passed; independent CLI/permissions/agents/router checks: 379 passed.
  • Full source suite after the first master merge: 10,125 passed, 10 skipped, 3 DAP integration failures. All three reproduce on master with its own frozen dependencies. After the final compaction-only merge, 115 focused compaction tests, 151 Ferment/state/evaluator tests and 4 print smoke tests passed; the full suite was not rerun.
  • Full TB2.1 K3 run: normal mode, kimchi-dev/kimi-k3, 1x timeout, 89 tasks x 5 attempts, max thinking. It targets f19fd08ff7998da3b443e5f54b418b2b5fcb9663, before these master merges, so it does not validate the current head's incoming prompt-cache/compaction changes. No benchmark non-regression claim is made here.

Linked issue

No linked issue supplied yet.

Checklist

  • I have read CONTRIBUTING.md and agree to the CLA
  • This PR links to an open issue above
  • Full local test suite passes without exceptions (known master DAP failures above)
  • Lint, type checks, build and targeted regression checks pass
  • Documentation updated for removed behavior (excluded; follow-up needed)

@kimchi-review

kimchi-review Bot commented Aug 26, 2026

Copy link
Copy Markdown

Kimchi Code Review

Property Value
Commit bbcf4c5
Author @tautvydasLiekis
Files changed 0
Review status Completed
Comments 2 (2 info)
Duration 120s

Summary

📊 Review Score: 92/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 3/5 (1 = trivial, 5 = very complex)

🧪 Tests: yes — Tests were updated across status-line, agent-runner, prompts, ferment, and status-line config. A new regression test in src/extensions/agents/manager/agent-runner.test.ts verifies that subagents no longer mutate parent-session phase/tag state, and another confirms guidelines are resolved from the persona role rather than the orchestrator phase.

📝 Found 2 issue(s). See inline comments for details.

What to expect

Kimchi will analyze the changes in this pull request and post:

  • A summary of the overall changes
  • Inline comments on specific lines with findings categorized by issue type

The review typically completes within a few minutes. This comment will be updated once the review is ready.

Interact with Kimchi
  • @getkimchi review — re-trigger a full review on the latest commit
  • @getkimchi summary — regenerate the PR summary
  • @getkimchi ignore — skip this PR (no review will be posted)
  • Reply to any inline comment to ask follow-up questions or request clarification
Configuration

Reviews are configured by your organization admin.
Review instructions, excluded directories, and severity thresholds can be adjusted per repository in the Kimchi dashboard.


Powered by Kimchi — AI-powered code review by CAST AI

@kimchi-review kimchi-review Bot 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.

📊 Review Score: 92/100 (overall code quality — 0 lowest, 100 highest)
⏱️ Estimated effort to review: 3/5 (1 = trivial, 5 = very complex)

🧪 Tests: yes — Tests were updated across status-line, agent-runner, prompts, ferment, and status-line config. A new regression test in src/extensions/agents/manager/agent-runner.test.ts verifies that subagents no longer mutate parent-session phase/tag state, and another confirms guidelines are resolved from the persona role rather than the orchestrator phase.

📝 Found 2 issue(s). See inline comments for details.

Comment thread docs/expected-execution-scenarios.md
Comment thread benchmark/manual/tasks.md
@tautvydasLiekis
tautvydasLiekis marked this pull request as ready for review September 14, 2026 09:58
@readme-ai-writer

readme-ai-writer Bot commented Sep 14, 2026

Copy link
Copy Markdown

⚠️ The documentation bot was unable to process documentation updates.

You can re-trigger by converting this PR to draft, then opening for review again.

tautvydasLiekis and others added 11 commits September 17, 2026 08:44
Preserve the original permission snapshot after failed cloud startup.
Ignore nonterminal worker polls, including cached outcomes on resume.
Correct audit attribution and isolate session lookup from live APIs.
BREAKING CHANGE: use Auto or a qualified model instead of multi-model.
Fresh sessions default to Auto; explicit launch choices and resumed
sessions retain their model. Ordinary agents, plan mode, and Ferment
engines remain supported.
Keep child SDK model and thinking changes out of shared user settings.
Honor configured persona models and remove unused thinking policy and
never-implemented worktree isolation options.
Pi only renders the built-in working indicator while streaming.
Render held evaluation work through the existing widget API and preserve
it across continuation turns without weakening the E2E checks.
…guideline content

Reconciles rebase fallout: keeps the branch's ExitPlanMode plan flow and
phase-free role guidelines while preserving master's newer deprecation
handling, timeout guidance, and remote-run review menu.

Co-Authored-By: Kimchi <noreply@kimchi.dev>
@josemonteiro
josemonteiro force-pushed the feat-remove-phases-from-kimchi-leaving-plan branch from 844b4d6 to a0d745f Compare September 17, 2026 08:20
The re-surfaced master tests scripted the fake model to call submit_plan,
which the branch intentionally does not register — the tool call errored
in-session and the plan approval menu never appeared, so CI timed out
waiting for 'Execute the plan' until the 20-minute job limit. Point the
scenarios back at ExitPlanMode, matching the branch's plan flow.

Co-Authored-By: Kimchi <noreply@kimchi.dev>
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