LCORE-1428: Address former MCP auth failure#1400
LCORE-1428: Address former MCP auth failure#1400tisnik merged 2 commits intolightspeed-core:mainfrom
Conversation
Remove @skip-in-library-mode tags from 8 MCP auth e2e test scenarios that were skipped due to an ASGI exception when passing authorization headers to MCP servers in library mode. The underlying issue was in the llama-stack library client's handling of MCP tool authorization through the request pipeline. This has been resolved in the current llama-stack dependency, which now correctly preserves the authorization field on MCP tool definitions when routing requests through the FastAPI endpoint wrappers in library mode. Manual verification confirmed that both /query and /streaming_query endpoints correctly pass Authorization headers to MCP servers in library mode, matching the behavior of HTTP (server) mode. Affected scenarios: - File-based auth: query + streaming_query - Kubernetes auth: query + streaming_query - Client-provided auth: query + streaming_query - OAuth auth: query + streaming_query
The MCP auth e2e scenarios restart the lightspeed-stack container with different configurations per scenario. In library mode the container embeds llama-stack and takes ~45-60 seconds to become healthy, but wait_for_container_health only polled 3 times (15 seconds total). Increase max_attempts from 3 to 12 (60 seconds) so library-mode container restarts have enough time to pass the Docker healthcheck.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@jrobertboos As stated earlier, this wasn't a bug in our code. The ASGI exception was coming from the llama-stack library client itself (it wasn't handling MCP tool authorization properly correctly when running in library mode) -- the authorization field on MCP tools was getting lost. This has been fixed in llama-stack, so this is no longer reproducable, all tests pass for me after the changes in this PR. If you agree with this assessment, I'll ask Pavel for review & merge. |
|
@max-svistunov that sounds good to me :). Just to confirm tho the failing e2e test is just because of flakey behavior right? |
Description
Re-enable 8 MCP auth e2e test scenarios in library mode that were skipped
due to LCORE-1428 (ASGI exception when passing authorization headers to MCP
servers via
/queryand/streaming_queryin library mode).The underlying issue was in the llama-stack library client's request pipeline,
which has since been fixed upstream. The library client now correctly preserves
the
authorizationfield on MCP tool definitions when routing requests throughFastAPI endpoint wrappers.
Also increases the container health-check timeout in
restart_containerfrom15s to 60s — library mode embeds llama-stack and takes ~45-60s to start,
which caused all MCP auth scenarios (which restart the container per scenario)
to time out.
Type of change
Tools used to create PR
Related Tickets & Documents
Checklist before requesting a review
Testing
Build and start Docker library-mode stack:
FAISS_VECTOR_STORE_ID=test-store OPENAI_API_KEY=$OPENAI_API_KEY docker compose -f docker-compose-library.yaml up -d --buildRun MCP e2e tests in library mode:
FAISS_VECTOR_STORE_ID=test-store E2E_DEPLOYMENT_MODE=library uv run behave --tags=-skip --tags=MCP -D dump_errors=true @tests/e2e/test_list.txtResults: 25 scenarios passed, 0 failed (including the 8 previously-skipped library-mode scenarios for file, kubernetes, client, and OAuth auth on both query and streaming_query endpoints).