Skip to content

Restore Kilo Code native session list and import - #296

Merged
henrychu04 merged 3 commits into
coder-onlyfrom
t3/kilo-native-sessions-restore
Oct 31, 2026
Merged

henrychu04 merged 3 commits into
coder-onlyfrom
t3/kilo-native-sessions-restore

Conversation

@henrychu04

Copy link
Copy Markdown
Owner

Restores the Native sessions part of upstream's AcpSessionManagementSection for the Kilo Code instance: list Kilo Code's saved sessions for a project and import one as a T3 thread. Upstream base 80a2351.

Feasibility: kilo acp session support

Source: Kilo Code Kilo-Org/kilocode main (latest release v7.8.18, 2026-10-26), packages/opencode/src/acp/service.ts (last changed in 3a10be340d). Its initialize response advertises:

agentCapabilities: {
  loadSession: true,
  sessionCapabilities: { close: {}, fork: {}, list: {}, resume: {} },
  ...
}

The same file implements listSessions (session/list, filtered by cwd, cursor-paged at 100), loadSession (session/load, which replays history) and resumeSession. It has no session/delete and advertises no sessionCapabilities.delete.

Upstream operation ACP method Kilo Code Carried
List session/list yes yes
Import (load/resume) session/load / session/resume yes yes
Delete session/delete no cut

The fork already carried the protocol side (effect-acp session/list/session/delete, AcpSessionRuntime.listSessions, and the probe's canList/canLoad/canResume/canDelete); only the management path above it was cut.

Carried 1:1 from upstream

  • contracts/rpc.ts: server.listAcpRegistrySessions and server.importAcpRegistrySession (also added to CoderWsRpcGroup).
  • client-runtime state/server.ts: listAcpRegistrySessions and importAcpRegistrySession commands.
  • ws.ts: acpRegistryProject, acpSessionManager, importedAcpThreadId, and the list and import handlers.
  • provider-acp-registry probe.ts: makeAcpRegistryManagementRuntime, managementFailure, listAcpRegistrySessions.
  • provider-acp-registry driver.ts: nativeSessions in the snapshot and acpSessionManagement.listSessions.
  • AcpRegistryRuntimeCoordinator.withSessionMutation.
  • ProviderRegistry.ts: returns to upstream's nativeSessions !== undefined completed-probe check. The fork's model-based workaround is gone because the driver reports nativeSessions again.
  • Web: the Native sessions row of AcpSessionManagementSection.tsx, its mount in ProviderInstanceCard, and acpProjects from ProviderSettingsPanel.
  • Tests: the coordinator's session-mutation test, the probe's session-list test against acp-mock-agent.ts (logout part cut), the driver.test.ts nativeSessions assertion, and the browser test's import-scope case.

Cuts (Coder: markers, listed in docs/internals/coder-only.md)

  • Session delete: Kilo Code has no session/delete, so carrying it would be dormant. Cut: the RPC, handler, probe request, deleteSession in provider-core's acpSessionManagement, and the Delete button.
  • Logout and agent provider configuration (list/set/disable providers, write-only headers): account and provider management. provider-core's acpSessionManagement keeps only listSessions, and the snapshot reports no configurableProviders.
  • The session manager offers no URL elicitation and picks no auth method (no agent sign-in, as in the fork's probe).
  • ws.ts's import launches without upstream's startup command queue (workspace startup completes before the RPC layer is built).
  • coderServer.ts provides AcpRegistryRuntimeCoordinator.layer alone. Upstream provides it through AcpRegistrySupport.layerFromHost, but providing that with ProviderHostLive at this layer position hung helper startup.
  • The browser test drops the deletion, provider-edit, and logout cases.

docs/user/providers-kilo.md gains a Native sessions section adapted from upstream's providers-acp.md.

Upstream sync note

None of the carried files change between 80a2351 and 15fe283 (checked with git diff 80a2351fcb 15fe283272). The ACP commits pingdotgg#21323/pingdotgg#24024/pingdotgg#24479/pingdotgg#23834 in that sync touch only provider-acp/effect-acp runtime files. This branch already merges current coder-only (#293 @-mention, #294 attachment toolkit); the only overlap was coder-only.md, which merged cleanly.

Verification

  • All typechecks in AGENTS.md.
  • pnpm test:server: 3560 passed. 2 failed, both macOS /var symlink issues (ClaudeSkills ClaudeSkills plugin-order test fails on macOS (/var symlink) #235 and GitVcsDriverCore worktree path), pre-existing and unrelated.
  • pnpm test:providers: all pass.
  • pnpm test:web:coder: 10 timeouts across 8 files under full-suite load (Tests that flake under full-suite load #236 class). Rerun alone: 8/8 files, 173/173 tests pass.
  • pnpm test:knip, node scripts/seams-check.mjs, and vp fmt --check on changed files pass; pnpm build and the helper/gateway/coder-cli node --test suites (119) pass.
  • Scratch smoke (not committed): the local helper over stdio NDJSON RPC with a fake kilo acp advertising v7.8.18's capabilities:
    • The snapshot reports nativeSessions {canList, canLoad, canResume: true, canDelete: false}.
    • List returns both sessions with importedThreadId: null.
    • Import creates thread:provider:acpRegistry:…:native-thread:ses_kilo_native_1; re-import returns the same thread with imported: false, and the list then marks it imported.
    • server.deleteAcpRegistrySession is not served.
    • A message to the imported thread runs over session/load on the native Kilo session id.
  • Not run: the live Coder harness (the parent runs it), a real Kilo CLI, and a manual browser check of the settings row.

🤖 Generated with Claude Code

henrychu04 and others added 3 commits October 31, 2026 15:41
Carry upstream's ACP native session list and import (AcpSessionManagementSection's
"Native sessions" row, server.listAcpRegistrySessions and
server.importAcpRegistrySession, the driver's acpSessionManagement.listSessions,
the probe's session manager, and the coordinator's session mutation permit) for the
Kilo Code instance. Kilo Code advertises session/list, session/load, and resume but
no session/delete, so deletion stays cut with logout and agent provider configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	apps/server/src/coderServer.ts
@henrychu04

Copy link
Copy Markdown
Owner Author

Merged coder-only (#295) into this branch; the only conflict was coderServer.ts, where both the port scanner layer and the ACP runtime coordinator are now provided. Live check on the local Coder harness with a fake kilo acp advertising v7.8.18's capabilities (list/load/resume, no delete), driven through the gateway: the Kilo snapshot reports canList/canLoad/canResume true and canDelete false; listing returned both sessions; import created a thread and re-import returned the same thread; a message sent to the imported thread ran on the original Kilo session. (A first attempt failed only because my fake binary lacked its exec bit, which cached an error snapshot until server.refreshProviders.) Merged tree: test:server (only the known #235 macOS pair), test:providers, node tests (121), helper/server typechecks, knip, seams-check, fmt and build pass.

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