MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / probeOnce

Function probeOnce

e2e/cloud/mcp-destroyed-session-envelope.test.ts:180–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 let stopAfterWipeAt = Number.POSITIVE_INFINITY;
179
180 const probeOnce = async (): Promise<void> => {
181 const at = Date.now() - startedAt;
182 const response = await mcpPost(target.mcpUrl, {
183 bearer,
184 sessionId,
185 body: TOOLS_LIST_REQUEST,
186 });
187 const probe: Probe = {
188 atMs: at,
189 status: response.status,
190 body: await response.text(),
191 retryAfter: response.headers.get("retry-after"),
192 };
193 probes.push(probe);
194 thisSession.push(probe);
195 // "Session not found" is the post-wipe verdict: the destroy alarm has
196 // run, storage is gone, and the object has been aborted. Anything
197 // after this point is a request against an already-dead id.
198 if (isWipedVerdict(probe) && stopAfterWipeAt === Number.POSITIVE_INFINITY) {
199 stopAfterWipeAt = Date.now() + graceAfterWipeMs;
200 }
201 };
202
203 // One worker replenishes its request the moment the previous one
204 // settles, so the session object is never idle and the DELETE has to

Callers 1

workerFunction · 0.85

Calls 5

isWipedVerdictFunction · 0.85
pushMethod · 0.80
mcpPostFunction · 0.70
textMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected