[feat](trx-client): add diagnostic logging for decode pipeline

Log whether audio/decode is enabled at startup and warn when
/decode is requested but the decode channel was not set. Helps
diagnose broken decode pipelines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
2026-02-08 22:54:12 +01:00
parent b98475037c
commit dba2f0a9fb
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -302,6 +302,11 @@ async fn async_init() -> DynResult<AppState> {
set_audio_channels(rx_audio_tx.clone(), tx_audio_tx, stream_info_rx);
set_decode_channel(decode_tx.clone());
info!(
"Audio enabled: connecting to {}, decode channel set",
audio_addr
);
tokio::spawn(audio_client::run_audio_client(
audio_addr,
rx_audio_tx,
@@ -309,6 +314,8 @@ async fn async_init() -> DynResult<AppState> {
stream_info_tx,
decode_tx,
));
} else {
info!("Audio disabled in config, decode will not be available");
}
// Spawn frontends (skip appkit — it will be driven from main thread)
@@ -98,8 +98,10 @@ pub async fn events(
#[get("/decode")]
pub async fn decode_events() -> Result<HttpResponse, Error> {
let Some(decode_rx) = crate::server::audio::subscribe_decode() else {
tracing::warn!("/decode requested but decode channel not set (audio disabled?)");
return Ok(HttpResponse::NotFound().body("decode not enabled"));
};
tracing::info!("/decode SSE client connected");
let decode_stream = futures_util::stream::unfold(decode_rx, |mut rx| async move {
loop {