Support runtime guidance tool interrupts

This commit is contained in:
wuyang6
2026-06-23 15:20:59 +08:00
parent 712bccf814
commit 45792c8fd5
10 changed files with 955 additions and 24 deletions
+22
View File
@@ -3426,6 +3426,16 @@ def _runtime_event_stage(event: dict[str, object]) -> str:
return '等待用户 review'
if event_type == 'continuation_request':
return '继续补全回复'
if event_type == 'runtime_guidance_injected':
return '已吸收运行中引导'
if event_type == 'runtime_guidance_replan_before_tools':
return '引导已触发工具前重规划'
if event_type == 'runtime_guidance_interrupt_tool':
return '引导已中断当前工具'
if event_type == 'runtime_guidance_deferred_after_tool':
return '引导将在工具后重规划'
if event_type == 'runtime_guidance_error':
return '运行中引导处理失败'
if event_type in {
'prompt_length_check',
'prompt_length_recovery',
@@ -3449,6 +3459,11 @@ _RUN_EVENT_TYPES = {
'final_text_end',
'user_review_required',
'continuation_request',
'runtime_guidance_injected',
'runtime_guidance_replan_before_tools',
'runtime_guidance_interrupt_tool',
'runtime_guidance_deferred_after_tool',
'runtime_guidance_error',
'prompt_length_check',
'prompt_length_recovery',
'auto_compact_summary',
@@ -3478,12 +3493,19 @@ def _normalize_run_event(event: dict[str, object]) -> dict[str, Any] | None:
'reason',
'continuation_index',
'turn_index',
'stage',
'input_ids',
'count',
'tool_call_count',
'tool_names',
'message',
'strategy',
'projected_input_tokens',
'soft_input_limit_tokens',
'hard_input_limit_tokens',
'exceeds_hard_limit',
'exceeds_soft_limit',
'killed_processes',
}
normalized = {
key: _json_safe_limited(value, parent_key=key)