@@ -182,7 +182,7 @@ async def single_query(messages: list[dict[str, str]]) -> str:
182182 plan = asyncio .run (
183183 resolve_compound_control_plan (
184184 _messages (single ),
185- ({"task" : single },),
185+ ({"task" : "change only the last detail" },),
186186 (ALPHA , BETA ),
187187 complete = True ,
188188 query = single_query ,
@@ -193,6 +193,10 @@ async def single_query(messages: list[dict[str, str]]) -> str:
193193 assert len (plan .operations ) == 1
194194 assert plan .operations [0 ].action ["workspace_ref" ] == "work_alpha"
195195 assert plan .operations [0 ].action ["task" ] == single
196+ assert (
197+ plan .operations [0 ].action ["_host_payload_source" ]
198+ == "exact_current_user_clause"
199+ )
196200
197201 query_count = 0
198202
@@ -242,6 +246,74 @@ async def should_not_run(_messages: list[dict[str, str]]) -> str:
242246 assert never_called is False
243247
244248
249+ def test_confirmed_go_ahead_keeps_the_grounded_prior_payload () -> None :
250+ current = "那你现在开始做。"
251+
252+ async def query (messages : list [dict [str , str ]]) -> str :
253+ joined = "\n " .join (message ["content" ] for message in messages )
254+ if "[Compound control decomposition - FINAL]" in joined :
255+ return '{"clauses":["那你现在开始做。"]}'
256+ return (
257+ '{"decisions":[{"proposal_index":0,"provider":"codex",'
258+ '"intent":"execute","work_placement":"draft",'
259+ '"session_context":"unchanged","reference_mode":"none",'
260+ '"payload_continuity":"confirmed_prior_request"}]}'
261+ )
262+
263+ prior_payload = "Create the previously specified desktop game."
264+ plan = asyncio .run (
265+ resolve_compound_control_plan (
266+ _messages (current ),
267+ ({"task" : prior_payload },),
268+ (),
269+ complete = True ,
270+ query = query ,
271+ provider_ids = {"codex" },
272+ )
273+ )
274+
275+ assert plan .status == "ok"
276+ assert len (plan .operations ) == 1
277+ assert plan .operations [0 ].action ["task" ] == prior_payload
278+ assert plan .operations [0 ].action ["_host_payload_source" ] == (
279+ "confirmed_prior_request"
280+ )
281+
282+
283+ def test_one_desktop_game_request_does_not_dispatch_only_its_trailing_fragment () -> None :
284+ current = "你能帮我做一个植物大战僵尸的游戏嘛?画面还原一些,然后导出到桌面"
285+
286+ async def query (messages : list [dict [str , str ]]) -> str :
287+ joined = "\n " .join (message ["content" ] for message in messages )
288+ if "[Compound control decomposition - FINAL]" in joined :
289+ return '{"clauses":["' + current + '"]}'
290+ return (
291+ '{"decisions":[{"proposal_index":0,"provider":"codex",'
292+ '"intent":"execute","target":"desktop",'
293+ '"work_placement":"draft","session_context":"unchanged",'
294+ '"workspace_effect":"write","reference_mode":"none"}]}'
295+ )
296+
297+ plan = asyncio .run (
298+ resolve_compound_control_plan (
299+ _messages (current ),
300+ ({"task" : "画面还原一些,然后导出到桌面" },),
301+ (),
302+ complete = True ,
303+ query = query ,
304+ provider_ids = {"codex" },
305+ )
306+ )
307+
308+ assert plan .status == "ok"
309+ assert len (plan .operations ) == 1
310+ action = plan .operations [0 ].action
311+ assert action ["task" ] == current
312+ assert action ["target" ] == "desktop"
313+ assert action ["one_off" ] is True
314+ assert "project_id" not in action
315+
316+
245317def test_duplicate_context_constraints_collapse_without_provider_payload () -> None :
246318 current = "先回到草稿,后面的临时工作不要放进项目。"
247319
@@ -308,6 +380,8 @@ async def query(messages: list[dict[str, str]]) -> str:
308380 test_decomposition_enumerator_keeps_only_bounded_recent_history ()
309381 test_compound_plan_aligns_amend_and_report_to_different_work_items ()
310382 test_single_action_and_no_action_paths_do_not_gain_operations ()
383+ test_confirmed_go_ahead_keeps_the_grounded_prior_payload ()
384+ test_one_desktop_game_request_does_not_dispatch_only_its_trailing_fragment ()
311385 test_duplicate_context_constraints_collapse_without_provider_payload ()
312386 test_malformed_decomposition_gets_one_bounded_retry ()
313387 print ("all compound control shadow tests passed" )
0 commit comments