anomalyco / anomalyco/opencode
ACP session/load response omits sessionId — breaks resume for Agent of Empires and any spec-compliant ACP client
@rekram1-node is already working on this.
Since Aug 13, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Bug
The ACP session/load handler in packages/opencode/src/acp/service.ts (line ~211, loadSession) returns { configOptions } but omits sessionId from the response. The ACP spec requires sessionId in the session/load result (the newSession handler correctly returns { sessionId, configOptions }).
Impact
Agent of Empires (aoe) v1.13.1+ sends a spec-compliant session/load { sessionId, cwd, mcpServers } request, receives a response with no sessionId, and rejects it: session/load response missing sessionId. It then silently falls back to session/new, so every worker restart forks a fresh session and loses the transcript context — the dashboard shows "Agent finished but didn't notify the daemon; restarting worker" and the old conversation never resumes.
Repro (raw ACP probe)
// opencode acp --cwd <dir>; send initialize, then:
session/load { sessionId: "ses_...", cwd: "/path", mcpServers: [] }
// → 200 result: { "configOptions": [...] } ← sessionId missing
Verified against opencode 1.18.18 and current dev.
Fix
In loadSession, return sessionId alongside configOptions:
return {
sessionId: state.id,
configOptions: configOptions(...),
}
(state.id === params.sessionId — the response just needs to echo it back per spec.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.