Skip to content

Fix a crash when the data root is set via LILBEE_DATA_ROOT#554

Closed
tobocop2 wants to merge 1 commit into
mainfrom
fix/data-root-env-path
Closed

Fix a crash when the data root is set via LILBEE_DATA_ROOT#554
tobocop2 wants to merge 1 commit into
mainfrom
fix/data-root-env-path

Conversation

@tobocop2

Copy link
Copy Markdown
Owner

Problem

Setting the data root through the LILBEE_DATA_ROOT environment variable crashes at startup. The variable maps straight onto the data_root field as a string, and the config resolver then derives the documents, data, and lancedb directories from it with the / operator, which raises TypeError: unsupported operand type(s) for /: 'str' and 'str'. Every other way of setting the data root passes a Path, so this path was the only one that broke.

Solution

Coerce data_root to a Path before deriving the child directories, and write the coerced value back so the field is consistently a Path. Coercing an existing Path is a no-op, so nothing else changes. Added a regression test that sets LILBEE_DATA_ROOT and asserts the child paths resolve without raising.

Setting the data root through the LILBEE_DATA_ROOT environment variable
delivered it to the config resolver as a raw string, and deriving the
documents/data/lancedb child directories with the / operator then raised
TypeError: unsupported operand type(s) for /: 'str' and 'str'. Coerce the
value to Path up front so the env var works the same as every other way
of setting the data root.
@tobocop2

Copy link
Copy Markdown
Owner Author

Superseded by the consolidated retrieval PR #557 — review and merge there. Converted to draft to keep it off the review queue; the branch and history stay intact for reference.

@tobocop2

Copy link
Copy Markdown
Owner Author

Superseded by the consolidated retrieval PR #557, which contains this change. Closing; the branch stays intact for reference.

@tobocop2 tobocop2 closed this Jul 18, 2026
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.

1 participant