MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / completionAfterAnswer

Function completionAfterAnswer

apps/vscode-e2e/src/fixtures/subtasks.ts:32–54  ·  view source on GitHub ↗
(followupId: string, completionId: string)

Source from the content-addressed store, hash-verified

30}
31
32const completionAfterAnswer = (followupId: string, completionId: string) => ({
33 match: {
34 predicate: (req: ChatCompletionRequest) =>
35 // Preferred: structured tool-result message carries the followup answer.
36 toolResultContains(req, followupId, [SUBTASK_CHILD_FOLLOWUP_ANSWER]) ||
37 // Fallback 1: answer present alongside the tool-call ID but not in a role:tool message.
38 requestContains(req, [followupId, SUBTASK_CHILD_FOLLOWUP_ANSWER]) ||
39 // Fallback 2: answer arrives as a bare user message after task resume (no tool-call ID context).
40 requestContains(req, [
41 SUBTASK_CHILD_MARKER,
42 `<user_message>\\n${SUBTASK_CHILD_FOLLOWUP_ANSWER}\\n</user_message>`,
43 ]),
44 },
45 response: {
46 toolCalls: [
47 {
48 name: "attempt_completion",
49 arguments: JSON.stringify({ result: "9" }),
50 id: completionId,
51 },
52 ],
53 },
54})
55
56export function addSubtaskFixtures(mock: InstanceType<typeof LLMock>) {
57 mock.addFixture({

Callers 1

addSubtaskFixturesFunction · 0.85

Calls 2

toolResultContainsFunction · 0.90
requestContainsFunction · 0.85

Tested by

no test coverage detected