@@ -176,6 +176,36 @@ test("OpenCode++ doctor reports CLI/plugin version consistency", async () => {
176176 }
177177} ) ;
178178
179+ test ( "OpenCode++ doctor treats a missing sidecar plugin as first-run warning" , async ( ) => {
180+ const root = mkdtempSync ( path . join ( tmpdir ( ) , "opencode-plusplus-doctor-first-run-" ) ) ;
181+ const bin = path . join ( root , "bin" ) ;
182+ const oldPath = process . env . PATH ;
183+ try {
184+ mkdirSync ( bin , { recursive : true } ) ;
185+ writeFakeOpenCode ( bin ) ;
186+ process . env . PATH = `${ bin } ${ path . delimiter } ${ oldPath ?? "" } ` ;
187+ mkdirSync ( path . join ( root , ".agent-context" ) , { recursive : true } ) ;
188+ writeFileSync ( path . join ( root , "package.json" ) , JSON . stringify ( { scripts : { test : "node -e 1" } } ) , "utf8" ) ;
189+ runGit ( root , [ "init" ] ) ;
190+ runGit ( root , [ "checkout" , "-b" , "main" ] ) ;
191+ runGit ( root , [ "config" , "user.email" , "opencode-plusplus@example.com" ] ) ;
192+ runGit ( root , [ "config" , "user.name" , "OpenCode Plus Plus" ] ) ;
193+ runGit ( root , [ "add" , "." ] ) ;
194+ runGit ( root , [ "commit" , "-m" , "initial" ] ) ;
195+
196+ const report = await runOpenCodePlusplusDoctor ( root ) ;
197+
198+ assert . equal ( report . checks . filter ( ( check ) => check . id . startsWith ( "sidecar-" ) && check . status === "fail" ) . length , 0 ) ;
199+ assert . equal ( report . checks . find ( ( check ) => check . id === "opencode-plusplus-version" ) ?. status , "warn" ) ;
200+ assert . equal ( report . checks . find ( ( check ) => check . id === "sidecar-plugin" ) ?. status , "warn" ) ;
201+ assert . equal ( report . checks . find ( ( check ) => check . id === "sidecar-hooks" ) ?. status , "warn" ) ;
202+ assert . match ( report . checks . find ( ( check ) => check . id === "sidecar-plugin" ) ?. details ?? "" , / r u n ` o p e n c o d e - p l u s p l u s ` / ) ;
203+ } finally {
204+ process . env . PATH = oldPath ;
205+ rmSync ( root , { recursive : true , force : true } ) ;
206+ }
207+ } ) ;
208+
179209test ( "OpenCode sidecar records tool execution evidence into event logs and traces" , ( ) => {
180210 const root = mkdtempSync ( path . join ( tmpdir ( ) , "opencode-plusplus-sidecar-record-tool-" ) ) ;
181211 try {
0 commit comments