Skip to content

The agent that grows with you

fix(security): redact secrets in background process notifications

dsad6c7cfd662152
diff --git a/tools/process_registry.py b/tools/process_registry.py
index 0883fa1c225..d46341d0392 100644
--- a/tools/process_registry.py
+++ b/tools/process_registry.py
@@ -621,7 +621,7 @@ class ProcessRegistry:
if not self._global_watch_admit(now):
return
- self.completion_queue.put({
+ notification = {
"session_id": session.id,
"session_key": session.session_key,
"command": session.command,
@@ -635,7 +635,9 @@ class ProcessRegistry:
"user_name": session.watcher_user_name,
"thread_id": session.watcher_thread_id,
"message_id": session.watcher_message_id,
- })
+ }
+ _redact_process_result(notification)
+ self.completion_queue.put(notification)
def _global_watch_admit(self, now: float) -> bool:
"""Return True if this watch_match event is allowed through the global breaker.
@@ -1563,7 +1565,7 @@ class ProcessRegistry:
if was_running and session.notify_on_complete:
from tools.ansi_strip import strip_ansi
output_tail = strip_ansi(session.output_buffer[-2000:]) if session.output_buffer else ""
- self.completion_queue.put({
+ notification = {
"type": "completion",
"session_id": session.id,
"session_key": session.session_key,
@@ -1576,7 +1578,9 @@ class ProcessRegistry:
# a consumer-observed completion timestamp, this does not vary
# based on which watcher notices exit first.
"started_at": session.started_at,
- })
+ }
+ _redact_process_result(notification)
+ self.completion_queue.put(notification)
# ----- Query Methods -----