feat(ogagent): report busy state and os type in heartbeat ping

Add 'busy' and 'st' fields to the periodic webhook ping so ogCore can
track whether a client is executing a job without waiting for a command
response.

- oglive_worker: busy derived from thread_list running state, st='OGL'
- OpenGnSys module: busy derived from jobmgr active processes, st mapped
  from operations.os_type (LNX/WIN/OSX)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nofify_status_to_ping
Nicolas Arenas 2026-05-07 20:36:45 +02:00
parent f50d5a1197
commit da50ab5e7f
2 changed files with 5 additions and 0 deletions

View File

@ -125,9 +125,12 @@ class OpenGnSysWorker(ServerWorker):
time.sleep(1)
n += 1
if not n % 10:
_st_map = {'linux': 'LNX', 'macos': 'OSX', 'windows': 'WIN'}
body = {
"iph": self.interface.ip,
"timestamp": int(time.time()),
"busy": any(j['p'].poll() is None for j in self.jobmgr.jobs.values()),
"st": _st_map.get(operations.os_type.lower(), 'UNK'),
}
result = self.REST.sendMessage('clients/status/webhook', body)
if result is None:

View File

@ -260,6 +260,8 @@ class ogLiveWorker(ServerWorker):
body = {
'iph': self.IPlocal,
'timestamp': int (time.time()),
'busy': any(elem['running'] for elem in self.thread_list.values()),
'st': 'OGL',
}
#logger.debug (f'about to send ping ({body})')
self.REST.sendMessage ('clients/status/webhook', body)