Skip /config/dump pre-flight for md/llm endpoints in playground - #2224
Open
SohamKukreti wants to merge 1 commit into
Open
Skip /config/dump pre-flight for md/llm endpoints in playground#2224SohamKukreti wants to merge 1 commit into
SohamKukreti wants to merge 1 commit into
Conversation
…yground 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2222
The playground validated the Advanced Config editor via
/config/dumpfor every endpoint, includingmdandllmwhere the panel is hidden and its result is never used. That pre-flight sends the legacy{ type, code }protocol, which the server removed in the 0.8.x security fixes and rejects loudly since 0.9.3 (codeis a forbidden field on untrusted requests). The fallback only rescuedcrawl, somd/llm(andcrawl_stream) aborted withfield 'code' is not permitted on CrawlerRunConfig from an untrusted requestbefore their request was ever sent.The fix skips the
/config/dumppre-flight unless the endpoint iscrawlorcrawl_stream. Behavior inside the guard is unchanged.List of files changed and why
deploy/docker/static/playground/index.html- wrap the/config/dumppre-flight inrunCrawl()with an endpoint guard somd/llmskip it; drop the now-redundantisCrawlEndpointcheck inside the catch fallback.How Has This Been Tested?
Manually verified and tested the playground
and
Drove the real playground UI with headless Chromium against a clean
unclecode/crawl4ai:0.9.3Docker container (the affected release):md: fit / raw / bm25+query / llm-filter, both cache modes - all succeed; onlyPOST /mdfires, no/config/dumpcallllmwith a question - succeeds viaGET /llm/{url}?q=...crawlwith the default snippet - behavior unchanged:/config/dump-> fallback ->/crawl, succeedscrawl_streamwith the default snippet - now works (streams from/crawl/stream; on stock 0.9.3 it aborted likemd)md/llmChecklist: