fix(acp): replay history on session load#2
Closed
huntharo wants to merge 1 commit into
Closed
Conversation
5e25b1d to
f86a8d4
Compare
f86a8d4 to
bea352f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR builds on MoonshotAI#2359 and includes both ACP fixes in one branch:
messageIdvalues to streamed content chunks after the ACP SDK bump to 0.10.0.session/loadreplay restored history, includingmessageIdfields on replayed user, assistant, and thought chunks, and expose restored session metadata.I can rebase this PR after MoonshotAI#2359 lands so it contains only the session-load replay change. Alternatively, if maintainers prefer to take both fixes together, this PR can be merged as the combined ACP fix and MoonshotAI#2359 can be closed.
Changes
LoadSessionResponsewith initial modes and models fromsession/load.sessionCapabilities._meta.kimi.sessionHistoryReplay = trueso clients do not have to infer replay behavior fromloadSessionalone.wire.jsonlrecords as ACPsession/updatenotifications on load.messageIdon restored user, assistant, and thought chunks using the message-id run tracking from fix(acp): assign message ids to streamed content MoonshotAI/kimi-cli#2359.SessionInfoUpdatetitle/updatedAt updates after prompt completion, and duringsession/load/session/resume.session/loadandsession/resumeunder_meta.kimi.session.KimiCLI.run()turns to the session wire log so future loads have a replay source.messageId, advertised replay capability, and session title metadata with tests.Validation
uv run pytest tests/acp tests/core/test_notifications.py -quv run ruff check src/kimi_cli/acp/session.py src/kimi_cli/acp/server.py src/kimi_cli/app.py tests/acp/test_protocol_v1.py tests/acp/test_session_notifications.py tests/acp/test_server_initialize.pyuv run pyright src/kimi_cli/acp/session.py src/kimi_cli/acp/server.py src/kimi_cli/app.py tests/acp/test_protocol_v1.py tests/acp/test_session_notifications.py tests/acp/test_server_initialize.pygit diff --check