[2/5] Split step capture from environment refresh#31912
Draft
aibrahim-oai wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
@codex review |
Contributor
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
98bb4cd to
27064c1
Compare
4055519 to
1a92f60
Compare
Contributor
Author
|
@codex review |
Contributor
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
1a92f60 to
b6ca728
Compare
27064c1 to
db2a273
Compare
Contributor
Author
|
@codex review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Step capture currently combines constructing a request-scoped holder with refreshing environments, capability roots, AGENTS.md, and MCP state. Splitting the function itself lets the next stacked change retain a lightweight step on the active task without moving refresh work earlier in the task lifecycle.
What changed
Session::capture_step_contextthe synchronous lightweight phase, using the turn environment and currently published MCP runtime.StepContext::refresh_env.capture_step_context(...).refresh_env(...).await, including sampling, compaction, prewarm, history/debug, and test callers.The heavy refresh still runs at the same boundaries as before. This is PR 2 of 5, stacked on #31734, and intentionally does not store a step on the active task.
Validation
cargo check -p codex-core --tests --message-format shortjust test -p codex-core --lib(2,007 passed, 3 skipped at the stack head)