()
| 929 | |
| 930 | return citationMap.size > 0 ? Array.from(citationMap.values()).sort((a, b) => a.index - b.index) : []; |
| 931 | }; |
| 932 | |
| 933 | const logStreamingRequest = (status, transport = 'web') => { |
| 934 | if (!window.networkLogger) return; |
| 935 | |
| 936 | const logBody = { |
| 937 | model: modelId, |
| 938 | messages: messages.length + ' messages', |
| 939 | stream: true, |
| 940 | reasoning: reasoningPayload |
| 941 | }; |
| 942 | |
| 943 | window.networkLogger.logRequest({ |
| 944 | type: 'openrouter', |
| 945 | method: 'POST', |
| 946 | url: url, |
| 947 | status, |
| 948 | sessionId: sessionId || undefined, |
| 949 | keyRef: window.networkLogger.keyRefForHeaders(headers), |
| 950 | request: { |
| 951 | headers: window.networkLogger.sanitizeHeaders(headers), |
| 952 | body: logBody |
| 953 | }, |
| 954 | response: { |
| 955 | streaming: true, |
| 956 | transport |
| 957 | } |
| 958 | }); |
| 959 | }; |
| 960 | |
| 961 | const processSseLine = async (line) => { |
| 962 | throwIfStreamAborted(); |
| 963 | |
| 964 | // Skip empty lines |
| 965 | if (line.trim() === '') return; |
nothing calls this directly
no outgoing calls
no test coverage detected