{
  "scenario": "model-patch-mid-session",
  "expectFaults": false,
  "violations": [],
  "warnings": [],
  "stats": {
    "total": 69,
    "types": {
      "connected": 1,
      "session.created": 1,
      "chat.user_message": 2,
      "chat.event": 2,
      "session.stream": 59,
      "chat.message": 2,
      "chat.response": 2
    },
    "streamFrames": {
      "thinking.chunk": 21,
      "inference.chunk": 36,
      "done": 2
    },
    "sessions": 1
  },
  "events": [
    {
      "type": "connected",
      "timestamp": 1781209863524,
      "_rxAt": 1781209863525,
      "_seq": 0
    },
    {
      "type": "session.created",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "mode": "chat",
        "parentSessionId": null,
        "instanceName": null,
        "timestamp": 1781209863786
      },
      "_rxAt": 1781209863787,
      "_seq": 1
    },
    {
      "type": "chat.user_message",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "content": "Reply with exactly: FIRST-MODEL-OK",
        "timestamp": 1781209863789
      },
      "_rxAt": 1781209863789,
      "_seq": 2
    },
    {
      "type": "chat.event",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "type": "iteration.start",
        "iteration": 1,
        "tokensSoFar": 0,
        "timestamp": 1781209863795
      },
      "_rxAt": 1781209863795,
      "_seq": 3
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "The"
      },
      "_rxAt": 1781209865569,
      "_seq": 4
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865569,
      "_seq": 5
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " user"
      },
      "_rxAt": 1781209865570,
      "_seq": 6
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865571,
      "_seq": 7
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " wants"
      },
      "_rxAt": 1781209865572,
      "_seq": 8
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865572,
      "_seq": 9
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " me"
      },
      "_rxAt": 1781209865572,
      "_seq": 10
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865572,
      "_seq": 11
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " to"
      },
      "_rxAt": 1781209865573,
      "_seq": 12
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865573,
      "_seq": 13
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " reply"
      },
      "_rxAt": 1781209865573,
      "_seq": 14
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865573,
      "_seq": 15
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " with"
      },
      "_rxAt": 1781209865573,
      "_seq": 16
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865574,
      "_seq": 17
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " exactly"
      },
      "_rxAt": 1781209865574,
      "_seq": 18
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865574,
      "_seq": 19
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " \""
      },
      "_rxAt": 1781209865574,
      "_seq": 20
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865574,
      "_seq": 21
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "FIRST"
      },
      "_rxAt": 1781209865709,
      "_seq": 22
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865709,
      "_seq": 23
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "-M"
      },
      "_rxAt": 1781209865709,
      "_seq": 24
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865709,
      "_seq": 25
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "ODEL"
      },
      "_rxAt": 1781209865709,
      "_seq": 26
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865709,
      "_seq": 27
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "-"
      },
      "_rxAt": 1781209865710,
      "_seq": 28
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865710,
      "_seq": 29
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "OK"
      },
      "_rxAt": 1781209865710,
      "_seq": 30
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865710,
      "_seq": 31
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "\"."
      },
      "_rxAt": 1781209865710,
      "_seq": 32
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865710,
      "_seq": 33
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " This"
      },
      "_rxAt": 1781209865711,
      "_seq": 34
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865711,
      "_seq": 35
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " is"
      },
      "_rxAt": 1781209865711,
      "_seq": 36
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865711,
      "_seq": 37
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " a"
      },
      "_rxAt": 1781209865712,
      "_seq": 38
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865712,
      "_seq": 39
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " simple"
      },
      "_rxAt": 1781209865712,
      "_seq": 40
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865712,
      "_seq": 41
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": " request"
      },
      "_rxAt": 1781209865860,
      "_seq": 42
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865860,
      "_seq": 43
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "thinking.chunk",
      "data": {
        "content": "."
      },
      "_rxAt": 1781209865860,
      "_seq": 44
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865860,
      "_seq": 45
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "FIRST"
      },
      "_rxAt": 1781209865860,
      "_seq": 46
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "-M"
      },
      "_rxAt": 1781209865861,
      "_seq": 47
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "ODEL"
      },
      "_rxAt": 1781209865861,
      "_seq": 48
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "-"
      },
      "_rxAt": 1781209865861,
      "_seq": 49
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "OK"
      },
      "_rxAt": 1781209865861,
      "_seq": 50
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865861,
      "_seq": 51
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209865861,
      "_seq": 52
    },
    {
      "type": "chat.message",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "id": 2,
        "session_id": "sess_1203ebc87c71c62c",
        "role": "assistant",
        "content": "FIRST-MODEL-OK",
        "tool_calls": null,
        "tool_call_id": null,
        "thinking_content": "The user wants me to reply with exactly \"FIRST-MODEL-OK\". This is a simple request.",
        "thinking_tokens": 21,
        "created_at": "2026-06-11T20:31:05.865Z",
        "finishReason": "stop",
        "iteration": 1,
        "tokenUsage": {
          "input": 2935,
          "output": 29,
          "cache": 2560,
          "cost": 0.0007605675
        },
        "timestamp": 1781209865866
      },
      "_rxAt": 1781209865866,
      "_seq": 53
    },
    {
      "type": "chat.response",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "content": "FIRST-MODEL-OK",
        "toolCount": 0,
        "timestamp": 1781209865866
      },
      "_rxAt": 1781209865867,
      "_seq": 54
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "done",
      "data": {
        "session": {
          "id": "sess_1203ebc87c71c62c",
          "agent_name": "helper",
          "mode": "chat",
          "instance_folder": "/home/ixi/khacloud/drive/Plugins/VeilCli/test/ai-completion-test-api/record-workspaces/model-patch-mid-session",
          "status": "active",
          "model": "moonshotai/kimi-k2.5",
          "title": null,
          "message_count": 2,
          "total_input_tokens": 2935,
          "total_output_tokens": 29,
          "total_cache_tokens": 2560,
          "context_size": 2964,
          "context_size_limit": 262144,
          "cost": 0.0007605675,
          "compaction_count": 0,
          "created_at": "2026-06-11T20:31:03.782Z",
          "updated_at": "2026-06-11T20:31:05.865Z",
          "model_thinking": null,
          "compact_summary": null,
          "compact_size": 0,
          "compact_count": 50,
          "compact_auto_threshold": null,
          "compact_enabled": 1,
          "compact_model": "default",
          "compact_custom_instructions": null,
          "temperature": null,
          "max_tokens": null,
          "reasoning": "{\"effort\":\"low\"}",
          "parent_session_id": null,
          "instance_name": null,
          "objective": null,
          "success_criteria": null,
          "token_budget": null,
          "max_wall_seconds": null,
          "max_spawn_depth": null,
          "spawn_depth": 0,
          "trace_id": "trace_4ecac71ebab4d147",
          "claude_session_id": null,
          "effort": null
        },
        "agentName": "helper",
        "model": "moonshotai/kimi-k2.5",
        "iterations": 1,
        "durationMs": 2078,
        "tokenUsage": {
          "input": 2935,
          "output": 29,
          "cache": 2560,
          "cost": 0.0007605675
        },
        "toolCalls": [],
        "cancelled": false
      },
      "_rxAt": 1781209865867,
      "_seq": 55
    },
    {
      "type": "chat.user_message",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "content": "Reply with exactly: SECOND-MODEL-OK",
        "timestamp": 1781209865884
      },
      "_rxAt": 1781209865885,
      "_seq": 56
    },
    {
      "type": "chat.event",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "type": "iteration.start",
        "iteration": 1,
        "tokensSoFar": 0,
        "timestamp": 1781209865885
      },
      "_rxAt": 1781209865886,
      "_seq": 57
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "SE"
      },
      "_rxAt": 1781209868212,
      "_seq": 58
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "COND"
      },
      "_rxAt": 1781209868213,
      "_seq": 59
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "-M"
      },
      "_rxAt": 1781209868289,
      "_seq": 60
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "ODEL"
      },
      "_rxAt": 1781209868289,
      "_seq": 61
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "-"
      },
      "_rxAt": 1781209868395,
      "_seq": 62
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": "OK"
      },
      "_rxAt": 1781209868395,
      "_seq": 63
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209868396,
      "_seq": 64
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "inference.chunk",
      "data": {
        "content": ""
      },
      "_rxAt": 1781209868396,
      "_seq": 65
    },
    {
      "type": "chat.message",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "id": 4,
        "session_id": "sess_1203ebc87c71c62c",
        "role": "assistant",
        "content": "SECOND-MODEL-OK",
        "tool_calls": null,
        "tool_call_id": null,
        "thinking_content": null,
        "thinking_tokens": null,
        "created_at": "2026-06-11T20:31:08.396Z",
        "finishReason": "stop",
        "iteration": 1,
        "tokenUsage": {
          "input": 4013,
          "output": 6,
          "cache": 0,
          "cost": 0.0022781979
        },
        "timestamp": 1781209868397
      },
      "_rxAt": 1781209868397,
      "_seq": 66
    },
    {
      "type": "chat.response",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "event": {
        "content": "SECOND-MODEL-OK",
        "toolCount": 0,
        "timestamp": 1781209868397
      },
      "_rxAt": 1781209868397,
      "_seq": 67
    },
    {
      "type": "session.stream",
      "sessionId": "sess_1203ebc87c71c62c",
      "agentName": "helper",
      "eventType": "done",
      "data": {
        "session": {
          "id": "sess_1203ebc87c71c62c",
          "agent_name": "helper",
          "mode": "chat",
          "instance_folder": "/home/ixi/khacloud/drive/Plugins/VeilCli/test/ai-completion-test-api/record-workspaces/model-patch-mid-session",
          "status": "active",
          "model": "moonshotai/kimi-k2",
          "title": null,
          "message_count": 4,
          "total_input_tokens": 4013,
          "total_output_tokens": 6,
          "total_cache_tokens": 0,
          "context_size": 4019,
          "context_size_limit": 131072,
          "cost": 0.0022781979,
          "compaction_count": 0,
          "created_at": "2026-06-11T20:31:03.782Z",
          "updated_at": "2026-06-11T20:31:08.396Z",
          "model_thinking": null,
          "compact_summary": null,
          "compact_size": 0,
          "compact_count": 50,
          "compact_auto_threshold": null,
          "compact_enabled": 1,
          "compact_model": "default",
          "compact_custom_instructions": null,
          "temperature": null,
          "max_tokens": null,
          "reasoning": "{\"effort\":\"low\"}",
          "parent_session_id": null,
          "instance_name": null,
          "objective": null,
          "success_criteria": null,
          "token_budget": null,
          "max_wall_seconds": null,
          "max_spawn_depth": null,
          "spawn_depth": 0,
          "trace_id": "trace_4ecac71ebab4d147",
          "claude_session_id": null,
          "effort": null
        },
        "agentName": "helper",
        "model": "moonshotai/kimi-k2",
        "iterations": 1,
        "durationMs": 2512,
        "tokenUsage": {
          "input": 4013,
          "output": 6,
          "cache": 0,
          "cost": 0.0022781979
        },
        "toolCalls": [],
        "cancelled": false
      },
      "_rxAt": 1781209868397,
      "_seq": 68
    }
  ]
}