Skip to content

bub-tapestore-sqlite breaks against latest bub main after _build_llm removal #43

@Gezi-lzq

Description

@Gezi-lzq

Summary

packages/bub-tapestore-sqlite currently depends on the private helper bub.builtin.agent._build_llm inside SQLiteTapeStore.__init__. Latest bub main no longer exports that module-level helper, so constructing the SQLite tape store fails before any tape operation can run.

Observed with bub main at a0976a4646eba21253ab439fb0f42ece2a3def92 (0.3.10.dev2+ga0976a464).

Reproduction

From bub-contrib:

uv run --isolated \
  --with 'bub @ git+https://github.com/bubbuild/bub.git@main' \
  --with pytest \
  --with pytest-asyncio \
  --with-editable packages/bub-tapestore-sqlite \
  pytest packages/bub-tapestore-sqlite/tests -q

Actual result

15 sqlite tapestore tests fail. The common failure is:

ImportError: cannot import name '_build_llm' from 'bub.builtin.agent'

The failure is triggered by:

from bub.builtin.agent import _build_llm

in packages/bub-tapestore-sqlite/src/bub_tapestore_sqlite/store.py.

Expected result

The SQLite tape store should work against the latest supported bub without depending on a private agent helper. Non-semantic SQLite usage should not need to construct any LLM client at store initialization time.

Suggested fix

Decouple SQLite embedding support from bub.builtin.agent._build_llm:

  • remove the _build_llm call from SQLiteTapeStore.__init__
  • lazily build an embedding client only when semantic query support is used
  • construct that client via public any_llm.AnyLLM.create(...)
  • source provider-specific config from bub.ensure_config(AgentSettings) and support both existing settings fields and the newer AgentSettings.model_client_kwargs(...) path
  • update tests to mock the SQLite package embedding-client builder instead of bub.builtin.agent._build_llm

I have a local patch following this approach, and it passes:

19 passed - workspace deps
19 passed - isolated bub==0.3.9
19 passed - isolated bub@main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions