Skip to content

chore: switch external model harness from Kilo to pi - #18

Open
kulvirgit wants to merge 1 commit into
mainfrom
chore/swap-kilo-to-pi
Open

chore: switch external model harness from Kilo to pi#18
kulvirgit wants to merge 1 commit into
mainfrom
chore/swap-kilo-to-pi

Conversation

@kulvirgit

Copy link
Copy Markdown
Collaborator

What

Switches the consensus panel's external-model harness from Kilo (kilo run) to the pi coding agent across the whole plugin.

Before After
kilo run -m openrouter/<id> --auto pi --provider openrouter --model <id> -p
  • Configs (consensus.config.json, consensus.codex.config.json): every OpenRouter model command → pi form. resume_flag stays -c (pi's --continue). Native codex/agy/qwen entries unchanged; they already run through the command templates' native branches.
  • Setup + command templates (consensus-setup.md, code-review.md, review.md, plan-review.md + reference copies): CLI detection, provider prompts, harness tables, preflight, and the default CLI branch now reference pi (command -v pi). pi commands run via the existing default ("Otherwise") branch — no new branch logic needed.
  • Stale-id fixes (verified against pi's live OpenRouter catalog — these no longer resolve): openai/gpt-5.4-codexopenai/gpt-5.3-codex, x-ai/grok-4.20-betax-ai/grok-4.3, xiaomi/mimo-v2-proxiaomi/mimo-v2.5-pro (display names aligned).
  • Plugin metadata + CHANGELOG → 1.8.0.

Why

The Kilo --auto agentic run was hanging indefinitely on heavy code-review prompts (trivial prompts returned fine); pi runs the same reviews cleanly. pi also natively supports OpenRouter and custom providers (Azure OpenAI via a ~/.pi/agent/extensions/ provider extension).

Verification

  • All 9 default model ids checked against pi --list-models (openrouter). 8 valid as-is; the 3 above were invalid and remapped.
  • Live pi --provider openrouter --model openai/gpt-5.3-codex -p hello probe returned OK.
  • Both config JSONs validated; no kilo references remain anywhere in the repo.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JaLH3xYUKVDipzLQC76Kis

@kulvirgit
kulvirgit force-pushed the chore/swap-kilo-to-pi branch from 6074afa to 647f259 Compare July 21, 2026 19:36
@kulvirgit
kulvirgit marked this pull request as ready for review July 21, 2026 21:18
@kilo-code-bot

kilo-code-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Suggestion Found | Recommendation: Merge (non-blocking)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
plugins/consensus/commands/consensus-setup.md 211 Config-generation template still writes "version": "1.7.0". The plugin metadata, both default configs, and the marketplace entry were all bumped to 1.8.0 in this PR, but the two templates that write consensus.json during setup were missed. Same staleness at plugins/consensus/skills/consensus-setup/references/command.md:97. Freshly generated user configs will carry the old version. Metadata-only — no functional impact on config loading (only models and min_quorum are read at runtime).
Review Notes
  • kilo to pi swap is complete. No stray kilo references remain in functional code; the only surviving mentions are historical CHANGELOG.md entries (1.7.0 and earlier), which are correct to preserve.
  • Stale model-id remaps are consistent across README, both configs, and both setup flows: openai/gpt-5.4-codex to openai/gpt-5.3-codex, x-ai/grok-4.20-beta to x-ai/grok-4.3, xiaomi/mimo-v2-pro to xiaomi/mimo-v2.5-pro.
  • All JSON files validate (both configs, both plugin manifests, marketplace).
  • Command shape is uniform across review.md, code-review.md, plan-review.md, and both reference files: initial pi ... -p --session-dir "$SESSION_DIR/pi-{MODEL_ID}" "<prompt>"; convergence pi ... -p -c --session-dir "$SESSION_DIR/pi-{MODEL_ID}" "<prompt>". The per-panelist --session-dir correctly isolates parallel runs so pi's cwd-based -c/--continue resume cannot cross-wire panelists.
  • Detection is well-scoped: matching pi (trailing space) avoids false positives on pip/pixi.
  • The version-template suggestion above is summary-only because lines 211 and 97 fall outside this PR's diff hunks (no inline anchor available).
Files Reviewed (13 files)
  • .claude-plugin/marketplace.json
  • CHANGELOG.md
  • README.md
  • plugins/consensus/.claude-plugin/plugin.json
  • plugins/consensus/.codex-plugin/plugin.json
  • plugins/consensus/commands/code-review.md
  • plugins/consensus/commands/consensus-setup.md - 1 suggestion (version template)
  • plugins/consensus/commands/plan-review.md
  • plugins/consensus/commands/review.md
  • plugins/consensus/consensus.codex.config.json
  • plugins/consensus/consensus.config.json
  • plugins/consensus/skills/consensus-plan-review/references/command.md
  • plugins/consensus/skills/consensus-setup/references/command.md - same version-template staleness

Fix this issue in Kilo Cloud


Reviewed by glm-5.2 · Input: 69.4K · Output: 23.9K · Cached: 764.6K

@kulvirgit
kulvirgit force-pushed the chore/swap-kilo-to-pi branch from 647f259 to ab3af1e Compare July 24, 2026 21:40
Also fix how the panel tracks a running pi model, drop CodeRabbit, and stop
gating non-OpenRouter pi models on an OpenRouter key.

**Tracking.** `pi` buffers ALL output until the process exits — verified for
`--mode text`, `--mode json` and `--mode rpc`, and the session file is not
created until completion either, so there is no incremental channel to watch.
The polling protocol treated output-file growth as the health signal and
declared a model "stuck" after 10 minutes of no growth. Since the file sits at
0 bytes for the entire run, that rule fires on healthy reviews: a genuine 40+
minute review is indistinguishable from a hung one and gets abandoned.

Track the process instead:

- Launch each model in a subshell that records a pid file and, on completion,
  an exit sentinel (`{model}.exit`).
- Poll `kill -0 $(cat {model}.pid)` for liveness. ALIVE means working,
  regardless of output size.
- Treat a model as failed only when the process is GONE **and** the sentinel is
  non-zero or the output is empty. GONE + exit 0 + non-empty output is a
  success awaiting its SendMessage.
- Call out explicitly that file size must not be used as a health signal, so
  the heuristic does not get reintroduced.

Verified with a real pi run: ALIVE at 0 bytes for 32s+, then GONE with exit=0
and non-empty output, correctly classified as success. This also caught a real
failure — a review that died silently and produced nothing was previously
indistinguishable from one still working.

**Preflight.** The check required `OPENROUTER_API_KEY` for every command
starting with `pi `, but a model configured as `pi --provider altimate-azure`
does not use OpenRouter at all. A missing OpenRouter key would therefore skip a
perfectly working model and then abort on quorum, while never validating the
credential that model actually needs. The required credential is now derived
from each model's own `--provider`.

**CodeRabbit removed.** Its invocation used `coderabbit review --plain`, and the
CLI has since removed `--plain` (plain text is the default). Combined with the
"if it fails, continue without it" fallback, CodeRabbit was silently skipped on
every run. Rather than carry a supplementary reviewer that quietly does nothing,
drop it: availability check, invocation, collection/reporting lines, comparison
table column, attribution footer, the skill-reference section, and the plugin
keywords.
@kulvirgit
kulvirgit force-pushed the chore/swap-kilo-to-pi branch from ab3af1e to b442e03 Compare July 24, 2026 22:13
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