mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-06 21:22:23 +01:00
count artifact handoff once per response batch
This commit is contained in:
@@ -5471,6 +5471,7 @@ async def stream_preview(*, endpoint_url, model, messages, headers, turn_contrac
|
|||||||
if (
|
if (
|
||||||
repeated_handoff_target
|
repeated_handoff_target
|
||||||
and artifact_body_handoff_attempts < 2
|
and artifact_body_handoff_attempts < 2
|
||||||
|
and not artifact_body_handoff_target
|
||||||
):
|
):
|
||||||
artifact_body_handoff_attempts += 1
|
artifact_body_handoff_attempts += 1
|
||||||
artifact_body_handoff_target = repeated_handoff_target
|
artifact_body_handoff_target = repeated_handoff_target
|
||||||
|
|||||||
@@ -547,6 +547,11 @@ async def test_repeated_off_contract_calls_recover_via_required_artifact_body(mo
|
|||||||
'function': {'name': 'python', 'arguments': json.dumps({
|
'function': {'name': 'python', 'arguments': json.dumps({
|
||||||
'code': 'print("nope")',
|
'code': 'print("nope")',
|
||||||
})},
|
})},
|
||||||
|
}, {
|
||||||
|
'index': 1, 'id': 'bad-inspect-sibling',
|
||||||
|
'function': {'name': 'inspect_media', 'arguments': json.dumps({
|
||||||
|
'path': '/workspace/input.png',
|
||||||
|
})},
|
||||||
}]}}]},
|
}]}}]},
|
||||||
{'choices': [{'delta': {'content': ''}}]},
|
{'choices': [{'delta': {'content': ''}}]},
|
||||||
{'choices': [{'delta': {'content': '<html><body>Recovered</body></html>'}}]},
|
{'choices': [{'delta': {'content': '<html><body>Recovered</body></html>'}}]},
|
||||||
@@ -605,7 +610,7 @@ async def test_repeated_off_contract_calls_recover_via_required_artifact_body(mo
|
|||||||
event.get('type') == 'tool_output'
|
event.get('type') == 'tool_output'
|
||||||
and event.get('execution_attempted') is False
|
and event.get('execution_attempted') is False
|
||||||
for event in events
|
for event in events
|
||||||
) == 2
|
) == 3
|
||||||
assert any(
|
assert any(
|
||||||
event.get('type') == 'artifact_body_handoff'
|
event.get('type') == 'artifact_body_handoff'
|
||||||
and event.get('path') == '/workspace/output.html'
|
and event.get('path') == '/workspace/output.html'
|
||||||
|
|||||||
Reference in New Issue
Block a user