fix(web-probe): avoid analyzer-only helper in observer
This commit is contained in:
@@ -369,7 +369,13 @@ async function sendPrompt(text) {
|
||||
if (chatStatus < 200 || chatStatus >= 300) {
|
||||
throw new Error("sendPrompt observed POST /v1/agent/chat HTTP " + chatStatus + " " + chatResponse.statusText());
|
||||
}
|
||||
return { beforeUrl, afterUrl: currentPageUrl(), textHash: sha256Text(text), textBytes: Buffer.byteLength(text), chatSubmit: { status: chatStatus, statusText: chatResponse.statusText(), urlPath: urlPath(chatResponse.url()) }, pageId };
|
||||
let chatUrlPath = "/v1/agent/chat";
|
||||
try {
|
||||
chatUrlPath = new URL(chatResponse.url()).pathname;
|
||||
} catch {
|
||||
chatUrlPath = "/v1/agent/chat";
|
||||
}
|
||||
return { beforeUrl, afterUrl: currentPageUrl(), textHash: sha256Text(text), textBytes: Buffer.byteLength(text), chatSubmit: { status: chatStatus, statusText: chatResponse.statusText(), urlPath: chatUrlPath }, pageId };
|
||||
}
|
||||
|
||||
async function selectProvider(provider) {
|
||||
|
||||
Reference in New Issue
Block a user