refactor(cli): remove provably unused kilocode code - #12599
Conversation
Delete code with zero references anywhere in the monorepo (including tests, docs, scripts, and dynamic import or string-based usage): - background-process/windows-job.ts: entire Windows Job Object FFI module left unreferenced after the background process runner refactor - session/prompt.ts: createShellDecoders helper, CODE_SWITCH_TEXT alias, and the now-unused StringDecoder import - text-stream.ts: openUtf8 wrapper - cli/cmd/tui/component/prompt/vim.ts: enterInsert helper - config/config.ts: KILO_CONFIG_FILES, AGENT_PATTERNS, COMMAND_PATTERNS - remote-attachments.ts: TEXT_PLAIN constant - plan-followup.ts: PLAN_PREFIX constant - server/httpapi/groups/background-process.ts: SessionParams schema - server/httpapi/groups/session-import.ts: SessionImportPayloads map - cloud/contracts.ts: RepositoryInput type alias
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review since the last pass: the only new changes are in the HttpApi exerciser test harness ( Files Reviewed (5 files)
Previous Review Summary (commit 526572c)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 526572c)Status: No Issues Found | Recommendation: Merge Verified each removed symbol ( Files Reviewed (10 files)
Reviewed by claude-sonnet-5 · Input: 32 · Output: 7.3K · Cached: 835.4K Review guidance: REVIEW.md from base branch |
The auth mode probes every protected route with valid credentials to prove the route accepts them. Two routes intentionally block after a valid request: tui.control.next waits for queued TUI input, and instance.reload can outlive the one second probe. The probe won by timeout, marked the scenario passed, and left the request alive inside the cached web handler. Final disposeApps() then waited for those requests forever, so any run that rebuilt the app (cold turbo cache) never exited and CI cancelled the job at 15 minutes. Add a scenario flag that keeps the missing-credentials check (the route must still return 401) but skips the valid-credential probe for routes whose valid requests intentionally block, and mark tui.control.next and instance.reload with it.
refactor(cli): remove provably unused kilocode code
The CLI accumulates helpers that lose their last caller as features get refactored, and there is no package-level tooling that catches them in kilocode-owned modules. This PR removes 149 lines of dead code found by a one-off audit.
Everything deleted was verified unreachable before removal: each symbol and file has zero references across the whole monorepo, including packages/tui (which imports kilocode TUI mirrors via the @/ alias), tests, docs, scripts, CI, dynamic imports, and string-based lookups, plus no usage inside its own file. In-file consumers and namespace-internal members were checked separately so legitimately exported API stays intact.
What went away:
No behavior change: only declarations with no reachable caller were removed, all in Kilo-owned paths so upstream merges are unaffected.
This PR also fixes a latent HttpApi exerciser hang that CI cache hits on main were masking. Any branch that invalidates the turbo cache exposes it: auth mode probes every protected route with valid credentials, and two routes (tui.control.next, instance.reload) intentionally block after a valid request. The timed-out probe request stayed alive inside the cached web handler, so the final disposeApps() waited forever and the job was cancelled at the 15 minute timeout. Blocking routes now opt out of the valid-credential probe while still proving they return 401 without credentials.