Repository navigation
knowledge.formats lists the formats an ingest reads and whether an extractor serves each - #282
Merged
Merged
Conversation
…tractor serves each Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…t format is routing's own Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…port; its timeout is logged Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ut's log line is tested Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ngest ops stay together Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ad, and that an ingest then waits Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
This was referenced Nov 6, 2026
Merged
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.
Related: #157
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
knowledge.formatslists every document format an ingest reads, the file extensions and media types that select each, and whether a configured extractor serves it, with the upload's size limit and the extensions it refuses, so a client can tell a person before sending a file that it would not be read.Why
The issue asks that "capability advertisement comes from what the configured extractors declare", and its plan has the dashboard's Library show capability badges for a file before it is sent. Nothing on the wire said which formats a deployment reads.
server.knowledge.app.extractors.available_formatscomputed it, but no op served it and it had no caller. A client could only upload a file, ingest it, and wait forformat_unavailable. This is the server half; the dashboard uses it in the next PR.Design
knowledge.formats(viewer, read-only,experimental): for each ofKNOWN_FORMATS, sorted, it returns:format;extensionsandmedia_types, the namesformat_ofmaps to it (new pure helperdocument_formats.names_of);available:truewhen a service a file of it can go to declares it (its own route, else the default service and the routes of the media types that name it),falsewhen every such service was read and none does (an ingest failsformat_unavailable), andnullwhile one could not be read (an ingest then waits for the service and retries). A client tells "will not be read" from "unknown, try again shortly". A format served only by a media type's route is read when the upload carries that media type, which the dashboard and the SDKs send when the file's type is known.The output also carries
max_upload_bytes(LOOM_KNOWLEDGE_UPLOAD_MAX_BYTES),refused_extensions(doc,ppt,xls, which the upload refuses by name) anddefault_format:document_formats.DEFAULT_FORMAT(text), the constantformat_ofitself now falls back to, for a name and media type that select nothing.Bounded read:
available_formats(now built onformat_availability, which returns each format's URL,''for none, orNonefor unknown) used to read each service with the extract timeout (LOOM_DOCUMENT_EXTRACTOR_TIMEOUT_S, 180 s by default), one after another on a cold cache. An unreachable extractor would have held the listing for minutes.CAPABILITIES_READ_S(5 s; the same bound the tune report's read used, now one constant inextractors.py). A service not read in time declares nothing, and its failure is remembered for the capabilities cache's minute (_unreadable), so a down or blackholed service costs one wait a minute, not one per listing. A successful capabilities read (by an ingest, say) clears the mark, and a fresh cached read wins over a mark a slower listing read left after it, so the listing does not say no while an ingest reads the format. Concurrent cold listings still each read once._formats_within), which the extractor report (configured_services) now shares; its log line names a timeout astimed out(before, a bareTimeoutErrorlogged nothing after the URL), which a test asserts.Latency budget: 5,500 ms in
OP_BUDGETS_P99_MS, the cold-read bound plus headroom.Where it lives: beside the ingest ops in the knowledge plane.
ops.capabilities(insights) would have imported the knowledge plane's extractor client across planes, and it describes operations, not data.Docs: a row in the knowledge page's op table, a paragraph in "Ingesting files", and a sentence in the extraction architecture page's routing section.
Generated files: the SDK op tables (Python and TypeScript) and the reference pages are regenerated.
Alternatives considered:
knowledge.ingest_statusfailures. That costs an upload and an ingest per answer.Scope and risk
availableis what the extractor declares; whether a given file extracts is still decided at ingest.Compatibility, rollout and rollback
knowledge.formatswith404; a client treats that as availability unknown (the dashboard PR does).Tests
tests/unit/test_knowledge_formats.py: against the reference extractor in process and stub services:null), though the default service declares it;false;available_formatsits bound and declares nothing (its formats unknown), and a second listing within the minute does not read it again, while one past the minute does, one read since by an ingest counts again, and a fresh cached read wins over a mark left after it;default_formatis whatformat_offalls back to.tests/unit/test_knowledge_extractors.pypasses, its fixture clearing the new failure cache with the capabilities cache (the listing tests: an unreachable service read once, a format routed only by media type, a media type route key).tests/integration/test_knowledge_formats_live.py: against a server, its ClickHouse and the reference extractor, the formats, names and limits come back, and the available set equals the server's ownavailable_formats()(all 11 of the reference extractor's here); with no configured extractor declaring anything the test skips, so an empty comparison cannot pass.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: the op against a real server and extractor, the bound with a service that never answers, and a review at every push.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code