66from pathlib import Path
77
88from ...heartbeat_prompt import build_heartbeat_prompt
9+ from ..quota .cli_projection import compact_quota_should_run_cli_payload
910from ..quota .effective_action import EffectiveAction
11+ from .action_portfolio_scenarios import external_wait_fallback_scenario_source
1012from .model_tool_behavior import DoubaoExecToolClient
1113
1214
1315def cases () -> list [dict ]:
1416 # Independent semantic oracle: silence does not cancel work; a gate does;
15- # required vision replan is not terminal closure. Never send expected to
16- # the model, or derive it from the renderer being qualified.
17+ # required vision replan is not terminal closure. An already-transitioned
18+ # external wait selects its independent fallback for work. Never send
19+ # expected to the model, or derive it from the renderer being qualified.
1720 rows = (
18- ("quiet_work" , True , False , False , False , "work" ),
19- ("notifying_wait" , False , True , False , False , "wait" ),
20- ("quiet_wait" , False , False , False , False , "wait" ),
21- ("vision_replan" , True , False , True , False , "replan" ),
22- ("external_wait_transition" , True , False , False , True , "external_wait" ),
21+ ("quiet_work" , True , False , False , "work" ),
22+ ("notifying_wait" , False , True , False , "wait" ),
23+ ("quiet_wait" , False , False , False , "wait" ),
24+ ("vision_replan" , True , False , True , "replan" ),
2325 )
24- return [{
26+ probes = [{
2527 "id" : name ,
2628 "packet" : {
2729 "ok" : True ,
@@ -33,13 +35,6 @@ def cases() -> list[dict]:
3335 "execution_obligation" : {"must_attempt_work" : work },
3436 "heartbeat_recommendation" : {"agent_must_attempt" : work },
3537 "autonomous_replan_obligation" : {"required" : replan },
36- "external_wait_observation" : ({
37- "schema_version" : "typed_external_wait_observation_v0" ,
38- "selected_todo_id" : "todo_waiting" ,
39- "monitor_todo_id" : "todo_monitor" ,
40- "independent_successor_todo_id" : "todo_successor" ,
41- "state" : "external_review_pending" ,
42- } if external_wait else None ),
4338 "interaction_contract" : {
4439 "user_channel" : {"notify" : "NOTIFY" if notify else "DONT_NOTIFY" },
4540 "agent_channel" : {"delivery_allowed" : work and not replan },
@@ -49,7 +44,13 @@ def cases() -> list[dict]:
4944 "run_history" : {"latest_runs" : [{"delivery_outcome" : "outcome_progress" }]},
5045 },
5146 "expected" : {"action" : action , "notify" : notify , "finish_goal" : False },
52- } for name , work , notify , replan , external_wait , action in rows ]
47+ } for name , work , notify , replan , action in rows ]
48+ probes .append ({
49+ "id" : "wait_fallback_work" ,
50+ "packet" : compact_quota_should_run_cli_payload (external_wait_fallback_scenario_source ()),
51+ "expected" : {"action" : "work" , "notify" : True , "finish_goal" : False },
52+ })
53+ return probes
5354
5455
5556def probe_messages (mode : str , packet : dict ) -> list [dict ]:
0 commit comments