feat(compile): allow callers to skip embeddings - #198
Merged
Conversation
…change `embeddings:false skips embedding refresh` is a one-directional control. It passes against a build that NEVER refreshes, so it cannot distinguish "the flag works" from "embeddings are broken for everyone" — mutation-tested, forcing the refresh to be skipped unconditionally left it green. The default path is what the flag actually promises to leave alone, so the two cases added here are what give the original its meaning. Both mutants are now caught: skipping unconditionally turns 2 red, ignoring the flag turns 1 red. Also closes the `describe` block, which was left unterminated and made the file fail to transform, so `build-and-test` was red on #169 from the day it opened.
This was referenced Aug 25, 2026
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.
Takes over #169 by @TigerOfCountryYao, which had been a draft since 30 July with failing CI. His commit is preserved as the first commit here, rebased onto current
main; the second commit is the test work.What it does
compile({ embeddings: false })runs page generation, links and the lexical index without any embedding-provider call or pending-embedding retry, for an SDK host that maintains its own semantic index. Omitting it is unchanged.Why it is needed, which the original PR undersold
"Just don't set the embedding credential" does not work for two of the four backends:
anthropic/claude-agentVOYAGE_API_KEYopenaiOPENAI_EMBEDDINGS_API_KEY, thenOPENAI_API_KEYollamaWhat changed from the original
It builds.
test/compile-options.test.tswas missing its closing});, so esbuild could not transform it andbuild-and-testwas red from the day the PR opened.The default path is now pinned. The original had one case, asserting that
embeddings: falsedoes not refresh. That is one-directional: it passes against a build that never refreshes, so it cannot distinguish "the flag works" from "embeddings are broken for everyone". Mutation-tested to confirm — forcing the refresh to be skipped unconditionally left it green. Two cases now cover the default, and both mutants are caught: skipping unconditionally turns 2 red, ignoring the flag turns 1 red.It uses
FinalizeFlags. The original added a sixth positional boolean tofinalizeWiki, adjacent toscoped. #192 turned those into a named object precisely so this one could join it asflags.embeddingsrather than a same-typed neighbour that transposes silently.embeddingsis deliberately not a prompt modifier: it changes what runs after pages are written, never what a prompt asks for, so it must not enter the modifier digest or invalidate a page that is byte-identical under it.