MCPcopy Create free account
hub / github.com/tiann/hapi / getOrCreateSession

Method getOrCreateSession

hub/src/sync/sessionCache.ts:66–77  ·  view source on GitHub ↗
(
        tag: string,
        metadata: unknown,
        agentState: unknown,
        namespace: string,
        model?: string,
        effort?: string,
        modelReasoningEffort?: string
    )

Source from the content-addressed store, hash-verified

64 }
65
66 getOrCreateSession(
67 tag: string,
68 metadata: unknown,
69 agentState: unknown,
70 namespace: string,
71 model?: string,
72 effort?: string,
73 modelReasoningEffort?: string
74 ): Session {
75 const stored = this.store.sessions.getOrCreateSession(tag, metadata, agentState, namespace, model, effort, modelReasoningEffort)
76 return this.refreshSession(stored.id) ?? (() => { throw new Error('Failed to load session') })()
77 }
78
79 refreshSession(sessionId: string): Session | null {
80 let stored = this.store.sessions.getSession(sessionId)

Callers

nothing calls this directly

Calls 1

refreshSessionMethod · 0.95

Tested by

no test coverage detected