{"repo":"NousResearch/hermes-agent","public_id":"127390","display_label":"Fix post-terminal stream close race in Codex","summary":"These items address a concurrency bug in Codex where closing a stream from the owner thread while a drain thread is still reading it causes file-descriptor recycling corruption. The fix transfers stream-close ownership to the drain thread and limits the owner thread to a socket shutdown.","subsystem":null,"counts":{"members":6,"open_issues":0,"open_issues_distinct":0,"open_prs":0,"closed_issues":1,"merged_prs":1,"attempt_prs":4},"landed_fix":{"status":"merged_to_main","basis":"structural","pr":130555},"resolution":{"state":"resolved","by":"pr-130555"},"freshness":{"state":"verified","last_verified_at":"2026-10-03T11:01:43+00:00","is_stale":false},"grouping":{"backbone":"STRUCTURAL_SPANNING","link_density":0.3333333333333333},"fix_edges":[{"issue_number":127390,"pr_number":130555,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true}],"members":[{"kind":"issue","number":127390,"title":"Codex Responses post-terminal drain: closing the stream from the owner thread while the drain thread reads it releases the fd under the reader's SSL BIO (fd-recycle corruption, same class as #29507)","url":null,"state":"closed"},{"kind":"pr","number":127391,"title":"fix(codex): the post-terminal drain thread owns the stream close; the owner thread only shuts the socket down (#127390)","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#130555","number":130555},{"kind":"pr","value":"#127390","number":127390}],"category":"superseded_by_pr","implication":"superseded"},"merged":false},{"kind":"pr","number":127503,"title":"fix(P1): fix(codex): post-terminal drain thread owns the stream close","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#127615","number":127615},{"kind":"pr","value":"#127390","number":127390},{"kind":"pr","value":"#130555","number":130555}],"category":"superseded_by_pr","implication":"superseded"},"merged":false},{"kind":"pr","number":127504,"title":"fix(P1): Bug: Codex Responses post-terminal drain fd-recycle corruption","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#127615","number":127615},{"kind":"pr","value":"#127390","number":127390},{"kind":"pr","value":"#130555","number":130555}],"category":"superseded_by_pr","implication":"superseded"},"merged":false},{"kind":"pr","number":127615,"title":"fix(codex): keep post-terminal cleanup on the reader thread","url":null,"state":"closed","close_reason":{"refs":[{"kind":"commit","value":"cdb8fd3ef2","number":0},{"kind":"pr","value":"#130555","number":130555}],"category":"merged_via","implication":"superseded"},"merged":false},{"kind":"pr","number":130555,"title":"Codex Responses: a slow post-reply stream drain no longer risks corrupting other open files (#127390, salvage #127615)","url":null,"state":"merged","close_reason":{"category":"merged","implication":"superseded"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["agent/agent_runtime_helpers.py","agent/chat_completion_helpers.py","agent/codex_runtime.py","tests/agent/test_run_agent_codex_responses.py"]}],"trust":{"default_tier":"verified","includes_suggested":false}}