fix(acp): assign message ids to streamed content#2359
Open
huntharo wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cbf01ff27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This was referenced May 24, 2026
This was referenced May 25, 2026
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.
Motivation
I've been building Kimi support for PwrAgent, which works with Codex App Server and other agents via ACP. I signed up to a Kimi paid plan to add Kimi support via ACP, but unfortunately the support is missing just a couple of little features/fixes that make it work perfectly. I have been able to work around these to a degree, but Kimi would be easier for other ACP consumers to use if these were addressed.
messageIdafter upgrading to ACP 0.10.0messageIdssession/loadsession/load/yolobut it's a toggle as I understand it, so it turns it on of offsession/set_modeto set the permission mode andcurrent_mode_updateto notify of the changeSummary
I fixed ACP streamed assistant content so each contiguous thought/message run gets a stable ACP
messageId, while separate runs get distinct UUIDs. This lets clients distinguish token chunks for one transcript item from a new assistant message after a tool boundary.This bumps
agent-client-protocolfrom 0.8.0 to 0.10.0 because 0.10.0 adds themessageIdfield toAgentMessageChunkandAgentThoughtChunk. I also updated terminal auth method construction for the 0.10.0 schema.Note that it's possible to fix this without
messageIdfields but it's much better for the agent to be declaring message boundaries than for the client to be inferring them.Verification
I verified the ACP-focused test suite and touched-file checks:
uv run pytest tests/acp tests/ui_and_conv/test_acp_convert.py tests/ui_and_conv/test_acp_server_auth.py -quv run ruff check src/kimi_cli/acp/session.py src/kimi_cli/acp/server.py tests/acp/test_session_notifications.py tests/acp/test_server_initialize.py tests/ui_and_conv/test_acp_server_auth.pyuv run ruff format --check src/kimi_cli/acp/session.py src/kimi_cli/acp/server.py tests/acp/test_session_notifications.py tests/acp/test_server_initialize.py tests/ui_and_conv/test_acp_server_auth.pyuv run pyright src/kimi_cli/acp/session.py src/kimi_cli/acp/server.pyScreenshot
Testing with
After -
messageIdAllow Distinct In-Turn Reply MessagesUse a CLI like the following to point pwrdrvr/PwrAgent#556 at the locally checked out Kimi CLI with the fix:
Before - Missing Item IDs Caused Intermediate Messages to be Overwritten