@@ -133,28 +133,46 @@ def test_plan_revision_acceptance_is_versioned_and_idempotent(self):
133133
134134 def test_provider_plan_text_cannot_duplicate_an_accepted_checklist (self ):
135135 previous_tasks = main .tasks
136+ previous_controller = main ._interaction_controller
136137 manager = TaskManager (self .store , workspace_id = "workspace" , session_id = "session" )
137138 proposal = self .controller .propose_plan ({
138139 "title" : "Eight steps" , "summary" : "Execute once." , "assumptions" : [],
139140 "steps" : [
140141 {"id" : f"step-{ index } " , "title" : f"Step { index } " ,
141- "description" : f"Perform step { index } ." , "acceptance" : [f"Step { index } done" ]}
142+ "description" : (
143+ "Create index.html with the requested content."
144+ if index == 0 else f"Perform step { index } ."
145+ ), "acceptance" : [f"Step { index } done" ]}
142146 for index in range (8 )
143147 ],
144148 })
145149 self .controller .accept_plan (
146150 manager , plan_id = proposal ["plan_id" ], version = proposal ["version" ],
147151 )
148152 main .tasks = manager
153+ main ._interaction_controller = self .controller
154+ mode_token = main ._active_interaction_mode .set ("agent" )
149155 try :
150156 repeated = "Plan:\n " + "\n " .join (
151157 f"{ index } . Perform step { index } ." for index in range (1 , 9 )
152158 )
153159 main ._tasks_from_plan (repeated )
154160 main ._tasks_from_plan (repeated )
161+ main ._observe_model_response (
162+ "TaskList:\n ```json\n "
163+ + json .dumps ([f"Use run_cmd to perform step { index } " for index in range (1 , 9 )])
164+ + "\n ```"
165+ )
155166 self .assertEqual (len (manager .tasks ), 8 )
167+ evidence = manager .record_evidence (
168+ action = "write_file" , args = "index.html|ready" , result = "Wrote index.html" , success = True ,
169+ )
170+ self .assertEqual (evidence ["task_id" ], manager .tasks [0 ]["id" ])
171+ self .assertEqual (manager .tasks [0 ]["status" ], "succeeded" )
156172 finally :
157173 main .tasks = previous_tasks
174+ main ._interaction_controller = previous_controller
175+ main ._active_interaction_mode .reset (mode_token )
158176
159177 def test_exact_acceptance_phrases_and_control_parser (self ):
160178 self .assertTrue (is_plan_acceptance ("Execute plan." ))
0 commit comments