[Feature] Add OpenCode Go session header support
Author: w33bleCreated Sep 6, 2026Updated Sep 13, 2026
Labelsstale
The Goal / Use Case
OpenCode Go requests need an x-opencode-session header associated with the
active conversation. This requirement applies only to OpenCode Go, not standard
OpenCode Zen.
PicoClaw already tracks a session ID, but its OpenAI-compatible provider cannot currently map that value to a provider-specific request header.
Proposed Solution
Add a dedicated opencode-go provider built on the existing OpenAI-compatible
transport.
Add a generic, opt-in provider setting that maps PicoClaw's existing tracked
session ID to a named request header. Configure the opencode-go provider to
use x-opencode-session.
Potential Implementation (Optional)
- Add an optional generic provider setting whose value is a request-header name.
- When configured, set that header to PicoClaw's tracked session ID.
- Configure the
opencode-goprovider withx-opencode-session. - Reuse the existing OpenAI-compatible transport for Chat Completions.
Impact & Roadmap Alignment
- This is a Core Feature
- This is a Nice-to-Have / Enhancement
- This aligns with the current Roadmap
The change is opt-in and should not affect other providers or standard OpenCode Zen.
Alternatives Considered
- Static
custom_headers: A fixed value cannot map requests to PicoClaw's tracked session for each conversation. - Send the header for all OpenAI-compatible providers: Rejected because
x-opencode-sessionis specific to OpenCode Go. - Add the header to standard OpenCode Zen: Rejected because the requirement does not apply to standard OpenCode Zen.
Additional Context
- OpenCode Go documentation: https://opencode.ai/docs/go/
- OpenCode Go announcement: https://x.com/opencode/status/2095410501400289576
- Provider configuration:
docs/guides/providers.md - OpenAI-compatible transport:
pkg/providers/openai_compat/provider.go - Session manager:
pkg/session/manager.go
Source: sipeed/picoclaw