agent/php/tests/Unit
Snider 4c1fa56d17 fix(brain): wire Qdrant api-key header from BRAIN_QDRANT_API_KEY
BrainService::http() was building a PendingRequest with no auth
header, so when Qdrant has auth enabled (the production lthn.sh
deploy does) every upsert/lookup returned 401. The circuit breaker
logged the 401 via Cache::store('file'), which was the red-herring
cache-write error chased in the first #97 iteration.

Changes:
- BrainService loads + trims a Qdrant api key from
  config('brain.qdrant.api_key') in the constructor.
- New qdrantHttp() helper returns a PendingRequest with the
  api-key header when the key is non-empty, or the plain client
  otherwise. Ollama + Elasticsearch call sites still use http()
  (separate auth shapes).
- php/config.php adds a brain.qdrant.api_key entry reading
  env('BRAIN_QDRANT_API_KEY').
- Good/Bad/Ugly Pest tests cover: configured key → header sent,
  unset → header absent, empty-string → header absent.

Closes tasks.lthn.sh/view.php?id=97

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-24 05:21:15 +01:00
..
Concerns revert fcb9c189e5 2026-04-23 12:32:57 +01:00
Pipeline feat(pipeline): add MetaReader contract + Forgejo-backed implementation 2026-04-23 18:09:54 +01:00
.gitkeep revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AgentDetectionTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AgenticManagerTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
AgentToolRegistryTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
BrainServiceTest.php fix(brain): wire Qdrant api-key header from BRAIN_QDRANT_API_KEY 2026-04-24 05:21:15 +01:00
ClaudeServiceTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
GeminiServiceTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
OpenAIServiceTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00
ProcessContentTaskTest.php revert fcb9c189e5 2026-04-23 12:32:57 +01:00