HKUDS/DeepTutor · error · ValueError

Cannot compile page – missing book/spine/page ({book_id}/{pa

Error message

Cannot compile page – missing book/spine/page ({book_id}/{page_id})

What it means

Error "Cannot compile page – missing book/spine/page ({book_id}/{page_id})" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/book/engine.py:1082

        rebuild cannot evict its successor.
        """
        if runtime.in_flight.get(page_id) is task:
            runtime.in_flight.pop(page_id, None)

    async def _compile_page_now(
        self,
        *,
        book_id: str,
        page_id: str,
        stream: StreamBus | None = None,
        force: bool = False,
    ) -> Page:
        """Drive the compiler for one page. Always run via :meth:`compile_page`."""
        book = self.storage.load_book(book_id)
        spine = self.storage.load_spine(book_id)
        page = self.storage.load_page(book_id, page_id)
        if book is None or spine is None or page is None:
            raise ValueError(f"Cannot compile page – missing book/spine/page ({book_id}/{page_id})")
        if page.status == PageStatus.READY and not force:
            return page

        # Overview pages are built deterministically from the spine (intro,
        # concept graph, chapter index). Never run the generic LLM compiler over
        # their hand-built blocks — that would overwrite the deterministic
        # "How to read this book" intro and chapter index with hallucinated
        # prose. Reaching here means force=True or the page is not yet READY, so
        # rebuild deterministically (this also refreshes a changed spine).
        if page.content_type == ContentType.OVERVIEW:
            page.status = PageStatus.PENDING
            self.storage.save_page(page)
            await self._materialize_overview_page(spine, [page], book, stream=stream)
            page = self.storage.load_page(book_id, page_id) or page
            await self._maybe_finalize_book(book_id)
            return page

        if force:

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/book/engine.py:1082 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/709573b217280f2f. Report an issue: GitHub.