436
437
private async _streamMessages(
439
>
headers: Record<string, string>,
440
>
res: http.ServerResponse,
441
>
entry: IProxyInFlight,
442
>
runtime: IClaudeProxyRuntime,
443
>
_originalSdkModelId: string,
444
>
sessionId: string | undefined,
445
>
): Promise<void> {
446
>
const options: ICopilotApiServiceRequestOptions = { headers, signal: entry.ac.signal, suppressIntegrationId: true };
447
>
let stream: AsyncGenerator<Anthropic.MessageStreamEvent>;
448
>
try {
449
>
stream = this._copilotApiService.messages(runtime.state.githubToken, body, options);
450
>
} catch (err) {
451
// Synchronous throws from the generator factory (rare —
452
// CAPI errors come from the first iteration).