fix(raft): set stdin=DEVNULL on bridge subprocess

Satisfies the repo-wide subprocess-stdin guard
(tests/tools/test_subprocess_stdin_guard.py); the long-lived bridge
child should not inherit the gateway's stdin.
This commit is contained in:
teknium1 2026-06-17 21:24:23 -07:00
parent a659ad00ed
commit 6a72fdcbbb
No known key found for this signature in database

View File

@ -533,7 +533,9 @@ class RaftAdapter(BasePlatformAdapter):
] ]
env = {**os.environ, "RAFT_CHANNEL_TOKEN": self._bridge_token} env = {**os.environ, "RAFT_CHANNEL_TOKEN": self._bridge_token}
try: try:
self._bridge_process = subprocess.Popen(cmd, env=env) self._bridge_process = subprocess.Popen(
cmd, env=env, stdin=subprocess.DEVNULL
)
logger.info("[raft] Spawned bridge pid=%d profile=%s endpoint=%s", self._bridge_process.pid, profile, endpoint) logger.info("[raft] Spawned bridge pid=%d profile=%s endpoint=%s", self._bridge_process.pid, profile, endpoint)
except Exception: except Exception:
logger.exception("[raft] Failed to spawn bridge") logger.exception("[raft] Failed to spawn bridge")