Skip to content

[5/5] Move reasoning effort into step context#31737

Closed
aibrahim-oai wants to merge 1 commit into
step-context/propagate-stepfrom
step-context/reasoning-effort
Closed

[5/5] Move reasoning effort into step context#31737
aibrahim-oai wants to merge 1 commit into
step-context/propagate-stepfrom
step-context/reasoning-effort

Conversation

@aibrahim-oai

@aibrahim-oai aibrahim-oai commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Why

Reasoning effort is consumed by request-scoped work, but it is currently stored on the longer-lived TurnContext. With the captured step now propagated through sampling, compaction, guardian, and execution paths, the value can travel with the request snapshot that uses it.

What changed

  • Move reasoning_effort and the effective-effort helpers from TurnContext to StepContext.
  • Initialize the step value from the turn config when the step is captured.
  • Redirect request, rollout, guardian, analytics, tracing, MCP metadata, and test reads to the step-owned value.
  • Preserve the existing policy at each call site: model requests and rollout effort remain raw, while tracing and MCP metadata remain effective/defaulted. The task span is created before a step exists, so it computes the same prior effective tracing value from turn config.

Stacked on #31736. This is PR 5 of 5 and intentionally does not normalize raw effort to effective effort.

Validation

  • cargo check -p codex-core --tests --message-format short

@aibrahim-oai
aibrahim-oai force-pushed the step-context/propagate-step branch from 29e0fa2 to c1b75f0 Compare July 9, 2026 06:13
@aibrahim-oai
aibrahim-oai force-pushed the step-context/reasoning-effort branch from a44c1c4 to 98951f7 Compare July 9, 2026 06:13
@aibrahim-oai
aibrahim-oai force-pushed the step-context/propagate-step branch from c1b75f0 to fcc9c54 Compare July 9, 2026 06:53
@aibrahim-oai
aibrahim-oai force-pushed the step-context/reasoning-effort branch from 98951f7 to e769b78 Compare July 9, 2026 06:53
@aibrahim-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e769b785b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@aibrahim-oai aibrahim-oai changed the title Move reasoning effort into step context [4/4] Move reasoning effort into step context Jul 9, 2026
@aibrahim-oai
aibrahim-oai force-pushed the step-context/propagate-step branch from fcc9c54 to 8d52444 Compare July 9, 2026 21:41
@aibrahim-oai
aibrahim-oai force-pushed the step-context/reasoning-effort branch from e769b78 to c42baf6 Compare July 9, 2026 21:41
@aibrahim-oai aibrahim-oai changed the title [4/4] Move reasoning effort into step context [5/5] Move reasoning effort into step context Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: c42baf6b53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@aibrahim-oai
aibrahim-oai force-pushed the step-context/propagate-step branch from 8d52444 to 842106d Compare July 9, 2026 21:57
@aibrahim-oai
aibrahim-oai force-pushed the step-context/reasoning-effort branch from c42baf6 to 291ee93 Compare July 9, 2026 21:57
@aibrahim-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 291ee9387c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@aibrahim-oai
aibrahim-oai force-pushed the step-context/reasoning-effort branch from 291ee93 to 91dcea3 Compare July 9, 2026 23:35
@aibrahim-oai
aibrahim-oai force-pushed the step-context/propagate-step branch from 842106d to 9f8d7de Compare July 9, 2026 23:35
@aibrahim-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 91dcea3bbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@aibrahim-oai

Copy link
Copy Markdown
Contributor Author

Migrated to https://github.com/openai/codex-internal/pull/1673 following the codex-internal cutover. Please continue review there; this public PR is superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant