mirror of
https://github.com/openai/codex.git
synced 2026-09-20 12:47:38 +00:00
## Why Environment settings saved for the next turn must not change MCP tool availability during the active turn. ## What changed - Use one captured environment snapshot for MCP policy evaluation and runtime publication, including selections that are still starting or have failed. - Compare both captured selections and ready environment handles when deciding whether to refresh the runtime, and rebuild the startup configuration when resolved selections change. - Preserve the configuration origin of failed selections so MCP authority evaluation retains whether configuration comes from the thread. - Box the MCP refresh future to keep it off the sampling request's stack. ## Testing Add a regression test that updates the environment MCP policy while a turn waits for user input, verifies the tool remains visible when that turn resumes, and verifies it disappears on the next turn. Extend snapshot tests to cover starting and failed selections. GitOrigin-RevId: cc2744b5137be69f000d70b0c7009b14079f39ae