Repository navigation
fix(bin): improve Kimi spawn readiness diagnostics and Python selection - #51
Merged
Merged
Conversation
Kimi 2.4.0 renders the same trust dialog the 2.3.1 recognition already accepts, including below a wrapped treehouse shell preamble, so a current code root seats it on tmux end to end. A readiness refusal now writes data/<id>/kimi-readiness-refusal.txt with the Kimi version, poll counts, each missing dialog element, and the last visible capture, because the failed spawn closes its pane, and the incomplete-dialog detail names the missing elements. The turn-end hook installer no longer assumes python3 has tomllib. It searches PATH, Homebrew prefixes, and uv-managed CPython in a fixed order, runs on the first interpreter that imports tomllib, and otherwise refuses before any config write, naming every searched interpreter. Tests pin the 2.4.0 capture below its preamble, the refusal record, and the interpreter search order and refusal. Dated live evidence of a real Kimi 2.4.0 spawn through tmux is in docs/verification/runtime-backends.md.
…ication references
Pibomeister
force-pushed
the
fm/fm-kimi-spawn-readiness-fix
branch
from
November 1, 2026 13:28
70cacbe to
5b9ff70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Address the failures faced overnight launching Kimi workers: a Kimi spawn on the tmux backend into a real project worktree refused with "trust dialog text stayed on screen without the complete dialog" even though the final pane shows the complete Kimi 2.4.0 trust dialog, and a Herdr attempt refused earlier because the Kimi turn-end hook installer needs Python tomllib, which the default python3 on this Mac (3.9.6) does not have. Kimi seating must work again end to end, or refuse before launch with a precise, actionable reason.
What Changed
tomllibfrom PATH, Homebrew, or uv for Kimi hook installation and removal; report searched candidates and installation guidance when none qualifies.Risk Assessment
✅ Low: The changes are bounded to interpreter discovery and readiness diagnostics, preserve existing consent checks, and introduce no substantiated material defects.
Testing
The targeted harness suite and five live checks passed, including a reproduced Python regression and real terminal refusal evidence. Full completion remains untested under credential and Herdr isolation limits. Terminal captures document these CLI changes; no GUI layout changed. Disposable labs were removed.
Evidence: Validation details and limitations
Source: Validation details and limitations
Evidence: Real Python fallback and actionable refusal
Source: Real Python fallback and actionable refusal
Evidence: Base fails; target succeeds
Source: Base fails; target succeeds
Evidence: Real Kimi trust dialog below shell preamble
Source: Real Kimi trust dialog below shell preamble
Evidence: Collapsed-dialog refusal with saved viewport
Source: Collapsed-dialog refusal with saved viewport
Evidence: Project MCP refusal with zero trust submissions
Source: Project MCP refusal with zero trust submissions
Evidence: Disposable Kimi home reports missing model
Source: Disposable Kimi home reports missing model
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
bin/fm-kimi-turnend-hook.sh:83- Simplification: the uncertified previous-run code adds a newest-version policy for uv Python, including version parsing, ranking arrays, and selection sorting. The intent requires an interpreter with tomllib; it does not require the newest interpreter. Remove this ranking and try compatible candidates in deterministic discovery order. Related sites: bin/fm-kimi-turnend-hook.sh:22 documents the policy; tests/fm-kimi-harness.test.sh:716–720 locks it into assertions.bin/fm-kimi-turnend-hook.sh:134- Simplification: FM_KIMI_PYTHON_PREFIXES adds an operator-facing configuration option beyond the requested launch repair. Its only repository caller is the test helper. Remove the production override; retain a test-only seam if needed to isolate Homebrew discovery. Related sites: bin/fm-kimi-turnend-hook.sh:20 documents the option; tests/fm-kimi-harness.test.sh:700 supplies it.🔧 Fix applied.
✅ Re-checked - no issues remain.
bash tests/fm-kimi-harness.test.sh: baseline stopped at the system Python 3.9 tomllib prerequisite.Prepared workspace-local Python 3.12.12; reran the scoped suite, then stopped it to run only change-specific selectors.Ran five existing selectors for interpreter selection/refusal, Kimi 2.4.0 trust, unknown-option diagnostics, and viewport-read failure; all exited successfully.bash .kimi-validation/python-regression.sh: base installer failed and target installer succeeded in the same environment.bash .kimi-validation/check-installer.sh: real fallback installation, idempotency, removal, and malformed-config preservation.bash .kimi-validation/live-tmux.sh,live-clipped.sh, andlive-herdr.sh: isolated real-product launch and refusal checks.Captured terminal viewports and rendered an HTML evidence viewer; Chrome screenshot attempt failed with BRIDGE_NOT_READY after 30 seconds.Tore down both Herdr labs, the private tmux server, browser session, and workspace fixtures; confirmed unchanged target revision and clean worktree.Live validation:⚠️ inconclusive - 5 of 7 scenarios driven live against the product
PATH="~/.local/share/uv/python/cpython-3.12.12-macos-aarch64-none/bin:$PATH" TMPDIR="$PWD/.test-kimi-lab" bash tests/fm-kimi-harness.test.sh— exited 0./bin/bash ~/.no-mistakes/evidence/01M649GT90YA0AQX8YHNA4K4BZ/live-kimi.sh— real installer roundtrip, missing-interpreter refusal, and isolated tmux spawn./usr/bin/python3 ~/.no-mistakes/evidence/01M649GT90YA0AQX8YHNA4K4BZ/live-tui.py— captured real trust and MCP viewport transitions.LIVE_KIMI_ONLY=short LIVE_KIMI_RUN=short-v3 /usr/bin/python3 ~/.no-mistakes/evidence/01M649GT90YA0AQX8YHNA4K4BZ/live-tui.py— verified the actual 80×7 pane and saved refusal.Executed base and target hook installers against the same isolated config with actual Python interpreters; base refused, target installed and removed successfully.bin/fm-herdr-lab.sh prepare fm-lab-kimi-private-01with isolated HOME and local configuration — refused at the required default-session tripwire.Asserted generated trust records, MCP non-execution, pane dimensions, saved refusals, and missing-model output; stopped private tmux servers, removed disposable labs, and confirmed a clean worktree.✅ **Document** - passed
✅ No issues found.
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.