Skip to content

Commit 6cb871e

Browse files
committed
fix: handle custom-agents endpoint in replay proxy for CLI 1.0.11
CLI 1.0.11 makes a GET request to /agents/*/custom-agents/* during startup. The replay proxy had no handler for this endpoint, causing it to call onError and hang new CLI processes. This broke the 'should resume a session using a new client' and 'should produce deltas after session resume' E2E tests which spawn a second CopilotClient. Add a stub handler (returning empty agents list) matching the existing pattern used for memory endpoints.
1 parent 1689bc7 commit 6cb871e

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/harness/replayingCapiProxy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,19 @@ export class ReplayingCapiProxy extends CapturingHttpProxy {
230230
return;
231231
}
232232

233+
// Handle custom-agents endpoints - return empty list in tests
234+
if (options.requestOptions.path?.match(/\/agents\/.*\/custom-agents\//)) {
235+
const body = JSON.stringify({ agents: [] });
236+
const headers = {
237+
"content-type": "application/json",
238+
...commonResponseHeaders,
239+
};
240+
options.onResponseStart(200, headers);
241+
options.onData(Buffer.from(body));
242+
options.onResponseEnd();
243+
return;
244+
}
245+
233246
// Handle /chat/completions endpoint
234247
if (
235248
state.storedData &&

0 commit comments

Comments
 (0)