coder / coder/acp-go-sdk

Feature Request: Add unstable session capabilities (sessionCapabilities.resume/fork/list)

Open
#14 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
230
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Hi! 👋

First off, thank you for maintaining this SDK - it's been really helpful for building Go-based ACP clients.

### Context

I'm building a chat workbench that integrates with Claude Code via ACP. I've been investigating how the [Obsidian Agent Client plugin](https://github.com/RAIT-09/obsidian-agent-client) (using TypeScript SDK v0.12.0) successfully restores conversation context across sessions.

### What I discovered

Through testing, I confirmed that **Claude Code ACP reports `loadSession: false`** and returns `"Method not found": session/load` when called:

```
AgentCapabilities.LoadSession: false
Error: {"code":-32601,"message":"\"Method not found\": session/load","data":{"method":"session/load"}}
```

However, the Obsidian plugin still achieves session restoration. Looking at their code, they check for **unstable session capabilities**:

```typescript
// From session-capability-utils.ts
canLoad: agentCapabilities?.loadSession === true,
canResume: agentCapabilities?.sessionCapabilities?.resume !== undefined,
canFork: agentCapabilities?.sessionCapabilities?.fork !== undefined,
canList: agentCapabilities?.sessionCapabilities?.list !== undefined,
```

And use methods like:
- `connection.unstable_resumeSession({ sessionId, cwd })`
- `connection.unstable_forkSession({ sessionId, cwd })`
- `connection.unstable_listSessions({ cwd, cursor })`

### The gap in Go SDK v0.6.3

The Go SDK has:
- ✅ `LoadSession()` method
- ✅ `AgentCapabilities.LoadSession` field

But is missing:
- ❌ `AgentCapabilities.SessionCapabilities` struct with `Resume`, `Fork`, `List` fields
- ❌ `UnstableResumeSession()` method
- ❌ `UnstableForkSession()` method
- ❌ `UnstableListSessions()` method

### Request

Would you consider adding these unstable session capabilities for parity with the TypeScript SDK? Specifically:

1. **Types** - Add to `AgentCapabilities`:
```go
type SessionCapabilities struct {
Resume *ResumeCapability `json:"resume,omitempty"`
Fork *ForkCapability `json:"fork,omitempty"`
List *ListCapability `json:"list,omitempty"`
}

type AgentCapabilities struct {
// ... existing fields
SessionCapabilities *SessionCapabilities `json:"sessionCapabilities,omitempty"`
}
```

2. **Client methods**:
- `UnstableResumeSession(ctx, params) (ResumeSessionResponse, error)`
- `UnstableForkSession(ctx, params) (ForkSessionResponse, error)`
- `UnstableListSessions(ctx, params) (ListSessionsResponse, error)`

### Use case

This would enable Go clients to:
- Restore previous chat sessions with full AI context
- Show users a list of their previous conversations
- Fork conversations to explore different paths

### References

- [Obsidian plugin's acp.adapter.ts](https://github.com/RAIT-09/obsidian-agent-client/blob/RAIT-09/feature/session-management/src/adapters/acp/acp.adapter.ts) - shows usage patterns
- [Obsidian plugin's useSessionHistory.ts](https://github.com/RAIT-09/obsidian-agent-client/blob/RAIT-09/feature/session-management/src/hooks/useSessionHistory.ts) - shows capability detection
- TypeScript SDK `@agentclientprotocol/sdk` v0.12.0

Happy to help with implementation or testing if that would be useful!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Go SDK's AgentCapabilities and existing LoadSession entry points, then compare them with the referenced TypeScript SDK methods and capability detection. Add the requested session capability types and unstable resume, fork, and list entry points, with matching request and response types. Done means Go clients can detect these capabilities and invoke all three session operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.