Sidechat: render wait, direct send, stderr logging\n\n- Wait for Side chats to render before finding + button\n- Dispatcher: send_to_current_chat for sidechat jobs\n- Log stderr on create failure

This commit is contained in:
operator-main
2026-10-04 03:29:21 +00:00
parent 5feca52602
commit 1cffacc7d1
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -106,11 +106,14 @@ def create_sidechat(sender_agent, dry_run=False):
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=90)
output = result.stdout.strip()
err = result.stderr.strip()
# Success if we see "Created:" (URL may be /thread/new placeholder)
if "Created:" in output:
print(f"Sidechat created", file=sys.stderr)
return True
print(f"Sidechat create failed: {output[:200]}", file=sys.stderr)
print(f"Sidechat create failed. stdout: {output[:300]}", file=sys.stderr)
print(f"Sidechat create stderr: {err[:300]}", file=sys.stderr)
print(f"Return code: {result.returncode}", file=sys.stderr)
return False
except Exception as e:
print(f"Sidechat creation failed: {e}", file=sys.stderr)
+6
View File
@@ -274,6 +274,12 @@ def cmd_sidechat_create(ws):
# Fixed 2026-10-04: removed Ctrl+J, it was closing the always-open panel.
# The + button sits next to the "Side chats" header (see screenshot 2026-10-04).
# It's not labeled "New side chat" - find it by proximity to the header text.
# Wait for React to render the sidebar content first (up to 10s).
for _wait in range(10):
_has_header = ev(ws, "document.body.innerText.includes('Side chats')")
if _has_header:
break
_time.sleep(1)
result = ev(ws, """(() => {
// Strategy 1: Find button with "+" text near "Side chats"
const header = [...document.querySelectorAll('*')].find(el =>