{
  "fixtureOnly": true,
  "boundary": "Fixed fictional catalog results; never fabricate a real tool result to silence an API error.",
  "cases": [
    {
      "id": "missing-result",
      "kind": "tool-history",
      "before": {
        "messages": [
          {
            "role": "user",
            "content": "查询示例库存。"
          },
          {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "call_demo_a",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-001\"}"
                }
              }
            ]
          },
          {
            "role": "user",
            "content": "继续"
          }
        ]
      },
      "after": {
        "messages": [
          {
            "role": "user",
            "content": "查询示例库存。"
          },
          {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "call_demo_a",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-001\"}"
                }
              }
            ]
          },
          {
            "role": "tool",
            "tool_call_id": "call_demo_a",
            "content": "{\"stock\": 7, \"fixtureOnly\": true}"
          },
          {
            "role": "user",
            "content": "继续"
          }
        ]
      },
      "expectedIssues": [
        "tool-results-incomplete"
      ],
      "illustrativeError": {
        "error": {
          "type": "invalid_request_error",
          "message": "Assistant tool_calls must be followed by tool messages for each tool_call_id: call_demo_a."
        }
      }
    },
    {
      "id": "wrong-id",
      "kind": "tool-history",
      "before": {
        "messages": [
          {
            "role": "user",
            "content": "查询示例库存。"
          },
          {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "call_demo_a",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-001\"}"
                }
              }
            ]
          },
          {
            "role": "tool",
            "tool_call_id": "call_other",
            "content": "{\"stock\": 7, \"fixtureOnly\": true}"
          }
        ]
      },
      "after": {
        "messages": [
          {
            "role": "user",
            "content": "查询示例库存。"
          },
          {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "call_demo_a",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-001\"}"
                }
              }
            ]
          },
          {
            "role": "tool",
            "tool_call_id": "call_demo_a",
            "content": "{\"stock\": 7, \"fixtureOnly\": true}"
          }
        ]
      },
      "expectedIssues": [
        "tool-result-orphan",
        "tool-results-incomplete"
      ],
      "illustrativeError": {
        "error": {
          "type": "invalid_request_error",
          "message": "No matching tool call found for tool_call_id call_other."
        }
      }
    },
    {
      "id": "parallel-missing-one",
      "kind": "tool-history",
      "before": {
        "messages": [
          {
            "role": "user",
            "content": "查询示例库存。"
          },
          {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "call_demo_a",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-001\"}"
                }
              },
              {
                "id": "call_demo_b",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-002\"}"
                }
              }
            ]
          },
          {
            "role": "tool",
            "tool_call_id": "call_demo_a",
            "content": "{\"stock\": 7, \"fixtureOnly\": true}"
          }
        ]
      },
      "after": {
        "messages": [
          {
            "role": "user",
            "content": "查询示例库存。"
          },
          {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "call_demo_a",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-001\"}"
                }
              },
              {
                "id": "call_demo_b",
                "type": "function",
                "function": {
                  "name": "lookup_stock",
                  "arguments": "{\"sku\": \"QR-SKU-002\"}"
                }
              }
            ]
          },
          {
            "role": "tool",
            "tool_call_id": "call_demo_a",
            "content": "{\"stock\": 7, \"fixtureOnly\": true}"
          },
          {
            "role": "tool",
            "tool_call_id": "call_demo_b",
            "content": "{\"stock\": 3, \"fixtureOnly\": true}"
          }
        ]
      },
      "expectedIssues": [
        "tool-results-incomplete"
      ],
      "illustrativeError": {
        "error": {
          "type": "invalid_request_error",
          "message": "Missing tool response for call_demo_b."
        }
      }
    }
  ]
}
