Skip to content

Commit 12a994f

Browse files
authored
fix(cockpit): aimock fixtures for the refund interrupts e2e (#558)
The refund rewrite added two LLM calls per turn that the old single "Hello" fixture didn't cover, so CI failed with `404 No fixture matched`: - draft_refund's structured extractor hits chat.completions.parse with response_format=json_schema — match on `responseFormat: "json_schema"` and return `content` as a JSON object (aimock stringifies it for the structured-output parser). - the acknowledgement is a plain-text call — match on the refund system prompt and return text `content`. Fixtures cover both welcome suggestions (cus_a8x2k / cus_z19fp). Verified locally against @copilotkit/aimock: extraction returns the RefundDraft and the ack returns text. No harness change needed — aimock already supports structured-output fixtures.
1 parent 2980e38 commit 12a994f

1 file changed

Lines changed: 29 additions & 5 deletions

File tree

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
11
{
22
"fixtures": [
33
{
4-
"match": {
5-
"userMessage": "Hello"
6-
},
4+
"match": { "responseFormat": "json_schema", "userMessage": "cus_a8x2k" },
75
"response": {
8-
"content": "Hello! How can I help you today? Please approve this response to continue."
6+
"content": {
7+
"customer_id": "cus_a8x2k",
8+
"amount": 47.5,
9+
"reason": "Customer was charged twice for the same order."
10+
}
11+
}
12+
},
13+
{
14+
"match": { "responseFormat": "json_schema", "userMessage": "cus_z19fp" },
15+
"response": {
16+
"content": {
17+
"customer_id": "cus_z19fp",
18+
"amount": 129.0,
19+
"reason": "Chargeback opened for unrecognized activity."
20+
}
21+
}
22+
},
23+
{
24+
"match": { "systemMessage": "Refund Authorization Assistant", "userMessage": "cus_a8x2k" },
25+
"response": {
26+
"content": "Understood — a $47.50 refund to cus_a8x2k for a duplicate charge. Pausing for operator approval; no refund is issued until a human reviews and approves."
27+
}
28+
},
29+
{
30+
"match": { "systemMessage": "Refund Authorization Assistant", "userMessage": "cus_z19fp" },
31+
"response": {
32+
"content": "Understood — a $129.00 refund to cus_z19fp for a chargeback. Pausing for operator approval; no refund is issued until a human reviews and approves."
933
}
1034
}
1135
]
12-
}
36+
}

0 commit comments

Comments
 (0)