Technical mode silently falls back to pdftotext when Docling crashes; metadata still reports technical

Author: conwypaulCreated Sep 30, 2026Updated Sep 30, 2026

Summary

In --mode technical, if Docling is installed but fails at runtime, extract_pdf treats it the same as "not installed": it silently falls back to pdftotext, exits 0, and metadata.json still reports "extraction_mode": "technical". The agent-facing flow in SKILL.md never compares the requested mode with the method that actually ran, so a "technical" skill can be generated from flattened text, with no tables or code blocks, which defeats the point of choosing technical mode.

How I hit it

Windows 11, Python 3.9, docling 2.69.1, huggingface_hub 0.36.2, book-to-skill c108d25. The account has no symlink privilege (Developer Mode off, not elevated).

On first use Docling downloads its models through huggingface_hub, whose cache uses symlinks. The library warns that symlinks aren't supported, then attempts one anyway:

[warn] extract_with_docling failed: OSError: [WinError 1314] A required privilege is not held by the client: '..\\..\\blobs\\a634...' -> '...\\.cache\\huggingface\\hub\\models--docling-project--docling-layout-heron\\snapshots\\8f39...\\.gitattributes'
not available, falling back to pdftotext
Mode: text — using pdftotext...

The resulting metadata.json:

json
"extraction_method": "pdftotext",
"extraction_mode": "technical",

--check reported ✓ python: docling → ready beforehand, so nothing indicated a problem until the run.

The root crash is a huggingface_hub/Windows issue, not book-to-skill's. What concerns me here is how the fallback is reported.

Where

book_to_skill/utils.py, around lines 1098-1106: an empty or failed extract_with_docling() result prints "not available" and sets the local extraction_mode = "text", but the top-level metadata keeps the requested mode.

Suggestions

  1. Distinguish "Docling not installed" from "Docling failed", and surface the exception in the fallback message rather than only in a preceding [warn] line.

  2. Record the effective mode, or a fallback_reason, in metadata.json so a requested/actual mismatch is machine-detectable.

  3. In SKILL.md Step 2, have the agent check extraction_method against the requested mode and ask the user before generating from a fallback extraction.

  4. Document a Windows workaround in docs/install.md. This worked for me: pre-download the models with Docling's own downloader, which writes plain files (no symlinks), then point Docling at them:

    powershell
    python -c "from docling.utils.model_downloader import download_models; download_models()"
    [Environment]::SetEnvironmentVariable("DOCLING_ARTIFACTS_PATH", "$HOME\.cache\docling\models", "User")

Source: virgiliojr94/book-to-skill