From efd2c53754ec924c27b03b025e68d8df0692cf48 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Fri, 27 Feb 2026 00:24:15 +0100 Subject: [PATCH] [fix](trx-server): auto-generate rig IDs when not specified in config When rigs are configured without explicit IDs in TOML, they now receive auto-generated IDs based on model name and index (e.g., "ft817_0", "soapysdr_1"). Previously, the default empty ID prevented auto-generation from triggering. Changes: - Set RigInstanceConfig default id to empty string (was "default") - This allows resolved_rigs() auto-generation to trigger for all rigs - Legacy single-rig path still gets explicit "default" ID - Auto-generated IDs now appear in HTTP API /rigs endpoint - Rig picker now displays auto-IDs correctly The fix ensures that rigs without explicit ids get proper identifiers that appear in the protocol and frontend selectors. Co-Authored-By: Claude Haiku 4.5 Signed-off-by: Stan Grams --- src/trx-server/src/config.rs | 2 +- src/trx-server/src/listener.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trx-server/src/config.rs b/src/trx-server/src/config.rs index a91746a..5d8fa25 100644 --- a/src/trx-server/src/config.rs +++ b/src/trx-server/src/config.rs @@ -54,7 +54,7 @@ pub struct RigInstanceConfig { impl Default for RigInstanceConfig { fn default() -> Self { Self { - id: "default".to_string(), + id: String::new(), // Empty by default so auto-generation triggers in resolved_rigs() name: None, rig: RigConfig::default(), behavior: BehaviorConfig::default(), diff --git a/src/trx-server/src/listener.rs b/src/trx-server/src/listener.rs index d9f3c24..8bd983c 100644 --- a/src/trx-server/src/listener.rs +++ b/src/trx-server/src/listener.rs @@ -461,6 +461,7 @@ mod tests { let _state_tx = state_tx; let handle = RigHandle { rig_id: "default".to_string(), + display_name: "Default Rig".to_string(), rig_tx, state_rx, audio_port: 4531,