fix: honor --vision off and add --ocr flag to build - #5
Merged
Conversation
`--vision off` only skipped the explicit vision stage; semantic_layout
still ran in auto mode and issued vision API calls, hanging on providers
without a reachable image endpoint. Cascade off to semantic_layout local
mode.
Also expose `--ocr {off,auto,all}` on `build` so lecture builds on
digital text PDFs can skip the Baidu OCR requirement without switching
to the local preset.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Cat-blizzard
requested changes
Aug 16, 2026
Cat-blizzard
left a comment
Owner
There was a problem hiding this comment.
Thanks for the focused fix. Please address one consistency issue before merge:
_stage_semantic_layout changes the effective mode only in a local variable, while _build_run_summary still records args.semantic_layout. As a result, a build with --vision off executes semantic layout in local mode but reports run.semantic_layout: auto in run_summary.json. Please normalize or propagate the effective mode so execution and reporting agree.
Please also add regression tests covering:
--vision off+ semantic-layoutautodoes not construct/call the vision client and reports the effective mode aslocal.- Explicit
--ocr offsurvives lecture-preset default application.
Local verification on commit d550af2: 193 tests passed and git diff --check passed.
Cat-blizzard
approved these changes
Aug 16, 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.
Summary
--vision offpreviously only skipped the explicit vision stage; the semantic_layout stage still ran in auto mode and issued vision API calls, which hangs on providers without a reachable image endpoint. Now cascadesoffto semantic_layout local mode.--ocr {off,auto,all}onbuildso lecture builds over digital text PDFs can skip the Baidu OCR requirement without switching to the local preset.Test plan
python -m slidenote build <pdf> --provider openai --vision off --ocr off --export markdown-zipcompletes end-to-end (38-page deck, 67 LLM calls) producing notes.md/notes.zip.