From bd15c1c8c1ebe21d9addbf90e908a0471f258672 Mon Sep 17 00:00:00 2001 From: TheLegendTubaGuy <95944177+thelegendtubaguy@users.noreply.github.com> Date: Tue, 3 Nov 2026 19:18:39 -0600 Subject: [PATCH] Connect the selected printer agent to a printer saved under the Orca agent (#17141) A printer saved while its preset used the default Orca agent stayed tagged "orca" after the preset moved to another agent such as Moonraker. select_machine() reused that entry as is, but the new agent's machine list can't see it, so the printer never connected and filament sync did nothing. select_machine() now re-inserts such an entry for the active agent, which retags it and replaces the placeholder access code with the preset's API key. Entries saved under any other agent are left alone, so a code entered for that agent is kept. Fixes #17004 (cherry picked from commit a30aa7ba8dd3b3c6ec6e553af7a5afb3d1b89bf5) --- src/slic3r/GUI/GUI_App.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 52c2fe5537..a110cf1f64 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4501,8 +4501,10 @@ void GUI_App::select_machine(const std::string& agent_id) } } - // If machine doesn't exist, create it first - if (!existing) { + // If machine doesn't exist, create it first. The Orca agent never connects, so an entry saved + // under it holds no binding; re-insert it for the active agent, whose machine list can't see + // it otherwise. Entries bound by any other agent stay with that agent. + if (!existing || (existing->printer_agent_id == ORCA_PRINTER_AGENT_ID && agent_id != ORCA_PRINTER_AGENT_ID)) { BBLocalMachine machine; machine.dev_id = dev_id; // We use dev_id as dev_ip to store the address (host:port) @@ -4517,7 +4519,7 @@ void GUI_App::select_machine(const std::string& agent_id) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to create machine dev_id=" << dev_id; return; } - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": created new machine dev_id=" << dev_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": created or adopted machine dev_id=" << dev_id; } else if (agent_id == MOONRAKER_PRINTER_AGENT_ID && existing->printer_agent_id == agent_id && (!existing->has_access_right() || existing->get_access_code() != access_code)) { existing->set_access_code(access_code);