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 committed by Teknium
parent 22ccb12c30
commit 7d86178cf5

View file

@ -533,7 +533,9 @@ class RaftAdapter(BasePlatformAdapter):
]
env = {**os.environ, "RAFT_CHANNEL_TOKEN": self._bridge_token}
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)
except Exception:
logger.exception("[raft] Failed to spawn bridge")