55mod common;
66
77use common:: opencode:: {
8- MODEL , REAL_TIMEOUT , assert_model, assert_no_new_servers, opencode_servers, real_config,
8+ MODEL , REAL_TIMEOUT , assert_model, assert_no_new_servers, opencode_harness, opencode_servers,
9+ real_config,
910} ;
10- use common:: orch:: { prompts_to, shutdown_and_check, summary, tool_calls, until } ;
11+ use common:: orch:: { prompts_to, shutdown_and_check, summary, tool_calls, until_healthy } ;
1112use common:: real:: is_orchestrator_turn_end;
1213use std:: time:: Duration ;
1314use tokio:: sync:: mpsc;
14- use yhtye_core:: acp:: { AgentEvent , AgentOutput , HarnessConfig } ;
15+ use yhtye_core:: acp:: { AgentEvent , AgentOutput } ;
1516use yhtye_core:: api:: { ApiEvent , ApiEventBody } ;
1617use yhtye_core:: domain:: Role ;
1718use yhtye_core:: runtime:: { ORCHESTRATOR_SESSION , Orchestration } ;
@@ -38,12 +39,12 @@ async fn run_request(
3839) -> Vec < ApiEvent > {
3940 let mut events = Vec :: new ( ) ;
4041 orch. send_user_message ( request) . expect ( "send" ) ;
41- until ( rx, & mut events, REAL_TIMEOUT , |e| {
42+ until_healthy ( rx, & mut events, REAL_TIMEOUT , |e| {
4243 matches ! ( & e. body, ApiEventBody :: Prompted { session, text }
4344 if session == ORCHESTRATOR_SESSION && text. contains( "[yhtye:group_settled]" ) )
4445 } )
4546 . await ;
46- until ( rx, & mut events, REAL_TIMEOUT , is_orchestrator_turn_end) . await ;
47+ until_healthy ( rx, & mut events, REAL_TIMEOUT , is_orchestrator_turn_end) . await ;
4748 events
4849}
4950
@@ -56,10 +57,9 @@ async fn real_opencode_orchestrator_creates_task_and_sub_agent_reports_back() {
5657 let dir = tempfile:: tempdir ( ) . expect ( "tempdir" ) ;
5758 let readme = dir. path ( ) . join ( "README.md" ) ;
5859 std:: fs:: write ( & readme, "# demo\n " ) . expect ( "write README" ) ;
59- let ( orch, mut rx) =
60- Orchestration :: start ( real_config ( dir. path ( ) , HarnessConfig :: opencode ( MODEL ) ) )
61- . await
62- . unwrap_or_else ( |e| panic ! ( "{e}" ) ) ;
60+ let ( orch, mut rx) = Orchestration :: start ( real_config ( dir. path ( ) , opencode_harness ( MODEL ) ) )
61+ . await
62+ . unwrap_or_else ( |e| panic ! ( "{e}" ) ) ;
6363 let events = run_request (
6464 & orch,
6565 & mut rx,
@@ -121,10 +121,9 @@ async fn real_opencode_implement_then_review() {
121121 let dir = tempfile:: tempdir ( ) . expect ( "tempdir" ) ;
122122 let readme = dir. path ( ) . join ( "README.md" ) ;
123123 std:: fs:: write ( & readme, "# demo\n " ) . expect ( "write README" ) ;
124- let ( orch, mut rx) =
125- Orchestration :: start ( real_config ( dir. path ( ) , HarnessConfig :: opencode ( MODEL ) ) )
126- . await
127- . unwrap_or_else ( |e| panic ! ( "{e}" ) ) ;
124+ let ( orch, mut rx) = Orchestration :: start ( real_config ( dir. path ( ) , opencode_harness ( MODEL ) ) )
125+ . await
126+ . unwrap_or_else ( |e| panic ! ( "{e}" ) ) ;
128127 let events = run_request (
129128 & orch,
130129 & mut rx,
0 commit comments