Skip to content

fix: honor --vision off and add --ocr flag to build - #5

Merged
Cat-blizzard merged 2 commits into
Cat-blizzard:mainfrom
LEO690201:main
Aug 16, 2026
Merged

fix: honor --vision off and add --ocr flag to build#5
Cat-blizzard merged 2 commits into
Cat-blizzard:mainfrom
LEO690201:main

Conversation

@LEO690201

Copy link
Copy Markdown
Contributor

Summary

  • --vision off previously 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 cascades off to semantic_layout local mode.
  • Expose --ocr {off,auto,all} on build so 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-zip completes end-to-end (38-page deck, 67 LLM calls) producing notes.md/notes.zip.

`--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 Cat-blizzard left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. --vision off + semantic-layout auto does not construct/call the vision client and reports the effective mode as local.
  2. Explicit --ocr off survives lecture-preset default application.

Local verification on commit d550af2: 193 tests passed and git diff --check passed.

@Cat-blizzard
Cat-blizzard merged commit ba2f283 into Cat-blizzard:main Aug 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants