Skip to content

CLI extension architecture allows partial integrations without session support #198

@danshapiro

Description

@danshapiro

Summary

CLI extensions can be added with a manifest, but session support still depends on handwritten provider code and a hardcoded registration list. That makes it easy to ship a provider that appears in the picker and can spawn, while sidebar discovery, session binding, history loading, and restart restore stay broken.

Current split

  • server/extension-manifest.ts lets a CLI manifest define command, env vars, and resumeArgs.
  • server/index.ts still builds codingCliProviders from [claudeProvider, codexProvider, opencodeProvider].
  • server/coding-cli/providers/ contains handwritten providers for Claude, Codex, and OpenCode only.
  • The CLI extensions refactor plan explicitly left server/coding-cli/ unchanged.

Why this is a problem

Kimi shows the failure mode:

  • It has an extension manifest and terminal mode support.
  • It does not have a session provider implementation or registration.
  • Its manifest also omits resumeArgs.
  • It can launch, but it does not appear in the sidebar from indexed sessions and does not restore cleanly after a server reset.

This is a product gap, but it is also an architectural one. The manifest system does not model session discovery or require a provider to exist before a CLI is treated as supported.

Requested change

Pick one direction and make it enforceable:

  1. Extend the extension system so a CLI extension can define session discovery, parsing, project resolution, and history loading, then derive runtime registration from that data.
  2. Keep handwritten providers, but make support status explicit:
    • A CLI should not be presented as supported unless both the spawn manifest and the session provider are registered.
    • Startup should validate that any built-in CLI extension with session claims has a matching provider.
    • Tests should cover picker visibility, sidebar indexing, session association, and restart restore for each supported CLI.

Acceptance criteria

  • No CLI can appear supported with only spawn wiring.
  • The provider registration list is not a second hidden source of truth.
  • Adding a built-in CLI without session integration fails fast in tests or startup validation.
  • Sidebar discovery and restart restore are covered for every supported CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions