File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -308,6 +308,22 @@ export class ReplayingCapiProxy extends CapturingHttpProxy {
308308 }
309309 }
310310
311+ // Beyond this point, we're only going to be able to supply responses in CI if we have a snapshot,
312+ // and we only store snapshots for chat completion. For anything else (e.g., custom-agents fetches),
313+ // return 404 so the CLI treats them as unavailable instead of erroring.
314+ if ( options . requestOptions . path !== chatCompletionEndpoint ) {
315+ const headers = {
316+ "content-type" : "application/json" ,
317+ "x-github-request-id" : "proxy-not-found" ,
318+ } ;
319+ options . onResponseStart ( 404 , headers ) ;
320+ options . onData (
321+ Buffer . from ( JSON . stringify ( { error : "Not found by test proxy" } ) ) ,
322+ ) ;
323+ options . onResponseEnd ( ) ;
324+ return ;
325+ }
326+
311327 // Fallback to normal proxying if no cached response found
312328 // This implicitly captures the new exchange too
313329 const isCI = process . env . GITHUB_ACTIONS === "true" ;
You can’t perform that action at this time.
0 commit comments