conversation-session-tool-group-reasoning-visibility-boundary.json 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-tool-group-reasoning-visibility-boundary",
  4. "spec": "./test/e2e/conversation-session/conversation-session-tool-group-reasoning-visibility-boundary.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "tge04-execute-a",
  8. "description": "TGE04 emits reasoning followed by the first Terminal command.",
  9. "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "recorded-stream", "syntheticReason": "真实 provider 是否在每次工具继续前输出 reasoning 不稳定;固定 reasoning row 才能验证显示设置边界。" },
  10. "maxMatches": 1,
  11. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOL_GROUP_REASONING_VISIBILITY_BOUNDARY"], "bodyExcludes": ["Generate a concise title", "toolu_tge04_execute_a"] },
  12. "response": {
  13. "statusCode": 200,
  14. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  15. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"tge04-execute-a\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":100,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"TGE04 reasoning before execute A\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_tge04_execute_a\",\"name\":\"Bash\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"command\\\":\\\"node -e \\\\\\\"console.log('TGE04_EXEC_A')\\\\\\\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\"},\"usage\":{\"input_tokens\":100,\"output_tokens\":20}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  16. }
  17. },
  18. {
  19. "id": "tge04-execute-b",
  20. "description": "TGE04 emits reasoning followed by the second Terminal command.",
  21. "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "recorded-stream", "syntheticReason": "第二条 reasoning row 用于验证隐藏时合并、显示时拆分。" },
  22. "maxMatches": 1,
  23. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOL_GROUP_REASONING_VISIBILITY_BOUNDARY", "toolu_tge04_execute_a"], "bodyExcludes": ["Generate a concise title", "toolu_tge04_execute_b"] },
  24. "response": {
  25. "statusCode": 200,
  26. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  27. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"tge04-execute-b\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":100,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"TGE04 reasoning before execute B\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_tge04_execute_b\",\"name\":\"Bash\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"command\\\":\\\"node -e \\\\\\\"console.log('TGE04_EXEC_B')\\\\\\\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\"},\"usage\":{\"input_tokens\":100,\"output_tokens\":20}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  28. }
  29. },
  30. {
  31. "id": "tge04-write",
  32. "description": "TGE04 emits reasoning followed by Write.",
  33. "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "recorded-stream", "syntheticReason": "固定 reasoning + Write 边界,验证 Changes 的同一可见性合同。" },
  34. "maxMatches": 1,
  35. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOL_GROUP_REASONING_VISIBILITY_BOUNDARY", "toolu_tge04_execute_b"], "bodyExcludes": ["Generate a concise title", "toolu_tge04_write"] },
  36. "response": {
  37. "statusCode": 200,
  38. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  39. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"tge04-write\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":100,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"TGE04 reasoning before write\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_tge04_write\",\"name\":\"Write\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"file_path\\\":\\\"{{e2eRuntimeRoot}}/conversation-session-tool-group-reasoning-visibility-boundary/reasoning.ts\\\",\\\"content\\\":\\\"export const reasoning = 'a';\\\\n\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\"},\"usage\":{\"input_tokens\":100,\"output_tokens\":20}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  40. }
  41. },
  42. {
  43. "id": "tge04-edit",
  44. "description": "TGE04 emits reasoning followed by Edit.",
  45. "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "recorded-stream", "syntheticReason": "固定第二条 file-write reasoning row,用于显示设置切换后拆分 Changes。" },
  46. "maxMatches": 1,
  47. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOL_GROUP_REASONING_VISIBILITY_BOUNDARY", "toolu_tge04_write"], "bodyExcludes": ["Generate a concise title", "toolu_tge04_edit"] },
  48. "response": {
  49. "statusCode": 200,
  50. "headers": { "content-type": "text/event-stream; charset=utf-8" },
  51. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"tge04-edit\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"usage\":{\"input_tokens\":100,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"TGE04 reasoning before edit\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_tge04_edit\",\"name\":\"Edit\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"file_path\\\":\\\"{{e2eRuntimeRoot}}/conversation-session-tool-group-reasoning-visibility-boundary/reasoning.ts\\\",\\\"old_string\\\":\\\"'a'\\\",\\\"new_string\\\":\\\"'b'\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\"},\"usage\":{\"input_tokens\":100,\"output_tokens\":20}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  52. }
  53. },
  54. {
  55. "id": "tge04-final",
  56. "description": "TGE04 completes the reasoning boundary turn.",
  57. "metadata": { "kind": "main", "source": "synthetic", "timingPolicy": "fast-text", "syntheticReason": "固定终态用于 reload 后按设置重新派生同一历史 rows。" },
  58. "maxMatches": 1,
  59. "match": { "method": "POST", "pathIncludes": "/messages", "bodyIncludes": ["E2E_TOOL_GROUP_REASONING_VISIBILITY_BOUNDARY", "toolu_tge04_edit"], "bodyExcludes": ["Generate a concise title"] },
  60. "response": { "statusCode": 200, "text": "upstream-e2e-ok" }
  61. }
  62. ]
  63. }