@misterhuydo/sentinel 1.4.31 → 1.4.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-25T04:09:49.570Z",
3
- "checkpoint_at": "2026-03-25T04:09:49.571Z",
2
+ "message": "Auto-checkpoint at 2026-03-25T04:35:03.166Z",
3
+ "checkpoint_at": "2026-03-25T04:35:03.167Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.4.31",
3
+ "version": "1.4.33",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -716,10 +716,8 @@ def _setup_workspace_log() -> None:
716
716
  fmt = logging.Formatter("%(asctime)s %(levelname)-7s %(name)s — %(message)s")
717
717
  handler = logging.FileHandler(workspace_log, mode="w", encoding="utf-8")
718
718
  handler.setFormatter(fmt)
719
- # Main sentinel logger startup/shutdown messages
720
- # Boss + Slack loggers → conversation activity
721
- for name in ("sentinel", "sentinel.sentinel_boss", "sentinel.slack_bot"):
722
- logging.getLogger(name).addHandler(handler)
719
+ # Add to root sentinel logger only child loggers propagate up naturally
720
+ logging.getLogger("sentinel").addHandler(handler)
723
721
  except Exception as e:
724
722
  logger.warning("Could not open workspace log %s: %s", workspace_log, e)
725
723
 
@@ -49,6 +49,7 @@ class _Session:
49
49
  history: list = field(default_factory=list)
50
50
  history_loaded: bool = False
51
51
  busy: bool = False # True while a turn is being processed
52
+ thinking_ts: str = "" # ts of the current thinking-status message
52
53
 
53
54
 
54
55
  _sessions: dict[str, _Session] = {}
@@ -356,9 +357,16 @@ async def _dispatch(event: dict, client, cfg_loader, store) -> None:
356
357
  is_admin = (not admin_users) or (user_id in admin_users)
357
358
 
358
359
  if session.busy:
359
- # Still processing a previous turn from this user — drop the duplicate
360
+ # Still processing a previous turn from this user — update the existing status in-place
360
361
  logger.info("Boss: %s sent a message while still processing, ignoring", user_id)
361
- await _post(client, channel, f"_{random.choice(_THINKING_STATUS)} (still on it...)_")
362
+ if session.thinking_ts:
363
+ try:
364
+ await client.chat_update(
365
+ channel=channel, ts=session.thinking_ts,
366
+ text=f"_{random.choice(_THINKING_STATUS)} (still on it...)_",
367
+ )
368
+ except Exception:
369
+ pass # silently drop — no orphaned message
362
370
  return
363
371
 
364
372
  # Fetch any attached files (screenshots, logs, docs)
@@ -440,7 +448,8 @@ async def _run_turn(session: _Session, message: str, client, cfg_loader, store,
440
448
 
441
449
  # Post a random status and keep its ts so we can replace it with the real reply
442
450
  session.busy = True
443
- thinking_ts = await _post(client, channel, f"_{random.choice(_THINKING_STATUS)}_")
451
+ session.thinking_ts = await _post(client, channel, f"_{random.choice(_THINKING_STATUS)}_")
452
+ thinking_ts = session.thinking_ts
444
453
 
445
454
  attach_note = f" (+{len(attachments)} file(s))" if attachments else ""
446
455
  logger.info("Boss [%s] >> %s%s", session.user_name, message[:300], attach_note)
@@ -462,6 +471,7 @@ async def _run_turn(session: _Session, message: str, client, cfg_loader, store,
462
471
  reply = f":warning: Unhandled error: {e}"
463
472
  finally:
464
473
  session.busy = False
474
+ session.thinking_ts = ""
465
475
 
466
476
  logger.info("Boss [%s] << %s", session.user_name, reply[:300])
467
477