Skip to content

Fix demo-mode auto-index after the embedding change - #161

Merged
rajivpant merged 1 commit into
mainfrom
fix/demo-index-dimension
Nov 6, 2026
Merged

rajivpant merged 1 commit into
mainfrom
fix/demo-index-dimension

Conversation

@rajivpant

Copy link
Copy Markdown
Collaborator

#159 made rag.init_collection's vector_size argument required, so a collection is never initialised at a dimension the embedding model does not produce. _ensure_demo_indexed in src/ragbot.py still called init_collection(DEMO_WORKSPACE_NAME) without it, so the first RAGBOT_DEMO=1 run would raise TypeError before indexing anything. No test covered the hook.

The call is removed: index_content and index_skills each initialise the workspace at the model's dimension themselves.

tests/test_demo_mode.py now covers the hook. One test checks that it indexes the bundled content and demo skills into their workspaces when the index is empty; the other checks that it skips them when the index is populated. On main the first test fails with the TypeError; with this change both pass. make test-fast: all green.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rajivpant
rajivpant merged commit 8fb9237 into main Nov 6, 2026
2 checks passed
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