{ "version": 1, "caseName": "conversation-session-toolsearch-local", "spec": "./test/e2e/conversation-session/tools/conversation-session-toolsearch-local.test.ts", "fixtures": [ { "id": "conversation-session-toolsearch-local-anthropic-search-json", "stage": "anthropic-search-json", "description": "anthropic-search-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [{\"type\": \"tool_use\", \"id\": \"local_search\", \"name\": \"LocalToolSearch\", \"input\": {\"query\": \"select:TodoRead,TaskOutput\", \"max_results\": 5}}], \"stop_reason\": \"tool_use\", \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}" } }, { "id": "conversation-session-toolsearch-local-anthropic-search-stream", "stage": "anthropic-search-stream", "description": "anthropic-search-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [], \"stop_reason\": null, \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}}\n\nevent: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"tool_use\", \"id\": \"local_search\", \"name\": \"LocalToolSearch\", \"input\": {}}}\n\nevent: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"input_json_delta\", \"partial_json\": \"{\\\"query\\\": \\\"select:TodoRead,TaskOutput\\\", \\\"max_results\\\": 5}\"}}\n\nevent: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\nevent: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"tool_use\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 30}}\n\nevent: message_stop\ndata: {\"type\": \"message_stop\"}\n\n" } }, { "id": "conversation-session-toolsearch-local-anthropic-bad-json", "stage": "anthropic-bad-json", "description": "anthropic-bad-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [{\"type\": \"tool_use\", \"id\": \"local_bad\", \"name\": \"DeferredToolCall\", \"input\": {\"name\": \"TodoRead\", \"input\": {\"todos\": \"invalid\"}}}], \"stop_reason\": \"tool_use\", \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}" } }, { "id": "conversation-session-toolsearch-local-anthropic-bad-stream", "stage": "anthropic-bad-stream", "description": "anthropic-bad-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [], \"stop_reason\": null, \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}}\n\nevent: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"tool_use\", \"id\": \"local_bad\", \"name\": \"DeferredToolCall\", \"input\": {}}}\n\nevent: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"input_json_delta\", \"partial_json\": \"{\\\"name\\\": \\\"TodoRead\\\", \\\"input\\\": {\\\"todos\\\": \\\"invalid\\\"}}\"}}\n\nevent: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\nevent: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"tool_use\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 30}}\n\nevent: message_stop\ndata: {\"type\": \"message_stop\"}\n\n" } }, { "id": "conversation-session-toolsearch-local-anthropic-good-json", "stage": "anthropic-good-json", "description": "anthropic-good-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [{\"type\": \"tool_use\", \"id\": \"local_good\", \"name\": \"DeferredToolCall\", \"input\": {\"name\": \"TodoRead\", \"input\": {}}}], \"stop_reason\": \"tool_use\", \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}" } }, { "id": "conversation-session-toolsearch-local-anthropic-good-stream", "stage": "anthropic-good-stream", "description": "anthropic-good-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [], \"stop_reason\": null, \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}}\n\nevent: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"tool_use\", \"id\": \"local_good\", \"name\": \"DeferredToolCall\", \"input\": {}}}\n\nevent: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"input_json_delta\", \"partial_json\": \"{\\\"name\\\": \\\"TodoRead\\\", \\\"input\\\": {}}\"}}\n\nevent: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\nevent: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"tool_use\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 30}}\n\nevent: message_stop\ndata: {\"type\": \"message_stop\"}\n\n" } }, { "id": "conversation-session-toolsearch-local-anthropic-done-json", "stage": "anthropic-done-json", "description": "anthropic-done-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [{\"type\": \"text\", \"text\": \"E2E_TOOLSEARCH_LOCAL_DONE\"}], \"stop_reason\": \"end_turn\", \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}" } }, { "id": "conversation-session-toolsearch-local-anthropic-done-stream", "stage": "anthropic-done-stream", "description": "anthropic-done-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "event: message_start\ndata: {\"type\": \"message_start\", \"message\": {\"id\": \"msg_local\", \"type\": \"message\", \"role\": \"assistant\", \"model\": \"test-toolsearch\", \"content\": [], \"stop_reason\": null, \"stop_sequence\": null, \"usage\": {\"input_tokens\": 100, \"output_tokens\": 30}}}\n\nevent: content_block_start\ndata: {\"type\": \"content_block_start\", \"index\": 0, \"content_block\": {\"type\": \"text\", \"text\": \"\"}}\n\nevent: content_block_delta\ndata: {\"type\": \"content_block_delta\", \"index\": 0, \"delta\": {\"type\": \"text_delta\", \"text\": \"E2E_TOOLSEARCH_LOCAL_DONE\"}}\n\nevent: content_block_stop\ndata: {\"type\": \"content_block_stop\", \"index\": 0}\n\nevent: message_delta\ndata: {\"type\": \"message_delta\", \"delta\": {\"stop_reason\": \"end_turn\", \"stop_sequence\": null}, \"usage\": {\"output_tokens\": 30}}\n\nevent: message_stop\ndata: {\"type\": \"message_stop\"}\n\n" } }, { "id": "conversation-session-toolsearch-local-openai-search-json", "stage": "openai-search-json", "description": "openai-search-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"chatcmpl_local\", \"object\": \"chat.completion\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": null, \"tool_calls\": [{\"id\": \"local_search\", \"type\": \"function\", \"function\": {\"name\": \"LocalToolSearch\", \"arguments\": \"{\\\"query\\\": \\\"select:TodoRead,TaskOutput\\\", \\\"max_results\\\": 5}\"}}]}, \"finish_reason\": \"tool_calls\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}" } }, { "id": "conversation-session-toolsearch-local-openai-search-stream", "stage": "openai-search-stream", "description": "openai-search-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "data: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {\"role\": \"assistant\", \"content\": null, \"tool_calls\": [{\"id\": \"local_search\", \"type\": \"function\", \"function\": {\"name\": \"LocalToolSearch\", \"arguments\": \"{\\\"query\\\": \\\"select:TodoRead,TaskOutput\\\", \\\"max_results\\\": 5}\"}, \"index\": 0}]}, \"finish_reason\": null}]}\n\ndata: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"tool_calls\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}\n\ndata: [DONE]\n\n" } }, { "id": "conversation-session-toolsearch-local-openai-bad-json", "stage": "openai-bad-json", "description": "openai-bad-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"chatcmpl_local\", \"object\": \"chat.completion\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": null, \"tool_calls\": [{\"id\": \"local_bad\", \"type\": \"function\", \"function\": {\"name\": \"DeferredToolCall\", \"arguments\": \"{\\\"name\\\": \\\"TodoRead\\\", \\\"input\\\": {\\\"todos\\\": \\\"invalid\\\"}}\"}}]}, \"finish_reason\": \"tool_calls\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}" } }, { "id": "conversation-session-toolsearch-local-openai-bad-stream", "stage": "openai-bad-stream", "description": "openai-bad-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "data: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {\"role\": \"assistant\", \"content\": null, \"tool_calls\": [{\"id\": \"local_bad\", \"type\": \"function\", \"function\": {\"name\": \"DeferredToolCall\", \"arguments\": \"{\\\"name\\\": \\\"TodoRead\\\", \\\"input\\\": {\\\"todos\\\": \\\"invalid\\\"}}\"}, \"index\": 0}]}, \"finish_reason\": null}]}\n\ndata: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"tool_calls\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}\n\ndata: [DONE]\n\n" } }, { "id": "conversation-session-toolsearch-local-openai-good-json", "stage": "openai-good-json", "description": "openai-good-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"chatcmpl_local\", \"object\": \"chat.completion\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": null, \"tool_calls\": [{\"id\": \"local_good\", \"type\": \"function\", \"function\": {\"name\": \"DeferredToolCall\", \"arguments\": \"{\\\"name\\\": \\\"TodoRead\\\", \\\"input\\\": {}}\"}}]}, \"finish_reason\": \"tool_calls\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}" } }, { "id": "conversation-session-toolsearch-local-openai-good-stream", "stage": "openai-good-stream", "description": "openai-good-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "data: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {\"role\": \"assistant\", \"content\": null, \"tool_calls\": [{\"id\": \"local_good\", \"type\": \"function\", \"function\": {\"name\": \"DeferredToolCall\", \"arguments\": \"{\\\"name\\\": \\\"TodoRead\\\", \\\"input\\\": {}}\"}, \"index\": 0}]}, \"finish_reason\": null}]}\n\ndata: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"tool_calls\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}\n\ndata: [DONE]\n\n" } }, { "id": "conversation-session-toolsearch-local-openai-done-json", "stage": "openai-done-json", "description": "openai-done-json", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "application/json" }, "body": "{\"id\": \"chatcmpl_local\", \"object\": \"chat.completion\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"E2E_TOOLSEARCH_LOCAL_DONE\"}, \"finish_reason\": \"stop\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}" } }, { "id": "conversation-session-toolsearch-local-openai-done-stream", "stage": "openai-done-stream", "description": "openai-done-stream", "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "Local search and wrapper lifecycle contract response; actual CLI and HTTP adapter execute the tools." }, "match": { "method": "POST", "pathIncludes": "/chat/completions", "bodyIncludes": ["E2E_TOOLSEARCH_LOCAL"] }, "response": { "statusCode": 200, "headers": { "content-type": "text/event-stream" }, "body": "data: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {\"role\": \"assistant\", \"content\": \"E2E_TOOLSEARCH_LOCAL_DONE\"}, \"finish_reason\": null}]}\n\ndata: {\"id\": \"chatcmpl_local\", \"object\": \"chat.completion.chunk\", \"created\": 1, \"model\": \"test-toolsearch\", \"choices\": [{\"index\": 0, \"delta\": {}, \"finish_reason\": \"stop\"}], \"usage\": {\"prompt_tokens\": 100, \"completion_tokens\": 30, \"total_tokens\": 130}}\n\ndata: [DONE]\n\n" } } ] }