Bridges ExAthena.run/2 with the ExAthena.Chat.Tui App process.
Owns three responsibilities:
build_run_opts/2— the keyword list passed toExAthena.run/2, with sane defaults for local providers (Ollama, llama.cpp) and a finite-but generous 24h request timeout so a slow-thinking local model doesn't trip the default 60s timeout.select_initial_model/2— reconciles a desired model against what's actually installed, returning{:ok, _},{:fallback, _}, or{:error, _}so the App can decide how to surface the result.start/2/start/3— spawn an unsupervisedTaskthat runs the agent loop, sending{:athena_event, _}for each loop event and a terminal{:athena_done, _}or{:athena_error, _}when the run finishes. The task body is wrapped intry/rescue/catchso failures always reach the App (per the CLAUDE.md "Task.start silently swallows crashes" rule).
Summary
Functions
@spec build_run_opts(ExAthena.Chat.Session.t(), (term() -> term())) :: keyword()
@spec start(ExAthena.Chat.Session.t(), pid()) :: pid()
@spec start(ExAthena.Chat.Session.t(), pid(), keyword()) :: pid()