Skip to content

fix: support QDRANT_API_KEY and QDRANT_URL in supamem init - #2

Open
raphaelbahat wants to merge 3 commits into
dzmitrys-dev:mainfrom
raphaelbahat:fix/init-env-qdrant-auth
Open

fix: support QDRANT_API_KEY and QDRANT_URL in supamem init#2
raphaelbahat wants to merge 3 commits into
dzmitrys-dev:mainfrom
raphaelbahat:fix/init-env-qdrant-auth

Conversation

@raphaelbahat

Copy link
Copy Markdown

This PR resolves the issue where supamem init fails to authenticate with Qdrant even when QDRANT_API_KEY is set in the environment, causing a 401 (Unauthorized) error.

Changes:

  • src/supamem/init.py:
    • Updated probe_qdrant to support passing an optional api_key and setting the api-key header in the health-probe request.
    • Updated run_init to read QDRANT_API_KEY from the environment and pass it to both probe_qdrant and _get_client when creating the Qdrant client.
    • Added support for falling back to QDRANT_URL environment variable if --qdrant-url option is omitted.
  • tests/test_init.py:
    • Adjusted unit test mocks for probe_qdrant to support the updated function signature.
    • Added a new unit test test_run_init_respects_qdrant_env_vars to assert that environment variables are correctly resolved and passed to Qdrant.

Closes #1

Co-Authored-By: Oz oz-agent@warp.dev

raphaelbahat and others added 2 commits July 27, 2026 20:26
Support QDRANT_API_KEY and QDRANT_URL environment variables in Greenfield bootstrap (supamem init). Without this, supamem init ignores QDRANT_API_KEY and tries to connect to Qdrant without authentication, resulting in 401 Unauthorized, even if QDRANT_API_KEY is present in the env.

Co-Authored-By: Oz <oz-agent@warp.dev>
Ensure the QDRANT_API_KEY is supplied when probing Qdrant reachability inside supamem doctor. This prevents false unreachable reports if Qdrant requires authorization. Also updated test mock signatures in test_doctor.py.

Co-Authored-By: Oz <oz-agent@warp.dev>
@raphaelbahat
raphaelbahat force-pushed the fix/init-env-qdrant-auth branch from 60938e7 to e4aae45 Compare July 27, 2026 17:35
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.

supamem init ignores QDRANT_API_KEY environment variable (causing 401 Unauthorized)

1 participant