The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(session_compat): update fixture timestamps and add turn usage metadata
Steven Enamakeld6cc3407eeb7
diff --git a/tests/fixtures/session_compat/compaction_record.golden.json b/tests/fixtures/session_compat/compaction_record.golden.jsonindex 21f925ba1d..4c9a145377 100644--- a/tests/fixtures/session_compat/compaction_record.golden.json+++ b/tests/fixtures/session_compat/compaction_record.golden.json@@ -13,7 +13,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree"+ "text": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree"}]}@@ -40,7 +40,7 @@"role": "system"},{- "content": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree",+ "content": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -53,6 +53,20 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 1,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:46.671759964+00:00",+ "usage": {+ "cached_input": 100,+ "context_window": 0,+ "cost_usd": 0.000015948,+ "input": 120,+ "output": 30+ }}},"role": "assistant"diff --git a/tests/fixtures/session_compat/compaction_record.jsonl b/tests/fixtures/session_compat/compaction_record.jsonlindex 0d4f2c5973..bcff736479 100644--- a/tests/fixtures/session_compat/compaction_record.jsonl+++ b/tests/fixtures/session_compat/compaction_record.jsonl@@ -1,15 +1,15 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.360937087+00:00","updated":"2026-10-01T06:05:16.395404258+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.579599206+00:00","updated":"2026-10-01T06:17:46.608960378+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}-{"role":"assistant","content":"alpha"}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.395614358+00:00"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}-{"role":"assistant","content":"beta"}-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.360937087+00:00","updated":"2026-10-01T06:05:16.432618626+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.432926928+00:00"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree"}-{"role":"assistant","content":"gamma"}-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.360937087+00:00","updated":"2026-10-01T06:05:16.469077076+00:00","turn_count":3,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.469455465+00:00"}-{"kind":"compaction","replacement":[{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"},{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree"},{"role":"assistant","content":"gamma"}],"ts":"2026-10-01T06:05:16.470761820+00:00"}-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.360937087+00:00","updated":"2026-10-01T06:05:16.469077076+00:00","turn_count":3,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}+{"role":"assistant","content":"alpha","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.608907403+00:00"}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.609161928+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}+{"role":"assistant","content":"beta","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.642026509+00:00"}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.579599206+00:00","updated":"2026-10-01T06:17:46.642040223+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.642316342+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree"}+{"role":"assistant","content":"gamma","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.671759964+00:00"}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.579599206+00:00","updated":"2026-10-01T06:17:46.671773308+00:00","turn_count":3,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.672099063+00:00"}+{"kind":"compaction","replacement":[{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"},{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nthree"},{"role":"assistant","content":"gamma","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.671759964+00:00"}],"ts":"2026-10-01T06:17:46.673193932+00:00"}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.579599206+00:00","updated":"2026-10-01T06:17:46.671773308+00:00","turn_count":3,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-compaction_record","session_id":"compat-compaction_record-c401cfbe1896b06501696d1cb1740f35.main-1f5962a2ce9803c8c2aef6860ee289f8"}}diff --git a/tests/fixtures/session_compat/generation_chain.g0.jsonl b/tests/fixtures/session_compat/generation_chain.g0.jsonlindex f07d24f245..8cff99be29 100644--- a/tests/fixtures/session_compat/generation_chain.g0.jsonl+++ b/tests/fixtures/session_compat/generation_chain.g0.jsonl@@ -1,9 +1,9 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.474181244+00:00","updated":"2026-10-01T06:05:16.498663196+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-generation_chain","session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.676267581+00:00","updated":"2026-10-01T06:17:46.701521793+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-generation_chain","session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}-{"role":"assistant","content":"alpha"}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.498871765+00:00"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}-{"role":"assistant","content":"beta"}-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.474181244+00:00","updated":"2026-10-01T06:05:16.528571858+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-generation_chain","session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8"}}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.528844466+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}+{"role":"assistant","content":"alpha","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.701468652+00:00"}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.701730622+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}+{"role":"assistant","content":"beta","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.734640616+00:00"}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.676267581+00:00","updated":"2026-10-01T06:17:46.734656713+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-generation_chain","session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.735057341+00:00"}diff --git a/tests/fixtures/session_compat/generation_chain.g1.jsonl b/tests/fixtures/session_compat/generation_chain.g1.jsonlindex c42582905d..da2dfec047 100644--- a/tests/fixtures/session_compat/generation_chain.g1.jsonl+++ b/tests/fixtures/session_compat/generation_chain.g1.jsonl@@ -1,4 +1,4 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.474181244+00:00","updated":"2026-10-01T06:05:16.528571858+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-generation_chain","session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8.g1","parent_session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.676267581+00:00","updated":"2026-10-01T06:17:46.734656713+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-generation_chain","session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8.g1","parent_session_id":"compat-generation_chain-44af950735b13f36d45f412fd30e0ba6.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}-{"role":"assistant","content":"beta"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}+{"role":"assistant","content":"beta","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.734640616+00:00"}diff --git a/tests/fixtures/session_compat/generation_chain.golden.json b/tests/fixtures/session_compat/generation_chain.golden.jsonindex 13893d1681..89cdadf521 100644--- a/tests/fixtures/session_compat/generation_chain.golden.json+++ b/tests/fixtures/session_compat/generation_chain.golden.json@@ -13,7 +13,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"+ "text": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}]}@@ -40,7 +40,7 @@"role": "system"},{- "content": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo",+ "content": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -53,6 +53,20 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 1,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:46.734640616+00:00",+ "usage": {+ "cached_input": 100,+ "context_window": 0,+ "cost_usd": 0.000015948,+ "input": 120,+ "output": 30+ }}},"role": "assistant"diff --git a/tests/fixtures/session_compat/image_user.golden.json b/tests/fixtures/session_compat/image_user.golden.jsonindex d2ce555464..1c74a5075d 100644--- a/tests/fixtures/session_compat/image_user.golden.json+++ b/tests/fixtures/session_compat/image_user.golden.json@@ -13,7 +13,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nlook"+ "text": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nlook"},{"image": {@@ -49,7 +49,7 @@"role": "system"},{- "content": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nlook [IMAGE:data:image/png;base64,iVBORw0KGgo=] please",+ "content": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nlook [IMAGE:data:image/png;base64,iVBORw0KGgo=] please","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -62,6 +62,20 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 1,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:46.507702767+00:00",+ "usage": {+ "cached_input": 100,+ "context_window": 0,+ "cost_usd": 0.000015948,+ "input": 120,+ "output": 30+ }}},"role": "assistant"diff --git a/tests/fixtures/session_compat/image_user.jsonl b/tests/fixtures/session_compat/image_user.jsonlindex c29d8b112c..fc73930e25 100644--- a/tests/fixtures/session_compat/image_user.jsonl+++ b/tests/fixtures/session_compat/image_user.jsonl@@ -1,5 +1,5 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.255101707+00:00","updated":"2026-10-01T06:05:16.279967233+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-image_user","session_id":"compat-image_user-f13b7b316b8721efc95746c399791cbf.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.479336587+00:00","updated":"2026-10-01T06:17:46.507756355+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-image_user","session_id":"compat-image_user-f13b7b316b8721efc95746c399791cbf.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nlook [IMAGE:data:image/png;base64,iVBORw0KGgo=] please"}-{"role":"assistant","content":"saw it"}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.280258318+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nlook [IMAGE:data:image/png;base64,iVBORw0KGgo=] please"}+{"role":"assistant","content":"saw it","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.507702767+00:00"}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.507955156+00:00"}diff --git a/tests/fixtures/session_compat/native_tools.golden.json b/tests/fixtures/session_compat/native_tools.golden.jsonindex a2880be74d..3e5e9f6ce0 100644--- a/tests/fixtures/session_compat/native_tools.golden.json+++ b/tests/fixtures/session_compat/native_tools.golden.json@@ -13,7 +13,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nuse the tools"+ "text": "Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nuse the tools"}]}@@ -80,7 +80,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nand again"+ "text": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nand again"}]}@@ -107,7 +107,7 @@"role": "system"},{- "content": "Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nuse the tools",+ "content": "Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nuse the tools","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -153,12 +153,26 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 2,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:46.446471589+00:00",+ "usage": {+ "cached_input": 200,+ "context_window": 0,+ "cost_usd": 0.000031896,+ "input": 240,+ "output": 60+ }}},"role": "assistant"},{- "content": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nand again",+ "content": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nand again","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -171,6 +185,20 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 1,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:46.475167808+00:00",+ "usage": {+ "cached_input": 100,+ "context_window": 0,+ "cost_usd": 0.000015948,+ "input": 120,+ "output": 30+ }}},"role": "assistant"diff --git a/tests/fixtures/session_compat/native_tools.jsonl b/tests/fixtures/session_compat/native_tools.jsonlindex 5483d85d9c..7e0189de91 100644--- a/tests/fixtures/session_compat/native_tools.jsonl+++ b/tests/fixtures/session_compat/native_tools.jsonl@@ -1,12 +1,12 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:15.483091563+00:00","updated":"2026-10-01T06:05:16.210680114+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-native_tools","session_id":"compat-native_tools-e43c24fc75713ff56867e8b21877c7e5.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:45.795119914+00:00","updated":"2026-10-01T06:17:46.446525219+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-native_tools","session_id":"compat-native_tools-e43c24fc75713ff56867e8b21877c7e5.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nuse the tools"}-{"role":"assistant","content":"{\"content\":\"checking\",\"tool_calls\":[{\"arguments\":\"{\\\"q\\\":\\\"hi\\\"}\",\"id\":\"call_echo\",\"name\":\"echo\"},{\"arguments\":\"{}\",\"id\":\"call_boom\",\"name\":\"boom\"}]}","extra_metadata":{"reasoning_content":"plan the calls"},"reasoning_content":"plan the calls","tool_calls":[{"id":"call_echo","name":"echo","arguments":"{\"q\":\"hi\"}"},{"id":"call_boom","name":"boom","arguments":"{}"}]}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nuse the tools"}+{"role":"assistant","content":"{\"content\":\"checking\",\"tool_calls\":[{\"arguments\":\"{\\\"q\\\":\\\"hi\\\"}\",\"id\":\"call_echo\",\"name\":\"echo\"},{\"arguments\":\"{}\",\"id\":\"call_boom\",\"name\":\"boom\"}]}","extra_metadata":{"reasoning_content":"plan the calls"},"reasoning_content":"plan the calls","tool_calls":[{"id":"call_echo","name":"echo","arguments":"{\"q\":\"hi\"}"},{"id":"call_boom","name":"boom","arguments":"{}"}],"iteration":1,"ts":"2026-10-01T06:17:46.446471589+00:00"}{"id":"call_echo","role":"tool","content":"{\"content\":\"echo:{\\\"q\\\":\\\"hi\\\"}\",\"tool_call_id\":\"call_echo\"}"}{"id":"call_boom","role":"tool","content":"{\"content\":\"boom: exit 1\",\"tool_call_id\":\"call_boom\"}","failure":true}-{"role":"assistant","content":"done with tools"}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.211041332+00:00"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nand again"}-{"role":"assistant","content":"second turn"}-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:15.483091563+00:00","updated":"2026-10-01T06:05:16.250102398+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-native_tools","session_id":"compat-native_tools-e43c24fc75713ff56867e8b21877c7e5.main-1f5962a2ce9803c8c2aef6860ee289f8"}}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.250549477+00:00"}+{"role":"assistant","content":"done with tools","provider":"","model":"","usage":{"input":240,"output":60,"cached_input":200,"context_window":0,"cost_usd":0.000031896},"iteration":2,"ts":"2026-10-01T06:17:46.446471589+00:00"}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.446772868+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nand again"}+{"role":"assistant","content":"second turn","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:46.475167808+00:00"}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:45.795119914+00:00","updated":"2026-10-01T06:17:46.475197917+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-native_tools","session_id":"compat-native_tools-e43c24fc75713ff56867e8b21877c7e5.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.475530583+00:00"}diff --git a/tests/fixtures/session_compat/plain.golden.json b/tests/fixtures/session_compat/plain.golden.jsonindex ee288616f1..93dc94ba16 100644--- a/tests/fixtures/session_compat/plain.golden.json+++ b/tests/fixtures/session_compat/plain.golden.json@@ -13,7 +13,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"+ "text": "Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}]}@@ -32,7 +32,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"+ "text": "Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}]}@@ -59,7 +59,7 @@"role": "system"},{- "content": "Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none",+ "content": "Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -72,12 +72,26 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 1,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:45.762382535+00:00",+ "usage": {+ "cached_input": 100,+ "context_window": 0,+ "cost_usd": 0.000015948,+ "input": 120,+ "output": 30+ }}},"role": "assistant"},{- "content": "Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo",+ "content": "Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -90,6 +104,20 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 1,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:45.790957654+00:00",+ "usage": {+ "cached_input": 100,+ "context_window": 0,+ "cost_usd": 0.000015948,+ "input": 120,+ "output": 30+ }}},"role": "assistant"diff --git a/tests/fixtures/session_compat/plain.jsonl b/tests/fixtures/session_compat/plain.jsonlindex 83e8e92d5f..d7f3907426 100644--- a/tests/fixtures/session_compat/plain.jsonl+++ b/tests/fixtures/session_compat/plain.jsonl@@ -1,9 +1,9 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:15.403507521+00:00","updated":"2026-10-01T06:05:15.445579814+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-plain","session_id":"compat-plain-b58d0d9bde5033a22ee97c1a1a4e18b2.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:45.717094947+00:00","updated":"2026-10-01T06:17:45.762442793+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-plain","session_id":"compat-plain-b58d0d9bde5033a22ee97c1a1a4e18b2.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n## Tool Use Protocol\n\nWhen you need a tool, call it in this response through native tool-calling.\nA short line saying what you are about to do is fine, but the tool call must be in the same message; never end a turn on an announcement.\nAfter the results arrive, keep going until you can give the final answer.\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}-{"role":"assistant","content":"alpha"}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:15.445841866+00:00"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:15 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}-{"role":"assistant","content":"beta"}-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:15.403507521+00:00","updated":"2026-10-01T06:05:15.478920975+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-plain","session_id":"compat-plain-b58d0d9bde5033a22ee97c1a1a4e18b2.main-1f5962a2ce9803c8c2aef6860ee289f8"}}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:15.479190722+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\none"}+{"role":"assistant","content":"alpha","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:45.762382535+00:00"}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:45.762649939+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:45 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\ntwo"}+{"role":"assistant","content":"beta","provider":"","model":"","usage":{"input":120,"output":30,"cached_input":100,"context_window":0,"cost_usd":0.000015948},"iteration":1,"ts":"2026-10-01T06:17:45.790957654+00:00"}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"native","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:45.717094947+00:00","updated":"2026-10-01T06:17:45.790970214+00:00","turn_count":2,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-plain","session_id":"compat-plain-b58d0d9bde5033a22ee97c1a1a4e18b2.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:45.791225965+00:00"}diff --git a/tests/fixtures/session_compat/subagent_checkpoint.golden.json b/tests/fixtures/session_compat/subagent_checkpoint.golden.jsonnew file mode 100644index 0000000000..bb40ad59a1--- /dev/null+++ b/tests/fixtures/session_compat/subagent_checkpoint.golden.json@@ -0,0 +1,64 @@+[+ {+ "system": {+ "content": [+ {+ "text": "You are the researcher."+ }+ ]+ }+ },+ {+ "user": {+ "content": [+ {+ "text": "find the answer"+ },+ {+ "image": {+ "mime_type": "image/png",+ "url": "data:image/png;base64,iVBORw0KGgo="+ }+ }+ ]+ }+ },+ {+ "assistant": {+ "content": [+ {+ "text": "looking"+ }+ ],+ "tool_calls": [+ {+ "arguments": {+ "question": "which year?"+ },+ "id": "call_q",+ "name": "ask_user_clarification"+ }+ ]+ }+ },+ {+ "tool": {+ "content": [+ {+ "text": "awaiting user"+ }+ ],+ "tool_call_id": "call_q"+ }+ },+ {+ "assistant": {+ "content": [+ {+ "text": "plain prose turn"+ }+ ],+ "tool_calls": []+ }+ }+]diff --git a/tests/fixtures/session_compat/subagent_sessions.golden.json b/tests/fixtures/session_compat/subagent_sessions.golden.jsonnew file mode 100644index 0000000000..76609b10d4--- /dev/null+++ b/tests/fixtures/session_compat/subagent_sessions.golden.json@@ -0,0 +1,56 @@+[+ {+ "system": {+ "content": [+ {+ "text": "You are the researcher."+ }+ ]+ }+ },+ {+ "user": {+ "content": [+ {+ "text": "find the answer"+ }+ ]+ }+ },+ {+ "assistant": {+ "content": [+ {+ "text": ""+ }+ ],+ "tool_calls": [+ {+ "arguments": {},+ "id": "call_s",+ "name": "search"+ }+ ]+ }+ },+ {+ "tool": {+ "content": [+ {+ "text": "found"+ }+ ],+ "tool_call_id": "call_s"+ }+ },+ {+ "assistant": {+ "content": [+ {+ "text": "answer"+ }+ ],+ "tool_calls": []+ }+ }+]diff --git a/tests/fixtures/session_compat/xml_tools.golden.json b/tests/fixtures/session_compat/xml_tools.golden.jsonindex 509fa9b3aa..be968563ae 100644--- a/tests/fixtures/session_compat/xml_tools.golden.json+++ b/tests/fixtures/session_compat/xml_tools.golden.json@@ -13,7 +13,7 @@"user": {"content": [{- "text": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nxml please"+ "text": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nxml please"}]}@@ -32,7 +32,7 @@"user": {"content": [{- "text": "[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n"+ "text": "[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n"}]}@@ -51,7 +51,7 @@"user": {"content": [{- "text": "[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n"+ "text": "[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n"}]}@@ -78,7 +78,7 @@"role": "system"},{- "content": "Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nxml please",+ "content": "Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nxml please","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -99,11 +99,11 @@"tool_calls": [{"arguments": "{\"q\":\"x\"}",- "id": "openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-1-tool-1",+ "id": "openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-1-tool-1","name": "echo"}],- "ts": "2026-10-01T06:05:16.354620387+00:00",+ "ts": "2026-10-01T06:17:46.575429416+00:00","usage": {"cached_input": 0,"context_window": 0,@@ -116,7 +116,7 @@"role": "assistant"},{- "content": "[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n",+ "content": "[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n","extra_metadata": {"openhuman_replayed": {"request_id": null@@ -137,11 +137,11 @@"tool_calls": [{"arguments": "{}",- "id": "openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1",+ "id": "openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1","name": "boom"}],- "ts": "2026-10-01T06:05:16.354636990+00:00",+ "ts": "2026-10-01T06:17:46.575440989+00:00","usage": {"cached_input": 0,"context_window": 0,@@ -154,13 +154,13 @@"role": "assistant"},{- "content": "[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n",+ "content": "[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n","extra_metadata": {"openhuman_replayed": {"request_id": null},"openhuman_tool_failures": [- "openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1"+ "openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1"]},"role": "user"@@ -170,6 +170,20 @@"extra_metadata": {"openhuman_replayed": {"request_id": null+ },+ "openhuman_turn_usage": {+ "iteration": 3,+ "model": "",+ "provider": "",+ "tool_calls": [],+ "ts": "2026-10-01T06:17:46.575446819+00:00",+ "usage": {+ "cached_input": 300,+ "context_window": 0,+ "cost_usd": 0.000047844,+ "input": 360,+ "output": 90+ }}},"role": "assistant"@@ -208,7 +222,7 @@"user": {"content": [{- "text": "[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n"+ "text": "[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n"}]}@@ -227,7 +241,7 @@"user": {"content": [{- "text": "[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n"+ "text": "[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n"}]}diff --git a/tests/fixtures/session_compat/xml_tools.jsonl b/tests/fixtures/session_compat/xml_tools.jsonlindex 5bf512151d..11e3367285 100644--- a/tests/fixtures/session_compat/xml_tools.jsonl+++ b/tests/fixtures/session_compat/xml_tools.jsonl@@ -1,9 +1,9 @@-{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"xml","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:05:16.284328993+00:00","updated":"2026-10-01T06:05:16.354709605+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-xml_tools","session_id":"compat-xml_tools-0e4ef2b226534cef4ef8a1fed4be449f.main-1f5962a2ce9803c8c2aef6860ee289f8"}}+{"_meta":{"version":1,"agent":"main","agent_id":"main","agent_type":"root","dispatcher":"xml","model":"openrouter/deepseek/deepseek-v4-flash","created":"2026-10-01T06:17:46.511654057+00:00","updated":"2026-10-01T06:17:46.575495743+00:00","turn_count":1,"prefix_message_count":1,"input_tokens":0,"output_tokens":0,"cached_input_tokens":0,"charged_amount_usd":0.0,"thread_id":"compat-xml_tools","session_id":"compat-xml_tools-0e4ef2b226534cef4ef8a1fed4be449f.main-1f5962a2ce9803c8c2aef6860ee289f8"}}{"role":"system","content":"### SOUL.md\n\n# OpenHuman\n\nYou are OpenHuman, the user's AI teammate on their own machine. Warm, direct, no filler; say \"I'm not sure\" rather than guess. The user drives. When something fails, try another way, then say what failed.\n\n## When OpenHuman is criticized\n\nOwn real limits plainly. Don't validate FUD: ask what they actually hit, or correct it with specifics.\n\n### IDENTITY.md\n\n# Identity\n\nPrivacy first. Never invent metrics or integration data; say whether an answer came from a tool, memory or general knowledge.\n\n\n## Tool Use Protocol\n\nTo use a tool, wrap a JSON object in <tool_call></tool_call> tags:\n\n```\n<tool_call>\n{\"name\": \"tool_name\", \"arguments\": {\"param\": \"value\"}}\n</tool_call>\n```\n\nYou may emit multiple tool calls in a single response. After execution, results appear in <tool_result> tags. Continue reasoning with the results until you can give a final answer.\n\n### Available Tools\n\n- **echo**: echoes\n Parameters: `{\"properties\":{\"q\":{\"type\":\"string\"}},\"type\":\"object\"}`\n- **boom**: always fails\n Parameters: `{\"type\":\"object\"}`\n\n## Safety\n\n- Do not exfiltrate private data.\n- Do not run destructive commands without asking.\n- Do not bypass oversight or approval mechanisms.\n- Prefer `trash` over `rm`.\n- When in doubt, ask before acting externally.\n\n## Current Date & Time\n\nThe `Current Date & Time:` line on the latest message is authoritative; match greetings and \"today\" to its local hour.\n\n## Grounding and tool use\n\n- Your tools are exactly the ones you have been given for this turn, whether they arrive as a tool list or are described in this prompt. You can only act through them. Check that list before saying you lack a capability, and if it is not there, say so plainly rather than pretending it exists.\n- Never invent tool names, arguments, ids, slugs, file paths, URLs, chain ids, addresses, quotes, metrics, or any other value. If you do not have it from a tool result or the user, ask for it or look it up with a tool.\n- Preserve numeric evidence exactly. For numbers, counts, sizes, dates, timestamps, durations, currencies, percentages, quotas, and ids, copy the exact value from the observed tool result, user message, or cited memory into your answer.\n- Do not round, convert units, rewrite relative times, or recalculate numeric values unless the user asks and you show the calculation from observed values. If sources disagree, name the discrepancy instead of choosing a plausible value.\n- Use your tools to act. Do not just describe what you would do and stop, and never end a turn with a promise of future action: do it now, or hand back a concrete result.\n- Never substitute plausible looking but fabricated output (made up data, invented file contents, synthesised tool or API responses) for results you could not actually produce. If a step failed, say it failed.\n- When a tool or delegated sub-agent hands back an incomplete or blocked result (for example a [SUBAGENT_INCOMPLETE] envelope), relay what it did accomplish and the blocker to the user. Do not present it as finished, fabricate the rest, or silently re-run the identical call: change the approach or ask the user.\n- Ground every factual claim in evidence you actually observed: a tool result, the user's message, or cited memory. If the evidence is missing, partial, or truncated, say so or fetch more instead of guessing.\n- Skills run only via `run_workflow`, and only the skills listed as installed exist. Do not invent skill ids.\n\n# Writing style\n\nText like a colleague: answer first, only useful context, no repeating the thread, emojis rarely. Never use em-dashes; use commas, colons or two sentences. Output for another agent is data: dense and complete.\n\n## Workspace\n\nTools resolve in `pwd`; outside it and scratch is blocked. Prefer stdout. Scratch: `/tmp/openhuman` or `$TMPDIR`, never `/tmp/<name>`.\n\n## Runtime\n\nHost: dragonfly | OS: linux | Model: openrouter/deepseek/deepseek-v4-flash"}-{"role":"user","content":"Current Date & Time: 2026-10-01 09:05:16 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nxml please"}-{"role":"assistant","content":"","provider":"","model":"","usage":{"input":0,"output":0,"cached_input":0,"context_window":0,"cost_usd":0.0},"tool_calls":[{"id":"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-1-tool-1","name":"echo","arguments":"{\"q\":\"x\"}"}],"iteration":1,"ts":"2026-10-01T06:05:16.354620387+00:00"}-{"role":"user","content":"[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n"}-{"role":"assistant","content":"","provider":"","model":"","usage":{"input":0,"output":0,"cached_input":0,"context_window":0,"cost_usd":0.0},"tool_calls":[{"id":"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1","name":"boom","arguments":"{}"}],"iteration":2,"ts":"2026-10-01T06:05:16.354636990+00:00"}-{"role":"user","content":"[Tool results]\n<tool_result id=\"openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n","extra_metadata":{"openhuman_tool_failures":["openhuman-session-9ac7adf1-0830-4147-9c45-b214c859ea10-model-2-tool-1"]}}-{"role":"assistant","content":"xml done"}-{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:05:16.355102953+00:00"}+{"role":"user","content":"Current Date & Time: 2026-10-01 09:17:46 Asia/Kuwait (+03:00, UTC+03:00), Thursday\n\nxml please"}+{"role":"assistant","content":"","provider":"","model":"","usage":{"input":0,"output":0,"cached_input":0,"context_window":0,"cost_usd":0.0},"tool_calls":[{"id":"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-1-tool-1","name":"echo","arguments":"{\"q\":\"x\"}"}],"iteration":1,"ts":"2026-10-01T06:17:46.575429416+00:00"}+{"role":"user","content":"[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-1-tool-1\">\necho:{\"q\":\"x\"}\n</tool_result>\n"}+{"role":"assistant","content":"","provider":"","model":"","usage":{"input":0,"output":0,"cached_input":0,"context_window":0,"cost_usd":0.0},"tool_calls":[{"id":"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1","name":"boom","arguments":"{}"}],"iteration":2,"ts":"2026-10-01T06:17:46.575440989+00:00"}+{"role":"user","content":"[Tool results]\n<tool_result id=\"openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1\">\nboom: exit 1\n</tool_result>\n","extra_metadata":{"openhuman_tool_failures":["openhuman-session-a8589833-ab67-474a-9da9-0966bccc2d22-model-2-tool-1"]}}+{"role":"assistant","content":"xml done","provider":"","model":"","usage":{"input":360,"output":90,"cached_input":300,"context_window":0,"cost_usd":0.000047844},"iteration":3,"ts":"2026-10-01T06:17:46.575446819+00:00"}+{"kind":"tools","tools":[{"description":"always fails","name":"boom","parameters":{"type":"object"}},{"description":"echoes","name":"echo","parameters":{"properties":{"q":{"type":"string"}},"type":"object"}}],"ts":"2026-10-01T06:17:46.575744708+00:00"}