Skip to content

[codex] Extract turn skill and plugin injections#23396

Merged
pakrym-oai merged 1 commit into
mainfrom
pakrym/refactor-turn-injections
May 19, 2026
Merged

[codex] Extract turn skill and plugin injections#23396
pakrym-oai merged 1 commit into
mainfrom
pakrym/refactor-turn-injections

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

run_turn had accumulated the turn-scoped skill, plugin, app, MCP, connector-selection, and analytics setup inline. That made the orchestration path harder to scan even though the actual turn item injection still needs to stay in run_turn so ordering is explicit.

What changed

This extracts that setup into build_skills_and_plugins, which returns the combined injection ResponseItems and the explicitly enabled connector IDs. run_turn now keeps the required orchestration pieces: context update recording, user input handling, connector selection merge, and the explicit per-item record_conversation_items calls for injection items.

The refactor keeps the change LOC-neutral in core/src/session/turn.rs and preserves the existing response-item based injection path.

Validation

  • cargo test -p codex-core collect_explicit_app_ids_from_skill_items
  • just fix -p codex-core

@pakrym-oai pakrym-oai marked this pull request as ready for review May 19, 2026 02:20
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 19, 2026 02:20
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3991201b88

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread codex-rs/core/src/session/turn.rs
@pakrym-oai pakrym-oai enabled auto-merge (squash) May 19, 2026 02:43
@pakrym-oai pakrym-oai merged commit 9e9a62d into main May 19, 2026
31 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/refactor-turn-injections branch May 19, 2026 03:33
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants