MCPcopy Index your code
hub / github.com/anomalyco/opencode / createSession

Function createSession

packages/opencode/src/cli/cmd/run/session.shared.ts:145–153  ·  view source on GitHub ↗
(messages: SessionMessages)

Source from the content-addressed store, hash-verified

143}
144
145export function createSession(messages: SessionMessages): RunSession {
146 return {
147 first: messages.length === 0,
148 turns: messages.flatMap((msg) => {
149 const item = turn(msg)
150 return item ? [item] : []
151 }),
152 }
153}
154
155export async function resolveSession(sdk: RunInput["sdk"], sessionID: string, limit = LIMIT): Promise<RunSession> {
156 const response = await sdk.session.messages({

Callers 4

pickVariantFunction · 0.90
resolveSessionFunction · 0.70
runQueueFunction · 0.70

Calls 1

turnFunction · 0.70

Tested by

no test coverage detected