HKUDS/DeepTutor · error · ValueError

Book not found

Error message

Book {book_id} not found

What it means

Storage lookup guard: storage.load_book returned None for book_id — the id is unknown, expired, or the workspace was reset — and engine methods that need the book refuse with this error.

Solutions

  1. List existing books to obtain a valid book_id
  2. Start a new book if the old one was deleted
  3. Persist book ids client-side only with the ability to re-list on 404
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at deeptutor/book/engine.py:448 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/3e37f498391a9d89. Report an issue: GitHub.

Appendix: source

Thrown at deeptutor/book/engine.py:448

        return book, proposal

    async def _run_ideation(self, ctx: IdeationContext, language: str) -> BookProposal:
        agent = IdeationAgent(language=language)
        return await agent.process(ideation_context=ctx)

    # ── Stage 2: Spine ───────────────────────────────────────────────────

    async def confirm_proposal(
        self,
        *,
        book_id: str,
        edited_proposal: BookProposal | None = None,
        stream: StreamBus | None = None,
    ) -> tuple[Book, Spine]:
        """User confirms (and optionally edits) the proposal → run SpineAgent."""
        book = self.storage.load_book(book_id)
        if book is None:
            raise ValueError(f"Book {book_id} not found")

        if edited_proposal is not None:
            book.proposal = edited_proposal
            book.title = edited_proposal.title or book.title
            book.description = edited_proposal.description or book.description

        bus = stream or get_book_bus(book_id)
        bstream = BookStream(bus)

        proposal = book.proposal or BookProposal(title=book.title)
        inputs = self.storage.load_inputs(book.id) or BookInputs(
            user_intent=book.title or "",
            knowledge_bases=list(book.knowledge_bases),
            language=book.language,
        )

        async with bstream.stage(STAGE_SPINE):
            # ── Sub-stage 1: Source exploration ──────────────────────

View on GitHub (pinned to 3e82f13042)