feat(acp): Expose TUI Session Management Commands via ACP (#8931)#11207
Closed
xsa-dev wants to merge 18 commits intoanomalyco:devfrom
Closed
feat(acp): Expose TUI Session Management Commands via ACP (#8931)#11207xsa-dev wants to merge 18 commits intoanomalyco:devfrom
xsa-dev wants to merge 18 commits intoanomalyco:devfrom
Conversation
Define TypeScript interfaces for session management operations including: - SessionListParams/Result for listing sessions - SessionSwitchParams for switching between sessions - SessionCreateParams for creating new sessions - SessionForkParams for forking sessions from specific messages - SessionRenameParams for renaming sessions - SessionDeleteParams for deleting sessions - SessionInfoParams for getting session details - SessionUndo/Redo/Compact/Export/Jump/Duplicate params - Helper function formatSessionInfo for API responses Issue: anomalyco#8931
Implement session management methods for the ACP protocol: - listSessions: List all available sessions - switchSession: Switch to an existing session - createSession: Create a new session - forkSession: Fork a session from a specific message - renameSession: Rename a session - deleteSession: Delete a session - getSessionInfo: Get information about a specific session - undoMessage: Undo the last message - redoMessage: Redo a message (placeholder) - compactSession: Compact a session - exportSession: Export a session in various formats - jumpToMessage: Jump to a specific message - duplicateSession: Duplicate a session Issue: anomalyco#8931
Update the ACP agent server to include session management tools: - Add getSessionManagementTools() function to generate session tool definitions - Register session tools alongside agent tools in listTools - Add handleSessionTool() function to route session tool calls to handlers - Handle all 13 session management operations: list, switch, create, fork, rename, delete, info, undo, redo, compact, export, jump, duplicate Issue: anomalyco#8931
Complete implementation of session management operations: - listSessions: List sessions from storage directory - switchSession: Switch to existing session - createSession: Create new session with loadSession - forkSession: Fork from specific message - renameSession: Rename session in storage - deleteSession: Delete session directory - getSessionInfo: Get session metadata - undoMessage: Remove last user message - redoMessage: Placeholder (needs history) - compactSession: Use compaction module - exportSession: Export to text/json/markdown - jumpToMessage: Set message position marker - duplicateSession: Copy session with new ID Issue: anomalyco#8931
Fix syntax errors in session management integration: - Correct import: listSessions instead of list - Remove invalid Sessions import - Add missing commas and line breaks - Ensure proper TypeScript syntax Issue: anomalyco#8931
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
xsa-dev
commented
Jan 29, 2026
Author
xsa-dev
left a comment
There was a problem hiding this comment.
🔍 Production Readiness Review: PR #11207
Critical Issues Found:
1.
mergeable_state: "dirty"- PR имеет конфликты с base-веткойanomalyco:dev- Требуется:
git rebaseилиgit merge mainперед мерджем
2. 📋 Missing Issue Reference
- Label
needs:issueприсутствует - Требуется: Связать с соответствующим issue или закрыть этот label
3. 📝 Draft Status
- PR помечен как
draft - Требуется: Перевести в Ready for Review статус
4. 🚫 Maintainer Cannot Modify
maintainer_can_modify: false- Рекомендуется: Включить эту опцию для удобства ревью
5. 📊 Changes Summary
- 3 файла изменены
- +2,336 добавлено
- -1,435 удалено
Changes Overview:
packages/opencode/src/acp/session-types.ts- Типы для session managementpackages/opencode/src/acp/session-handlers.ts- Обработчики для 13 командpackages/opencode/src/acp/agent.ts- Регистрация tool и роутинг
Feature List (13 commands):
✅ list_sessions, switch_session, create_session, fork_session, rename_session
✅ delete_session, get_session_info, undo_message, redo_message, compact_session
✅ export_session, jump_to_message, duplicate_session
- Add 13 session management commands (list_sessions, switch_session, etc.) - Implement session handlers for all commands - Add TypeScript interfaces for session types - Update agent.ts with new tool registration and MCP server setup Co-authored-by: xsa-dev <xsa-dev@users.noreply.github.com>
359a88f to
e233839
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
- Remove deprecated createServer from MCP SDK import
- Use new McpServer({ name, version }) constructor
- Add type keyword to CallToolResult and ListToolsResult imports
- Remove deprecated createServer function from imports
- Use new McpServer({ name, version }) constructor instead
- Add type keyword to CallToolResult and ListToolsResult imports
PR anomalyco#11207 incorrectly tried to create a separate MCP server with @modelcontextprotocol/sdk which doesn't have the expected API. The correct approach is to use @agentclientprotocol/sdk (as in original repository) to add session management commands as tools to the existing ACP agent. This reverts the incorrect implementation. Session management commands should be added differently using AgentSideConnection API.
Reverts agent.ts to use @agentclientprotocol/sdk as in anomalyco/opencode repository. The previous PR implementation incorrectly used @modelcontextprotocol/sdk which doesn't have the expected McpServer class API.
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 #8931
This PR exposes TUI Session Management Commands via ACP.
Implements 13 session management commands: