- Prevent the
{id}session ID template error from any DCP plugin session API call.
The runtime passes a v1 SDK client to plugins, but the DCP plugin imports v2 type annotations (@opencode-ai/sdk/v2). The v1 SDK's Session class uses URL templates with {id} (e.g., /session/{id}) and expects path: { id: sessionID } to resolve them. The DCP was passing { sessionID } as a flat parameter, leaving {id} unresolved → URLs like /session/%7Bid%7D/message → server-side Zod validation fails.
All 5 client.session.* call sites now use v1 parameter format:
client.session.get({ path: { id: sessionID } })(viasafeGetSession)client.session.messages({ path: { id: sessionId } })(3 call sites)client.session.prompt({ path: { id: sessionID } })(1 call site)
The as any cast is used because v2 types don't accept path.
lib/state/utils.ts:72-safeGetSession(dead code now,isSubAgentSessionreturns false)lib/hooks.ts:236-prepareDcpExecutionlib/messages/inject/subagent-results.ts:14-fetchSubAgentMessageslib/compress/search.ts:12-fetchSessionMessageslib/ui/notification.ts:375-sendIgnoredMessage
/home/drvova/opencode-prod/packages/sdk/js/src/gen/sdk.gen.ts- v1 Session class with{id}URLs (lines 431-701)/home/drvova/opencode-prod/packages/sdk/js/src/v2/gen/sdk.gen.ts- v2 Session2 class with{sessionID}URLs/home/drvova/opencode-prod/packages/opencode/src/plugin/index.ts- creates the v1 client for plugins (line 5, 25)/home/drvova/opencode-prod/packages/sdk/js/src/gen/core/utils.gen.ts-defaultPathSerializeronly extracts frompath(line 16-81)