Skip to content

fix(rag): index on the Lemonade --base-url names, not the default - #7242

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
autofix/issue-7190
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
autofix/issue-7190

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

gaia talk --index … --base-url X sent document indexing to the default Lemonade on localhost:13305 instead of X. That reloaded the embedder on whatever server happened to be listening there, even one owned by another session. Now indexing uses the server the chat uses. An unreachable --base-url fails the same way it already did when the URL came from LEMONADE_BASE_URL.

Closes #7190

Test plan

  • python -m pytest tests/unit/rag/test_rag_base_url.py tests/unit/test_chat_sdk_rag_grant.py tests/unit/rag/test_llm_chunking.py tests/unit/test_talk_rag_startup.py passes
  • python -m pytest tests/unit/ -x passes
  • python util/lint.py --all passes
  • Manual (needs a Lemonade on 13305 that GAIA does not own): gaia talk --index docs/quote.txt --no-tts --no-lemonade-check --base-url http://127.0.0.1:59344/api/v1 exits 1 before voice startup, and the 13305 server's log shows no embedder unload or reload

⚠️ Needs manual validation: the unit tests prove the URL reaches the embedder's client, but only the repro above, with a second Lemonade running, proves that 13305 is left alone end to end.

🔍 Technical details
  • AgentSDK.enable_rag (src/gaia/chat/sdk.py) built RAGConfig without self.config.base_url. It now passes it through, and a base_url the caller gives in rag_kwargs still overrides it.
  • RAGSDK._start_embedder and the LLM-chunking path (src/gaia/rag/sdk.py) built a bare LemonadeClient(). Both now pass base_url=self.config.base_url. When that is None, LemonadeClient resolves it as before (LEMONADE_BASE_URL, then the default), so callers that never set a URL see no change.
  • TalkSDK.enable_rag delegates to the chat SDK, so talk gets the fix through that path.
  • The fake config in test_chat_sdk_rag_grant.py gains base_url, which AgentConfig always has.
  • Verified here: lint passes, and 2,324 RAG/chat/talk unit tests pass. The two that fail need python-pptx, which this runner lacks. The full tests/unit/ run here was killed by the environment partway through, with no failures before that, so CI's full run is the check that counts.
  • New tests/unit/rag/test_rag_base_url.py checks that enable_rag forwards the URL, that an explicit rag_kwargs URL wins, and that the embedder's LemonadeClient is built with the configured URL.

gaia talk --index with --base-url sent document indexing to the default
Lemonade on localhost:13305, reloading the embedder on whatever server was
there. enable_rag now forwards the chat's base_url into RAGConfig, and the
RAG SDK builds its embedder and chunking clients with it.

Closes #7190
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

This duplicates #7236, which fixes the same --base-url indexing bug (#7190) and also makes gaia api start --base-url report the right server on /health (#7189). Keep #7236 and close this one; I'm leaving it as a draft.

🔍 Technical details

Both PRs make the same three source changes: enable_rag forwards base_url with setdefault, and _start_embedder and the chunking path build LemonadeClient(base_url=self.config.base_url). #7236 also passes base_url to the RAG SDK's own AgentSDK and exports --base-url as LEMONADE_BASE_URL in gaia api start. Nothing here is missing from #7236.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Superseded by #7236 (merged); its one extra test moves to #7263.

bniladridas pushed a commit to bniladridas/gaia that referenced this pull request Nov 12, 2026
…er (amd#7263)

amd#7236 routed RAG and chat to the `--base-url` server, but two paths
stayed untested: a `base_url` passed to `enable_rag` must beat the chat
config's, and LLM chunking must build its Lemonade client against the
configured server. A regression in either would quietly send RAG traffic
to the default-port Lemonade. The precedence test is salvaged from draft
amd#7242, adapted to main.

## Test plan
- [x] `python -m pytest
tests/unit/test_base_url_reaches_every_client.py` passes
- [x] Each new test fails when its behavior is broken (`setdefault`
swapped for assignment; chunking client built without `base_url`)
- [x] `python -m pytest tests/unit/rag
tests/unit/test_chat_sdk_rag_grant.py` passes
- [x] `python util/lint.py --black --isort` clean
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.

CLI: gaia talk --index ignores --base-url and reloads another server's embedder

1 participant