Commit Graph

10 Commits

Author SHA1 Message Date
e47c57b50d Group pipeline runs into Langfuse sessions, tagged by trigger source
Each pipeline invocation (runAsync/searchAsync) now gets a fresh
sessionId, wrapped via the new Tracer.runWithSession() (implemented
with @langfuse/tracing's propagateAttributes, since v5 has no direct
sessionId/tags option on startObservation) so it shows up in
Langfuse's Sessions view. The session is also tagged with what
triggered the run: "cron", "api-list", "api-trigger", "api-search".

Verified: full test suite (79/79) passing, tsc/eslint clean, real
docker compose build + container smoke test against /health.
2026-08-12 22:51:17 +02:00
ae8bfaa2eb Fix final review findings: key leak, model fallback, error resilience, docs
- ApiClient: strip query string from ApiError messages so API keys
  (e.g. TMDb's api_key query param) never leak into 500 response
  bodies or logs.
- LlmTool: accept an optional defaultModel, wired from AppConfig's
  LLM_MODEL, so Langfuse prompts that omit a model config fall back
  to the configured LLM rather than silently requesting gpt-4o-mini.
- RecommendationPipeline: restore the Go original's graceful
  degradation — library/Radarr fetch failures, per-suggestion TMDb
  resolution failures, and per-signal TMDb similarity/recommendation
  failures are now logged and skipped instead of aborting the whole
  run (applies to both runInternal and searchAsync).
- RecommendationsController: validate the ?count= query param
  (must be a positive integer) instead of silently producing NaN.
- Commit the Langfuse prompt definitions (langfuse/*.prompt.json) and
  add a README covering setup, prompt seeding, cache invalidation,
  and the HTTP API surface — the branch was not otherwise runnable by
  anyone but the author.
2026-08-12 21:40:09 +02:00
e712470013 Add Health/Recommendations/Request/Webhook controllers 2026-08-12 21:21:26 +02:00
3c5f723d22 Isolate per-item Radarr failures in RecommendationPipeline.autoRequest
Matches the Go original's behavior: a lookup/addMovie failure for one
recommendation is logged and skipped rather than aborting the whole
auto-request batch.
2026-08-12 21:18:33 +02:00
62848f6ecd Add RecommendationPipeline 2026-08-12 21:15:21 +02:00
5edeb0ebb9 Add MovieRecommenderTool and MovieSearchTool 2026-08-12 21:14:10 +02:00
8e908408cd Add RadarrClient 2026-08-12 21:05:58 +02:00
4e483557d7 Add TmdbClient 2026-08-12 21:05:22 +02:00
9683d65a1f Add JellyfinClient 2026-08-12 21:04:47 +02:00
ef037d25fe Add app config schema and shared models 2026-08-12 21:04:15 +02:00