MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / runWithSessionContext

Function runWithSessionContext

server/src/training-agent/state.ts:84–87  ·  view source on GitHub ↗
(fn: () => Promise<T>)

Source from the content-addressed store, hash-verified

82
83/** Wrap a request so getSession()/flushDirtySessions() use a per-request cache. */
84export function runWithSessionContext<T>(fn: () => Promise<T>): Promise<T> {
85 const ctx: RequestSessionCtx = { sessions: new Map(), snapshots: new Map() };
86 return requestCtx.run(ctx, fn);
87}
88
89/**
90 * Persist sessions that were actually mutated during the current request.

Callers 4

adaptFunction · 0.85
customToolForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected