From 07c70d8f82bef142278e7a300cd4d9480407ddfb Mon Sep 17 00:00:00 2001 From: Soham Kukreti Date: Tue, 1 Sep 2026 13:19:58 +0530 Subject: [PATCH] fix(docker): skip /config/dump pre-flight for md/llm endpoints in playground md/llm runs died before their request was sent: the pre-flight sends the legacy 'code' field, which 0.9.3 rejects on untrusted requests (fixes #2222). --- deploy/docker/static/playground/index.html | 46 +++++++++++----------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/deploy/docker/static/playground/index.html b/deploy/docker/static/playground/index.html index 49d27d436..e874da472 100644 --- a/deploy/docker/static/playground/index.html +++ b/deploy/docker/static/playground/index.html @@ -686,29 +686,31 @@

🔥 Stress Test

async function runCrawl() { const endpoint = document.getElementById('endpoint').value; const urls = document.getElementById('urls').value.trim().split(/\n/).filter(u => u); - // 1) grab python from CodeMirror, validate via /config/dump + // 1) grab python from CodeMirror, validate via /config/dump. + // Advanced Config is /crawl-only, so md/llm skip this entirely. let advConfig = {}; - try { - const cfgJson = await pyConfigToJson(); // may throw - if (Object.keys(cfgJson).length) { - const cfgType = document.getElementById('cfg-type').value; - advConfig = cfgType === 'CrawlerRunConfig' - ? { crawler_config: cfgJson } - : { browser_config: cfgJson }; - } - } catch (err) { - const codeText = cm.getValue(); - const streamFlag = /stream\s*=\s*True/i.test(codeText); - const isCrawlEndpoint = document.getElementById('endpoint').value === 'crawl'; - if (isCrawlEndpoint && streamFlag) { - // Fallback: minimal dump-shaped config so shouldUseStream + server load agree - advConfig = { crawler_config: { type: 'CrawlerRunConfig', params: { stream: true } } }; - } else { - updateStatus('error'); - document.querySelector('#response-content code').textContent = - JSON.stringify({ error: err.message }, null, 2); - forceHighlightElement(document.querySelector('#response-content code')); - return; // stop run + if (endpoint === 'crawl' || endpoint === 'crawl_stream') { + try { + const cfgJson = await pyConfigToJson(); // may throw + if (Object.keys(cfgJson).length) { + const cfgType = document.getElementById('cfg-type').value; + advConfig = cfgType === 'CrawlerRunConfig' + ? { crawler_config: cfgJson } + : { browser_config: cfgJson }; + } + } catch (err) { + const codeText = cm.getValue(); + const streamFlag = /stream\s*=\s*True/i.test(codeText); + if (streamFlag) { + // Fallback: minimal dump-shaped config so shouldUseStream + server load agree + advConfig = { crawler_config: { type: 'CrawlerRunConfig', params: { stream: true } } }; + } else { + updateStatus('error'); + document.querySelector('#response-content code').textContent = + JSON.stringify({ error: err.message }, null, 2); + forceHighlightElement(document.querySelector('#response-content code')); + return; // stop run + } } }