Conversation
Implement ACP version management framework so the server properly negotiates protocol_version instead of echoing the client's value. Fix SDK version declaration (0.7.0 → 0.8.0) to match the actual installed package, and add 13 new tests covering both the negotiation logic and end-to-end protocol V1 consistency via the real SDK client.
Extract shared session setup logic into _setup_session and add resume_session method that returns ResumeSessionResponse with modes/models state. Advertise the resume capability in initialize.
- Fix new_session/load_session parameter order and defaults to match Agent protocol - Add fork_session stub to ACPServer and ACPServerSingleSession - Add resume_session stub to ACPServerSingleSession - Update ACPTestClient to match Client protocol signatures - Fix RequestPermissionResponse to use new outcome API
Extract _init_session from new_session/_setup_session to share session initialization logic, then implement fork_session by copying source session's context.jsonl/wire.jsonl into a new session directory. Advertise fork capability in initialize response.
|
|
||
| return acp.schema.ForkSessionResponse( | ||
| session_id=new_session.id, | ||
| modes=acp.schema.SessionModeState( | ||
| available_modes=[ | ||
| acp.schema.SessionMode( | ||
| id="default", | ||
| name="Default", | ||
| description="The default mode.", | ||
| ), | ||
| ], | ||
| current_mode_id="default", | ||
| ), | ||
| models=acp.schema.SessionModelState( | ||
| available_models=_expand_llm_models(config.models), | ||
| current_model_id=model_id_conv.to_acp_model_id(), | ||
| ), | ||
| ) |
There was a problem hiding this comment.
🟡 Forked session missing AvailableCommandsUpdate notification to ACP client
The fork_session method creates a new session (with a new session_id) but does not send the AvailableCommandsUpdate session update to the ACP client. In contrast, new_session at src/kimi_cli/acp/server.py:154-167 sends this update immediately after session creation so the client knows which slash commands are available.
Root Cause
When new_session creates a session, it builds the available commands list and fires an AvailableCommandsUpdate notification:
available_commands = [
acp.schema.AvailableCommand(name=cmd.name, description=cmd.description)
for cmd in soul_slash_registry.list_commands()
]
asyncio.create_task(
self.conn.session_update(
session_id=session.id,
update=acp.schema.AvailableCommandsUpdate(
session_update="available_commands_update",
available_commands=available_commands,
),
)
)The fork_session method at lines 242-285 creates a brand new session with a different session_id but omits this notification entirely. The ACP client (e.g., an IDE integration) will not receive the list of available slash commands for the forked session, so features like command autocomplete won't work.
The project's own src/kimi_cli/acp/AGENTS.md states: "Both send AvailableCommandsUpdate for slash commands on session creation."
Impact: Slash command discovery/autocomplete will be missing in the forked session's client UI.
| return acp.schema.ForkSessionResponse( | |
| session_id=new_session.id, | |
| modes=acp.schema.SessionModeState( | |
| available_modes=[ | |
| acp.schema.SessionMode( | |
| id="default", | |
| name="Default", | |
| description="The default mode.", | |
| ), | |
| ], | |
| current_mode_id="default", | |
| ), | |
| models=acp.schema.SessionModelState( | |
| available_models=_expand_llm_models(config.models), | |
| current_model_id=model_id_conv.to_acp_model_id(), | |
| ), | |
| ) | |
| available_commands = [ | |
| acp.schema.AvailableCommand(name=cmd.name, description=cmd.description) | |
| for cmd in soul_slash_registry.list_commands() | |
| ] | |
| asyncio.create_task( | |
| self.conn.session_update( | |
| session_id=new_session.id, | |
| update=acp.schema.AvailableCommandsUpdate( | |
| session_update="available_commands_update", | |
| available_commands=available_commands, | |
| ), | |
| ) | |
| ) | |
| return acp.schema.ForkSessionResponse( | |
| session_id=new_session.id, | |
| modes=acp.schema.SessionModeState( | |
| available_modes=[ | |
| acp.schema.SessionMode( | |
| id="default", | |
| name="Default", | |
| description="The default mode.", | |
| ), | |
| ], | |
| current_mode_id="default", | |
| ), | |
| models=acp.schema.SessionModelState( | |
| available_models=_expand_llm_models(config.models), | |
| current_model_id=model_id_conv.to_acp_model_id(), | |
| ), | |
| ) | |
Was this helpful? React with 👍 or 👎 to provide feedback.
Related Issue
N/A (internal ACP feature)
Description
Implement
session/forkfor the ACP unstable protocol:_init_sessionhelper fromnew_session/_setup_sessionto deduplicate session initialization logic (KimiCLI creation, ACPSession registration, tool replacement)fork_session: finds source session, creates a new session, copiescontext.jsonl/wire.jsonlviashutil.copy2, then initializes via_init_sessionforkinsession_capabilitiesduringinitializeChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.