Use billable AI model for session memory

This commit is contained in:
Flatlogic Bot 2026-06-09 16:20:20 +00:00
parent 196c6f48ed
commit 1a1c1a02ce

View File

@ -154,7 +154,7 @@ async function awaitResponse(aiRequestId, options = {}) {
const interval = Math.max(Number(options.interval ?? 5), 1);
const deadline = Date.now() + Math.max(timeout, interval) * 1000;
while (true) {
while (Date.now() < deadline) {
const statusResp = await fetchStatus(aiRequestId, {
headers: options.headers,
timeout: options.timeout_per_call,
@ -184,16 +184,14 @@ async function awaitResponse(aiRequestId, options = {}) {
return statusResp;
}
if (Date.now() >= deadline) {
return {
success: false,
error: "timeout",
message: "Timed out waiting for AI response.",
};
}
await sleep(interval * 1000);
}
return {
success: false,
error: "timeout",
message: "Timed out waiting for AI response.",
};
}
function extractText(response) {
@ -283,7 +281,7 @@ function config() {
projectId,
projectUuid: process.env.PROJECT_UUID || null,
projectHeader: process.env.AI_PROJECT_HEADER || "project-uuid",
defaultModel: process.env.AI_DEFAULT_MODEL || "gpt-5-mini",
defaultModel: process.env.AI_DEFAULT_MODEL || "gpt-5.5",
timeout,
verifyTls,
};