Skip to content

feat(server): add Kilo Code provider over ACP - #8027

Open
amanthanvi wants to merge 8 commits into
pingdotgg:mainfrom
amanthanvi:t3code/add-kilo-provider
Open

feat(server): add Kilo Code provider over ACP#8027
amanthanvi wants to merge 8 commits into
pingdotgg:mainfrom
amanthanvi:t3code/add-kilo-provider

Conversation

@amanthanvi

@amanthanvi amanthanvi commented Aug 23, 2026

Copy link
Copy Markdown

What Changed

Adds Kilo Code as a sixth built-in, Early Access provider over the official kilo acp transport.

  • registers Kilo across contracts, provider instances, server orchestration, diagnostics, web/desktop, mobile, marketing, and docs
  • discovers the authoritative model catalog with a hardened kilo models probe and resolves the provider default from live ACP state
  • requires Kilo CLI 7.4.23 or newer and keeps the provider disabled by default
  • maps T3 permission modes to generated Kilo policies, with exact per-tool session approval fingerprints and project/plugin isolation outside Full access
  • bounds readiness, initial model/mode configuration, cancellation, settlement, and subprocess cleanup; cancellation uncertainty quarantines the exact session instead of allowing overlapping work
  • makes permission registration atomic with turn interruption so stale approvals cannot open after cancellation
  • keeps Kilo interactive-only: background title/branch/commit/change-request generation filters it out and fails closed when no capable enabled provider exists
  • preserves provider/model identity while mobile catalogs are loading and revalidates queued work before reconnect dispatch
  • uses Kilo's official vector icon

Known product boundaries are explicit: provider-side rollback and structured questions are unavailable; non-Full-access sessions disable project Kilo config/plugins; automatic text generation is unsupported.

Why

Kilo users can run their existing CLI subscription through T3 Code's local, remote, relay, and tunnel architecture without introducing a separate orchestration path. Provider-specific behavior stays at the ACP adapter boundary, while the shared orchestration and clients expose only behavior Kilo 7.4.23 can uphold.

Official references: Kilo CLI guide, Kilo CLI reference, Kilo 7.4.23.

UI Changes

Adds the official Kilo icon, provider settings/model states, Early Access presentation, and mobile catalog-readiness states. Before/after web evidence and the mobile verification note are attached to the PR. No motion or timing behavior was added.

Validation

  • final relevant suite: 17 passed / 1 opt-in live-probe skipped files; 329 passed / 6 skipped tests
  • final interruption-safety batch: 71/71 direct lifecycle/registry tests; expanded Kilo/ACP/registry suite 107 passed / 6 opt-in live tests skipped
  • deterministic regressions close eight ownership windows: interrupt settlement, stop cleanup, prompt claim/finalizer handoff, preparation rollback ordering, ACP fork/registration cleanup, startup context rollback, atomic startup publication, and structured failure diagnostics
  • final stop-drain regressions: full Kilo adapter suite 48/48 passed; interruption and never-acknowledged barrier cases passed 10/10 across five repeats, with cleanup completing before caller interruption is restored
  • final notification-quiescence suite: full Kilo adapter 50/50 and broad focused suite 111 passed / 6 opt-in live skipped; five critical stop tests passed 25/25 across repeats, covering successful post-barrier and timeout late-output schedules
  • final settings-state suite: 3 files and 64/64 tests passed; enable/disable probe lag, unavailable shadows, same-ID driver replacement, and General/Source Control fallback agreement are covered
  • deterministic regressions cover startup configuration deadline/stopAll, cancellation quarantine/no overlap, interrupted permission registration, notification-barrier recovery, stale-turn interrupt revalidation, and empty-catalog provider identity
  • Grok cancellation regressions: 3/3 passed; final shared-runtime selection 2/2 passed. Cursor cancellation regressions: 2/2 passed; final shared-runtime selection 2/2 passed
  • server, web, and marketing typechecks; marketing reported 0 errors, 0 warnings, and 0 hints
  • changed-file formatting, deny-warnings lint, and git diff --check
  • isolated Kilo 7.4.23 ACP proof: 6/6, including concurrent startup and a real streamed prompt through kilo/openrouter/free
  • integrated provider settings verification on web/desktop and provider/model verification in the iOS Simulator
  • independent GPT-5.6 Sol adversarial review of the exact final six-file diff: GO, no P1/P2 blocker
  • independent GPT-5.6 Sol and GPT-5.6 Luna Extra High review of the final stop-drain diff: GO, no P1/P2 blocker

Kilo's upstream first-run database migration can still collide when separate T3 processes initialize the same never-migrated Kilo data directory at exactly the same time. T3 bounds startup, retries typed initialization failures, cleans up every failed child, and fails closed; a transparent cross-process fix requires an upstream migration change or reliable cross-platform advisory locking.

Checklist

  • This PR is small and focused — it is one provider concern, but the required server/web/mobile/docs surface exceeds the repository's small-PR guidance
  • I explained what changed and why
  • I included before/after evidence for the UI changes
  • Video is not applicable; no animation or motion behavior changed

Implemented and reviewed with GPT-5.6 Sol and GPT-5.6 Luna in T3 Code through the Codex harness.


