@@ -801,6 +801,7 @@ function printHelp(): void {
801801 " --openwork-server-bin <p> Path to openwork-server binary (requires --allow-external)" ,
802802 " --owpenbot-bin <path> Path to owpenbot binary (requires --allow-external)" ,
803803 " --no-owpenbot Disable owpenbot sidecar" ,
804+ " --owpenbot-required Exit if owpenbot stops" ,
804805 " --allow-external Allow external sidecar binaries (dev only, required for custom bins)" ,
805806 " --check Run health checks then exit" ,
806807 " --check-events Verify SSE events during check" ,
@@ -1857,6 +1858,7 @@ async function runStart(args: ParsedArgs) {
18571858 const explicitOpenworkServerBin = readFlag ( args . flags , "openwork-server-bin" ) ?? process . env . OPENWORK_SERVER_BIN ;
18581859 const explicitOwpenbotBin = readFlag ( args . flags , "owpenbot-bin" ) ?? process . env . OWPENBOT_BIN ;
18591860 const owpenbotEnabled = readBool ( args . flags , "owpenbot" , true ) ;
1861+ const owpenbotRequired = readBool ( args . flags , "owpenbot-required" , false , "OPENWRK_OWPENBOT_REQUIRED" ) ;
18601862 const openworkServerBinary = await resolveOpenworkServerBin ( {
18611863 explicit : explicitOpenworkServerBin ,
18621864 manifest,
@@ -1971,7 +1973,14 @@ async function runStart(args: ParsedArgs) {
19711973 opencodePassword,
19721974 } ) ;
19731975 children . push ( { name : "owpenbot" , child : owpenbotChild } ) ;
1974- owpenbotChild . on ( "exit" , ( code , signal ) => handleExit ( "owpenbot" , code , signal ) ) ;
1976+ owpenbotChild . on ( "exit" , ( code , signal ) => {
1977+ if ( owpenbotRequired ) {
1978+ handleExit ( "owpenbot" , code , signal ) ;
1979+ return ;
1980+ }
1981+ const reason = code !== null ? `code ${ code } ` : signal ? `signal ${ signal } ` : "unknown" ;
1982+ console . warn ( `[owpenbot] exited (${ reason } ). Continuing without owpenbot.` ) ;
1983+ } ) ;
19751984 owpenbotChild . on ( "error" , ( error ) => handleSpawnError ( "owpenbot" , error ) ) ;
19761985 }
19771986
0 commit comments