feat(acp): Add session management commands (simplified version)#1
Merged
feat(acp): Add session management commands (simplified version)#1
Conversation
- Add list_sessions, switch_session, create_session, fork_session - Add rename_session, delete_session, get_session_info - Add undo_message, redo_message, compact_session - Add export_session, jump_to_message, duplicate_session - Simplified implementation using basic Node.js modules
|
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. |
- Add all session commands to availableCommands list - Add switch case handlers for all commands - Parse command arguments from cmd.args string - Commands: listSessions, switchSession, createSession, forkSession, renameSession, deleteSession, getSessionInfo, undoMessage, redoMessage, compactSession, exportSession, jumpToMessage, duplicateSession
…8931) This PR exposes TUI Session Management Commands via ACP. Implements 13 session management 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
- Merge loadAvailableModes and resolveModeState into loadSessionMode - Simplify arguments typing in MCP client - Remove OPENCODE_CLIENT environment variable from ACP command
catatafishen
pushed a commit
to catatafishen/agentbridge
that referenced
this pull request
Mar 29, 2026
OpenCode uses `session/resume` as a separate ACP method instead of
`resumeSessionId` in `session/new`. The Zod schema for session/new
has no resumeSessionId field, so the parameter was silently ignored.
Changes:
- Add `supportsSessionResume()` hook to AcpClient (default false)
- Add `resumeSession()` method that calls `session/resume` RPC with
{sessionId, cwd, mcpServers} params
- createSession() tries session/resume first when supported, falls
back to session/new on failure
- Only add resumeSessionId to session/new for agents that don't
support the separate resume method
- OpenCodeClient overrides supportsSessionResume() → true
- Refactor processNewSessionResponse → processSessionResponse
(sessionId assignment moved to caller for resume compatibility)
- Update SESSION-RESUME.md with Bug 26 and protocol documentation
Discovered via `strings` analysis of OpenCode v1.2.27 binary:
- session/resume request: {sessionId, cwd, mcpServers?}
- session/resume response: {configOptions?, models?, modes?}
- Handler: agent.unstable_resumeSession() (unstable_ prefix)
Related: anomalyco/opencode#8931, xsa-dev/anomalyco-opencode#1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 anomalyco#8931
Summary
This PR adds 13 session management commands to the ACP (Agent Client Protocol) implementation for Zed integration.
Commands Added
Files Changed
Notes
This is a simplified implementation that uses file-based storage for sessions. Future work can integrate with OpenCode's internal session storage via SDK.
Related
Original PR: anomalyco#11207 (blocked with conflicts)