preserve artifact request contract in native traces

This commit is contained in:
pewdiepie-archdaemon
2026-09-18 15:31:57 +00:00
parent afbab148f2
commit dff88f4fb0
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -4438,7 +4438,10 @@ async def stream_preview(*, endpoint_url, model, messages, headers, turn_contrac
request = provider_compatible_tool_choice_request(request, model)
if artifact_write_phase and not successful_artifact_write:
yield event({
'type': 'provider_request_contract',
# Reuse the native runner's preserved step event family
# so request-boundary diagnostics survive normalization.
'type': 'agent_step',
'stage': 'provider_request',
'round': round_number,
'artifact_write_phase': True,
'offered_tools': [
+2 -1
View File
@@ -4705,7 +4705,8 @@ async def test_native_stream_reserves_remaining_budget_for_required_artifact(mon
assert recovery["calls_used"] == module.NATIVE_ARTIFACT_RESEARCH_LIMIT
request_contract = next(
event for event in events
if event.get("type") == "provider_request_contract"
if event.get("type") == "agent_step"
and event.get("stage") == "provider_request"
and event.get("artifact_write_phase") is True
)
assert "write_file" in request_contract["offered_tools"]