OCT Agent Prototype#196
Open
jbicker wants to merge 14 commits into
Open
Conversation
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
minor changes, revert streaming Update package dependencies and implement line-based edits in agent functionality - Removed the "peer" property from zod in package-lock.json. - Added zod as a dependency in package.json for open-collaboration-agent. - Introduced applyLineEdits function in agent-util.ts to handle line-based edits. - Updated agent.ts to utilize MCP-based execution for applying line edits. - Enhanced prompt.ts with new LineEdit interface and MCP tool-based execution logic. Implement animated line edits in agent functionality - Added applyLineEditsAnimated function to agent-util.ts for progressive line edits with animation. - Updated agent.ts to utilize the new animated line edits function, ensuring edits are applied before removing trigger lines. - Enhanced prompt.ts documentation to clarify the queuing and application of edits in the correct order. Enhance cursor awareness and animation in open-collaboration-agent - Implemented a cursor awareness feature that allows the agent's cursor to be visible and move in real-time during edits, enhancing collaborative editing experience. - Updated the agent's functionality to utilize CRDT-based positioning for accurate cursor tracking and character-by-character animation during edits. - Refactored agent-util.ts to ensure cursor position updates are applied correctly during line edits. - Enhanced document-sync.ts to manage agent's cursor visibility and state in the collaborative environment. Enhance testing and synchronization features in open-collaboration-agent - Integrated Vitest for unit testing, adding test scripts and configuration for improved test management. - Updated agent-util.ts to prevent empty text replacements during document edits, ensuring better synchronization. - Enhanced CODE_ANALYSIS.md with recent fixes and testing instructions, including automated and manual testing workflows. - Added new methods for document content retrieval and peer ID management to improve collaborative editing experience. - Updated test suite to mock new IDocumentSync interface methods for comprehensive testing of agent functionality. Connecting other Agents via MCP This is a test if it is possible to connect Agents like Claude Code to a OCT Session via MCP. Enhance open-collaboration-agent with ACP integration and updates - Added support for Agent Client Protocol (ACP) mode, allowing external agent integration. - Updated agent functionality to handle bidirectional communication and event-driven architecture. - Improved documentation to reflect new ACP mode and usage instructions. - Enhanced error handling for ACP session initialization and trigger processing. - Updated package dependencies, including the addition of @agentclientprotocol/sdk. - Refactored code for better modularity and maintainability, including new methods for ACP agent management. refactor(agent): remove embedded mode, use ACP only - Drop --mode and -m/--model; always run via ACP bridge - Remove runAgent, executeLLM, prompt.ts and related deps (@ai-sdk/*, ai, zod) - Simplify setupTriggerDetection to the onTrigger path only - Update README, VS Code command, and deps refactor(open-collaboration-agent): simplify MCP integration and documentation - Updated MCP server to a minimal skeleton, removing complex integration paths and retaining only essential components for future extensions. - Enhanced documentation to clarify the historical context of MCP integration and its current status as a reference implementation. - Added example tools and resources for MCP, demonstrating basic functionality while emphasizing the primary use of ACP for agent operations. - Removed unused sampling parser and related code to streamline the project structure. refactor(open-collaboration-agent): enhance message handling and simplify launch configuration - Updated launch.json to streamline command options for server and model configuration, adding comments for optional parameters. - Refactored ACPBridge class to improve message handling, separating response and request processing for better clarity and maintainability. - Introduced new methods for handling agent requests, notifications, and tool call updates, enhancing the overall structure and readability of the code. - Improved error handling and logging for better debugging and user feedback during agent interactions. feat(open-collaboration-agent): add MIME type detection and resource link handling - Implemented a private method `getMimeType` in the ACPBridge class to determine the MIME type of files based on their extensions. - Enhanced the `sendTrigger` method to include a `resource_link` in the prompt, providing details about the currently active file, including its MIME type and size. - Added unit tests for `getMimeType` to ensure correct MIME type resolution for various file types and extensions. update @agentclientprotocol/sdk to version 0.13.1 improve ACPBridge type handling and message processing feat(open-collaboration-agent): add OpenCode as an ACP agent - Introduced a new documentation file for using OpenCode as an alternative to Claude Code within the oct-agent framework. feat(open-collaboration-agent): implement tool whitelist configuration and enhance permission handling - Added a tool whitelist configuration to the ACPBridge class, allowing for controlled access to specific tools based on their kind and name. - Introduced methods for loading agent configuration from a JSON file, with defaults provided if the file is not found. - Enhanced permission request handling to check against the tool whitelist, ensuring only approved tool calls are processed. - Updated the command-line interface to accept a configuration file path for the tool whitelist. feat(open-collaboration-agent): optimize document editing with minimal line edits - Implemented a method to compute minimal line edits by identifying common prefixes and suffixes, reducing unnecessary document replacements. - Enhanced the ACPBridge class to skip write operations when no changes are detected, improving performance and reducing redundant operations. - Updated logging to provide clearer insights into the number of edits applied during document updates. feat(open-collaboration-agent): enhance chat trigger handling and document operations - Added support for chat triggers, allowing the agent to respond to messages in chat with prompts. - Updated the `processACPResponse` function to log agent responses and send messages via chat. - Refactored document operations to include a method for retrieving the connection, facilitating chat message handling. - Improved error handling for chat triggers, ensuring users receive feedback when issues arise during processing. feat(open-collaboration-agent): enhance message handling and introduce helloWorld function - Added immediate text message sending in the ACPBridge class when handling agent message chunks. - Updated the processACPResponse function to comment out the message sending line for future adjustments. - Introduced a new helloWorld function that returns a friendly greeting message. feat(vscode): add launch configuration for second extension instance and update .gitignore - Introduced a new script `launch-extension-host.js` to spawn a second Extension Development Host for testing purposes. - Updated `launch.json` to include a new configuration for spawning the second extension instance, allowing for simultaneous testing of protocol and VS Code. - Added entries to `.gitignore` to exclude specific extension host data directories. feat(open-collaboration-agent): refine message processing and improve chat interaction - Added a check to ensure only non-empty accumulated text is sent as a chat message in the processACPResponse function. - Updated handleAgentMessageChunk to keep the chat UI in writing mode while processing text chunks, enhancing user experience during message streaming. Enhance file synchronization and editing capabilities in ACPBridge and document operations - Updated the `fs/write_text_file` method in ACPBridge to ensure files are written to both local workspace and OCT document, improving synchronization reliability. - Added error handling for file writing operations to prevent failures when the file does not exist, creating necessary parent directories. - Refactored `processACPResponse` to apply edits directly to the requested target file, enhancing multi-file handling. - Improved document operations to treat empty document content as valid, ensuring better handling of new files and edits. - Introduced tests for multi-file scenarios and new file creation to validate recent changes and ensure robust functionality. Refactor ACPBridge file handling and synchronization logic - Updated the `fs/write_text_file` method to propose changes to OCT documents without writing to disk when the document exists, enhancing synchronization efficiency. - Implemented logic to create local files only when the OCT document is missing, preventing overwrites of existing local files. - Enhanced test coverage for file writing scenarios, ensuring correct behavior when documents are present or absent in OCT. - Improved logging for better traceability of file operations and synchronization processes. Enhance launch configuration and collaboration instance editing - Updated `launch.json` to include a new prompt for specifying the workspace folder, improving user customization. - Refactored the `onDidProposeChanges` method in `collaboration-instance.ts` to separate initial and change edits, enhancing clarity and maintainability of the code. - Improved error handling and document editing logic to ensure more reliable application of changes in the diff editor. Implement file matching and document opening enhancements in open-collaboration-agent - Added a Levenshtein distance function for fuzzy file matching, allowing users to find files even with typos. - Introduced a `findMatchingFiles` function to search for files based on user-provided paths, supporting exact and fuzzy matches. - Enhanced the `openAndWaitForContent` method in `DocumentSync` to open documents and wait for their content to sync, improving document handling. - Updated chat trigger handling to support file path responses, ensuring users can open documents directly from chat interactions. Refactor proposeChanges method and enhance content provider in collaboration instance - Updated the proposeChanges method in ACPBridge and CollaborationInstance to remove the hostId parameter, simplifying the function signature. - Changed the ProposeChanges message type from NotificationType to BroadcastType in messages.ts for improved message handling. - Introduced a new text document content provider in CollaborationInstance to manage proposed changes, enhancing the editing experience and ensuring better content management during collaboration. Add proposed changes handling in CollaborationInstance and Monaco API Enhance collaboration features and document handling - Updated launch configuration to specify the workspace folder for improved user customization. - Introduced a new `pendingProposals` map in ACPBridge to buffer document changes, consolidating edits for efficient processing. - Refactored `onDidProposeChanges` in CollaborationInstance to debounce proposal handling, improving performance during rapid edits. - Added a new method in DocumentSync to actively resolve the host's active document, addressing race conditions in document following. - Introduced a new `AcceptChanges` message type in the collaboration protocol for better handling of document changes. Enhance collaboration instance content provider with new methods - Added `setContent` and `deleteContent` methods to the proposed content provider for better document management. - Updated the `proposeChanges` method to utilize distinct URIs for 3-way merge editing, improving the merge experience. - Ensured that VSCode refreshes document content for each virtual URI to prevent caching issues. Clean up and fixes
spoenemann
reviewed
May 27, 2026
… superfluous documentation and agent definitions.
fs/read_text_file now consults pendingProposals before Yjs/filesystem so agents that re-read between sequential edits see their own pending writes. Prevents "last write wins" from dropping earlier edits when multiple writes target the same file in one prompt cycle.
handleFileSystemRequest now asks the host to open unknown files via openAndWaitForContent and falls back to an empty-baseline insert hunk for truly new files, so every edited file produces its own proposeChanges broadcast instead of being silently written to disk or dropped.
Extend AgentConfig with optional systemPrompt (string | string[]) and workspaceContext schema, and prepend the configured systemPrompt to every ACP prompt as an agent-agnostic text block. Document the config file (toolWhitelist, systemPrompt) in the README.
jonah-iden
reviewed
May 29, 2026
| vscode.window.showInformationMessage(vscode.l10n.t('Signed out successfully!')); | ||
| }), | ||
| // Diff support | ||
| vscode.commands.registerCommand(DiffSupportCommands.CreateTempDiffDocument, async (file: vscode.Uri) => |
Contributor
There was a problem hiding this comment.
I'm unsure if we should really already merge this user facing functionality or if we should put in a bit more work to get this working nicer
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.
This is a prototype to show that a AI Agent could be part of an OCT session.
Use it on your own risk! :-)
This PR also includes an enhancement to the open collaboration protocol which makes it possible to send change proposals (e.g. to open a diff view with it).