[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 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-02-27 00:24:15 +01:00
parent a370742d2b
commit efd2c53754
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ pub struct RigInstanceConfig {
impl Default for RigInstanceConfig { impl Default for RigInstanceConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
id: "default".to_string(), id: String::new(), // Empty by default so auto-generation triggers in resolved_rigs()
name: None, name: None,
rig: RigConfig::default(), rig: RigConfig::default(),
behavior: BehaviorConfig::default(), behavior: BehaviorConfig::default(),
+1
View File
@@ -461,6 +461,7 @@ mod tests {
let _state_tx = state_tx; let _state_tx = state_tx;
let handle = RigHandle { let handle = RigHandle {
rig_id: "default".to_string(), rig_id: "default".to_string(),
display_name: "Default Rig".to_string(),
rig_tx, rig_tx,
state_rx, state_rx,
audio_port: 4531, audio_port: 4531,