MCPcopy Create free account
hub / github.com/anomalyco/opencode / prefetch

Function prefetch

packages/app/src/context/server-session.ts:626–635  ·  view source on GitHub ↗
(sessionID: string, limit: number)

Source from the content-addressed store, hash-verified

624 }
625
626 const prefetch = async (sessionID: string, limit: number) => {
627 touch(sessionID)
628 await inflight.get(sessionID)
629 if (
630 Date.now() - (meta.at[sessionID] ?? 0) <= 15_000 &&
631 (meta.complete[sessionID] || (data.message[sessionID]?.length ?? 0) >= limit)
632 )
633 return
634 await runInflight(inflight, sessionID, () => loadMessages(sessionID, limit))
635 }
636
637 const eventSessionID = (event: { type: string; properties?: unknown }) => {
638 const properties = event.properties

Callers

nothing calls this directly

Calls 4

runInflightFunction · 0.85
loadMessagesFunction · 0.85
touchFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected