MCPcopy Create free account
hub / github.com/github/copilot-sdk / isRequestOnlySnapshot

Function isRequestOnlySnapshot

test/harness/replayingCapiProxy.ts:708–733  ·  view source on GitHub ↗
(
  storedData: NormalizedData,
  requestBody: string | undefined,
  workDir: string,
  toolResultNormalizers: ToolResultNormalizer[],
)

Source from the content-addressed store, hash-verified

706// Checks if the request matches a snapshot that has no assistant response.
707// This handles timeout test scenarios where the snapshot only records the request.
708async function isRequestOnlySnapshot(
709 storedData: NormalizedData,
710 requestBody: string | undefined,
711 workDir: string,
712 toolResultNormalizers: ToolResultNormalizer[],
713): Promise<boolean> {
714 const normalized = await parseAndNormalizeRequest(
715 requestBody,
716 workDir,
717 toolResultNormalizers,
718 );
719 const requestMessages = normalized.conversations[0]?.messages ?? [];
720
721 for (const conversation of storedData.conversations) {
722 if (
723 requestMessages.length === conversation.messages.length &&
724 requestMessages.every(
725 (msg, i) =>
726 JSON.stringify(msg) === JSON.stringify(conversation.messages[i]),
727 )
728 ) {
729 return true;
730 }
731 }
732 return false;
733}
734
735async function parseAndNormalizeRequest(
736 requestBody: string | undefined,

Callers 1

performRequestMethod · 0.85

Calls 1

parseAndNormalizeRequestFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…