Skip to content

Commit 4e1ce8b

Browse files
CopilotHeDaas-Code
andcommitted
Fix critical bug: copilot signals were never connected
Root cause: Signal connection logic had a fatal flaw: - Line 1328 set _copilot_signals_connected = True BEFORE calling _connect_copilot_signals() - _connect_copilot_signals() checks this flag and returns early if True - Result: Signals NEVER got connected on first call! This explains why chat (and likely edit/create) buttons showed no response: - UI emitted signals properly - But no handlers were listening because connections failed silently Fix applied: - Changed condition from "if not hasattr" to "if not hasattr OR not value" - Now properly checks both existence AND value of the flag - Signals will connect on first toggle of copilot panel This was preventing ALL copilot functionality from working. Co-authored-by: HeDaas-Code <208586641+HeDaas-Code@users.noreply.github.com>
1 parent 4abc3e5 commit 4e1ce8b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/views/main_window.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,8 +1324,7 @@ def toggleCopilotPanel(self):
13241324
self._copilot_signals_lock = threading.Lock()
13251325

13261326
with self._copilot_signals_lock:
1327-
if not hasattr(self, '_copilot_signals_connected'):
1328-
self._copilot_signals_connected = True
1327+
if not hasattr(self, '_copilot_signals_connected') or not self._copilot_signals_connected:
13291328
self._connect_copilot_signals()
13301329
else:
13311330
info("Copilot面板已隐藏")

0 commit comments

Comments
 (0)