UUID-based sidechat reuse for heartbeat\n\n- Add url command to muse-chat-api.py\n- Dispatcher: reuse_key -> thread UUID mapping in job-sidechats.json\n- Capture UUID after first send, reuse on subsequent runs\n- Fixes multi-spawn bug (was matching by auto-generated title)

This commit is contained in:
operator-main
2026-10-04 04:03:28 +00:00
parent a9812cd355
commit 844aa73bd9
3 changed files with 103 additions and 30 deletions
+8 -1
View File
@@ -378,6 +378,11 @@ def ev1(ws, expr, await_p=False):
return None
def cmd_url(ws):
"""Print current browser URL."""
url = ev(ws, "window.location.href")
print(url)
def cmd_upload(ws, filepath, message=None, dry_run=False):
"""Attach a file to the chat composer via CDP DOM.setFileInputFiles.
@@ -478,7 +483,7 @@ def main():
p = argparse.ArgumentParser()
p.add_argument('--account', required=True, choices=list(ACCOUNTS.keys()),
help='Agent name (matches node, profile, ACCOUNTS.md)')
p.add_argument('command', choices=['send', 'messages', 'wait', 'approvals', 'sidechat', 'upload'])
p.add_argument('command', choices=['send', 'messages', 'wait', 'approvals', 'sidechat', 'upload', 'url'])
p.add_argument('arg', nargs='*', default=[])
p.add_argument('--dry-run', action='store_true',
help='upload: stage attachment without sending')
@@ -524,6 +529,8 @@ def main():
else:
print(f"ERROR: unknown sidechat subcommand: {sub}", file=sys.stderr)
sys.exit(1)
elif args.command == 'url':
cmd_url(ws)
elif args.command == 'upload':
if not args.arg:
print("ERROR: upload requires a filepath", file=sys.stderr)