Note

High Risk
Touches provider orchestration, ACP session lifecycle/cancellation, permission auto-approval, and client dispatch/outbox paths. Bugs here can leak tools, drop work, or send prompts on stale models.

Overview
Adds Kilo Code as a sixth built-in, disabled-by-default provider over the official kilo acp transport (CLI 7.4.23+). Users keep their existing Kilo subscription; T3 discovers models via kilo models and maps T3 runtime modes onto generated Kilo policies.

The adapter is interactive-only: it opts out of automatic text generation (titles, git, change requests). Non–full-access sessions isolate project config/plugins. Rollback and structured questions are unsupported. Cancellation, startup, and stop paths are bounded; uncertain cancel quarantines the session instead of overlapping work. Permission identities are exact per-tool, and registration is atomic with interrupt so stale approvals cannot land after cancel.

Clients keep Kilo routing while the catalog is still loading, show “Checking models…”, and block send/outbox drain until a ready nonempty catalog exists. Stale Kilo model slugs heal to the live default rather than synthesizing ghost rows. Marketing, docs, and icons list Kilo alongside the other harnesses.

Reviewed by Cursor Bugbot for commit d07eefd. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Kilo Code provider over ACP and exclude from text generation

  • Adds new built-in driver kilo with a full ACP adapter in KiloAdapter.ts to spawn and manage Kilo CLI sessions.
  • Adds supportsTextGeneration to the ServerProvider schema and marks kilo as false, excluding it from background text generation like title generation.
  • Updates model selection resolution in serverSettings.ts and client logic to block dispatch until the Kilo catalog is ready and heals stale Kilo model selections to the live default.
  • Rewrites AcpSessionRuntime.prompt and cancel in AcpSessionRuntime.ts to handle concurrent cancellation safely and support configurable transport/settlement timeouts.
  • Risk: ProviderInstance.textGeneration type changed to allow null; out-of-tree code assuming non-null will break for kilo instances. resolveTextGenerationProvider fallback logic was replaced by resolveTextGenerationModelSelection.

Macroscope summarized d07eefd.

Kilo Code (the @kilocode/cli binary, `kilo acp`) speaks Agent Client
Protocol v1 over stdio with load/resume sessions and a config-option
model catalog. This wires it in as a built-in driver alongside the
Cursor and Grok ACP drivers: driver + adapter + status probe +
text generation on the shared ACP runtime, contracts settings,
web/mobile presentation, docs, and mock-agent test coverage including
an env-gated probe against a real install.
Copilot AI lite review requested due to automatic review settings August 23, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 80cb83c2-91dd-4f60-815d-14a797be73e2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 23, 2026
Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts Outdated
Comment thread apps/server/src/provider/Drivers/KiloDriver.ts Outdated
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One UI finding on the web changes: the new NO_PROVIDER_MODEL_SELECTION fallback in resolveAppModelSelectionState also fires while the provider snapshot is still empty, which makes the two settings model pickers render an empty, unlabeled trigger and lets the source-control writer switch persist a non-routable instance id. Everything else (Kilo icon wiring, provider driver metadata, supportsCustomModels gating in ProviderModelsSection, capability filtering in the pickers) is consistent with the existing primitives and call-site conventions.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/modelSelection.ts
@macroscopeapp

macroscopeapp Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a full Kilo ACP provider and cross-cutting changes to shared ACP lifecycle handling, permission policies, model/catalog dispatch, and web/mobile settings. The new production behavior and security-sensitive integration span server and clients, so human review is warranted.

You can add or adjust custom eligibility rules. Learn more.

@amanthanvi

Copy link
Copy Markdown
Author

UI evidence

Before — provider settings:

Provider settings before Kilo Code

After — Kilo Code provider settings on web/desktop:

Kilo Code provider settings on web

The same provider/model flow was also verified in the iOS Simulator. No motion or timing behavior changed.

Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated
Comment thread apps/web/src/providerInstances.ts Outdated
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed web UI surfaces (provider icon, provider settings sections, text-generation rows, model-selection helpers). One consistency issue: the new provider placeholder controls don't match the geometry of the picker triggers they stand in for.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SourceControlWritingSettings.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/marketing/src/pages/index.astro
Comment thread apps/server/src/provider/acp/AcpSessionRuntime.ts

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed web UI surfaces (provider icon registry, provider settings cards/model sections, text-generation controls, and model-selection helpers). One consistency finding: the new placeholder buttons hand-copy ComposerControl's geometry instead of using that primitive.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SourceControlWritingSettings.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effect service conventions review of the new Kilo provider modules. Structure (subpath namespace imports, Context.Service usage in AcpSessionRuntime, make/layer shapes, dependency acquisition via yield*, no ManagedRuntime/runPromise in domain code) looks consistent with the conventions. Two error-construction spots derive the wrapper message from cause.message instead of from stable structural attributes.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/provider/Drivers/KiloDriver.ts Outdated
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts Outdated
Comment thread apps/server/src/provider/Drivers/KiloDriver.ts
Comment thread apps/server/src/provider/Layers/KiloAdapter.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ac606f7. Configure here.

Comment thread apps/server/src/provider/Layers/KiloAdapter.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants