Repository navigation
Add lcode acp: lcode inside editors over the Agent Client Protocol - #83
Merged
Merged
Conversation
lcode acp speaks ACP version 1 over stdio, so Zed, JetBrains IDEs, Neovim, Emacs and other ACP editors can run lcode as their agent. The model's text and thinking stream as message chunks; tool calls carry their kind, files and whole-file diffs; permission questions and plan approvals use the editor's dialog; lcode's permission modes are the session's modes; the todo list is the editor's plan; saved sessions load with their conversation replayed. Files are read from and written through the editor's buffers when it supports that, and MCP servers the editor passes join lcode's own. /review and your own commands are offered as commands. Cancelling now also ends a request whose answer was cut off mid-stream. Closes #49 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks
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.
Closes #49.
What
lcode acpruns lcode as the agent inside an editor, over the Agent Client Protocol, version 1 (the stable one).printgoes to stderr, and stdin is replaced so nothing can wait for typed input.agent_message_chunk/agent_thought_chunk.tool_call→in_progress→completed/failed, with a kind (read, search, edit, execute, fetch, …), the files touched, and a whole-file diff for edits.session/request_permission(allow once, always allow for this session, reject).current_mode_updatefollows when it switches the mode.planupdates, andusage_updateandsession_info_updatefollow each request.session/loadreplays a saved lcode session./reviewand the user's own commands go inavailable_commands_update.fs.readTextFile/writeTextFile, the model reads what's in the editor (unsaved changes included), and edits go through the editor. The file on disk is kept in step for checkpoints.resource_linkand embeddedresource(inlined), and images (saved and attached, so lcode's vision handles them).on_delta(streamed text and thinking),current_call,plan_review(an editor approves plans), andToolbox.reader/writer.Permissions.approvemay now return a message, and gets the permission key.agent_serverswith"type": "custom"), JetBrains (~/.jetbrains/acp.json), other ACP clients, what maps to what, and settings.Tests
tests/test_acp.py(8 tests), with a pipe-connected editor stand-in and a scripted model. It covers:/reviewin prompts;agent-client-protocol0.12.1) as the client, which validates every message against its models, and Qwen3.6 35B through Ollama:allow_once/allow_always/reject_once) with whole-file diffs, and both edits went throughfs/write_text_file.calc.pyand quoted a line that existed only in the editor's buffer.current_mode_update), and the todo list arrived asplanupdates.session/cancelduring a request returnedstopReason: cancelled.session/loadin a new connection replayed the conversation.🤖 Generated with Claude Code