Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11838,6 +11838,17 @@ <h2 id="dlgModalTitle" data-i18n="dlg.title">Delegate to Agent</h2>
function sendChat(text) { inEl.value = text; send(); }

async function send() {
// _globalDefaultEngine starts hardcoded 'api' and only becomes the real
// configured default once checkVersion()'s /api/version fetch resolves
// (see resolveEngineForView()). A message sent before that fetch lands —
// e.g. the very first message of a fresh page load — used to go out with
// curEngine still on that placeholder 'api', and the server bakes whatever
// `engine` arrives into the session's run_engine permanently (server.js
// ~11914). That silently routed billing through the API key instead of the
// user's actually-configured Subscription default, and stuck that way for
// the life of the chat. Awaiting an already-settled promise is a no-op, so
// this costs nothing once the page has been open for more than an instant.
if (typeof _versionCheckDone !== 'undefined') { try { await _versionCheckDone; } catch {} }
if (!ws || ws.readyState !== 1) { toast(t('toast.no_connection'), true); return; }

const txt = inEl.value.trim();
Expand Down Expand Up @@ -17571,7 +17582,7 @@ <h2 id="dlgModalTitle" data-i18n="dlg.title">Delegate to Agent</h2>
_projectsReady = loadProjectsList();
loadRemoteHosts();
connect();
checkVersion();
let _versionCheckDone = checkVersion();
// ─── Image chip hover preview ───
{
const _prev = $i('imgChipPreview');
Expand Down
Loading