From 72d9dfbbbb96e411ccb66573a5cd9f3c8129cf8a Mon Sep 17 00:00:00 2001 From: faber Date: Mon, 13 Jul 2026 21:01:12 -0400 Subject: [PATCH] fix: abort race stragglers, harden backup import/export contract - finish() now calls controller.abort() to cancel in-flight straggler requests - Export bumped to v2: excludes plaintext API keys, fixes stale field names - Import allowlist expanded to cover all settings, migrates v1 field names - Credentials (apiKey, veniceApiKey) intentionally excluded from backup Co-Authored-By: Claude Opus 4.6 --- index.html | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 6c62abf..016c2e1 100644 --- a/index.html +++ b/index.html @@ -11323,12 +11323,12 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; resolved = true; if (graceTimer) clearTimeout(graceTimer); if (hardTimer) clearTimeout(hardTimer); + controller.abort(); resolveRace(); }; const hardTimer = setTimeout(() => { _log('[ULTRAPLINIAN] Hard timeout reached, finishing race'); - controller.abort(); finish(); }, HARD_TIMEOUT_MS); @@ -16674,25 +16674,44 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; URL.revokeObjectURL(url); } - // ── Full self-custody backup (all state) ── + // ── Full self-custody backup (all state except credentials) ── function exportFullBackup() { const exportData = { - _version: 1, + _version: 2, _exportedAt: new Date().toISOString(), _source: 'g0dm0d3', conversations: state.conversations, currentId: state.currentId, - apiKey: state.apiKey, model: state.model, persona: state.persona, customSystemPrompt: state.customSystemPrompt, customSystemPromptEnabled: state.customSystemPromptEnabled, strategyLogs: state.strategyLogs, - autoTuneEnabled: state.autoTuneEnabled, - liquidEnabled: state.liquidEnabled, - ultraplinianEnabled: state.ultraplinianEnabled, - ultraplinianTier: state.ultraplinianTier, noLogMode: state.noLogMode, + showMagic: state.showMagic, + autoRetry: state.autoRetry, + maxRetries: state.maxRetries, + waitingGame: state.waitingGame, + ultraplinian: state.ultraplinian, + ultraSpeedTier: state.ultraSpeedTier, + ultraEarlyThreshold: state.ultraEarlyThreshold, + ultraImproveMode: state.ultraImproveMode, + plinyMode: state.plinyMode, + parseltongue: state.parseltongue, + parseltongueTier: state.parseltongueTier, + liquidMode: state.liquidMode, + liquidMinDelta: state.liquidMinDelta, + liquidMaxIterations: state.liquidMaxIterations, + liquidTargetScore: state.liquidTargetScore, + autoTuneEnabled: state.autoTuneEnabled, + autoTuneStrategy: state.autoTuneStrategy, + libertasDisabledCombos: state.libertasDisabledCombos, + libertasSelectedCombo: state.libertasSelectedCombo, + modelTemperature: state.modelTemperature, + modelTopP: state.modelTopP, + modelMaxTokens: state.modelMaxTokens, + modelFreqPenalty: state.modelFreqPenalty, + modelPresPenalty: state.modelPresPenalty, }; const jsonString = JSON.stringify(exportData, null, 2); const blob = new Blob([jsonString], { type: 'application/json' }); @@ -16784,11 +16803,22 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; const imported = _pendingImportData; // Build a candidate state WITHOUT mutating live state - const allowed = ['conversations', 'currentId', 'apiKey', 'model', 'persona', + // Import all state keys EXCEPT credentials (apiKey, veniceApiKey, generatedApiKeys, orOAuthConnected) + const allowed = ['conversations', 'currentId', 'model', 'persona', 'customSystemPrompt', 'customSystemPromptEnabled', 'strategyLogs', - 'autoTuneEnabled', 'liquidEnabled', 'ultraplinianEnabled', - 'ultraplinianTier', 'noLogMode']; + 'noLogMode', 'showMagic', 'autoRetry', 'maxRetries', 'waitingGame', + 'ultraplinian', 'ultraSpeedTier', 'ultraEarlyThreshold', 'ultraImproveMode', + 'plinyMode', 'parseltongue', 'parseltongueTier', + 'liquidMode', 'liquidMinDelta', 'liquidMaxIterations', 'liquidTargetScore', + 'autoTuneEnabled', 'autoTuneStrategy', + 'libertasDisabledCombos', 'libertasSelectedCombo', + 'modelTemperature', 'modelTopP', 'modelMaxTokens', 'modelFreqPenalty', 'modelPresPenalty', + 'sidebarOpen', 'backendUrl']; const candidate = JSON.parse(JSON.stringify(state)); + // Migrate v1 stale field names to current names + if (imported.liquidEnabled !== undefined && imported.liquidMode === undefined) imported.liquidMode = imported.liquidEnabled; + if (imported.ultraplinianEnabled !== undefined && imported.ultraplinian === undefined) imported.ultraplinian = imported.ultraplinianEnabled; + if (imported.ultraplinianTier !== undefined && imported.ultraSpeedTier === undefined) imported.ultraSpeedTier = imported.ultraplinianTier; for (const key of allowed) { if (imported[key] !== undefined) candidate[key] = imported[key]; }