Fix review blockers in record chat

- Add Task.Supervisor to app supervision tree
- Use tagged tuples instead of rescue for error handling
- Pass embedding_text from parent LiveView as prop
- Remove dead Completion struct fields
- Extract socket assigns before Task closure
- Log errors server-side, show generic user message
- Make build_system_prompt private, remove thin wrapper
- Extract do_send_message for retry reuse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claudio Ortolina
2026-02-22 10:20:58 +00:00
parent 6e6e419801
commit 8d38512712
10 changed files with 99 additions and 91 deletions
+1
View File
@@ -23,6 +23,7 @@ defmodule MusicLibrary.Application do
{Oban, Application.fetch_env!(:music_library, Oban)},
{Ecto.Migrator,
repos: Application.fetch_env!(:music_library, :ecto_repos), skip: skip_migrations?()},
{Task.Supervisor, name: MusicLibrary.TaskSupervisor},
{Phoenix.PubSub, name: MusicLibrary.PubSub},
{LastFm.Supervisor, LastFm.Config.resolve(:music_library)},
# Start a worker by calling: MusicLibrary.Worker.start_link(arg)