docs(run_agent): clarify why F401 re-exports stay

This commit is contained in:
Teknium 2026-05-28 21:58:08 -07:00
parent 00b8204cf4
commit f61fd59b62

View file

@ -65,6 +65,10 @@ from hermes_constants import get_hermes_home
# OpenAI lazy proxy + safe stdio + proxy URL helpers — see agent/process_bootstrap.py.
# `OpenAI` is re-exported here so `patch("run_agent.OpenAI", ...)` in tests works.
# The other `# noqa: F401` re-exports below cover names accessed via
# `mock.patch("run_agent.<X>")`, `from run_agent import <X>` in production
# siblings, or the `_ra().<X>` indirection in agent/system_prompt.py — none
# of which ruff's in-module usage scan can see.
from agent.process_bootstrap import (
OpenAI, # noqa: F401 # re-exported for tests that mock.patch("run_agent.OpenAI")
_SafeWriter, # noqa: F401 # re-exported for tests that `from run_agent import _SafeWriter`