Skip to content

chore: extract context fragments into dedicated crate#26122

Merged
jif-oai merged 3 commits into
mainfrom
jif/extract-fragment
Jun 3, 2026
Merged

chore: extract context fragments into dedicated crate#26122
jif-oai merged 3 commits into
mainfrom
jif/extract-fragment

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Why

codex-core currently owns the generic contextual-fragment trait and several reusable fragment implementations. That makes it harder for other crates to share the same host-owned model-input abstraction without depending on all of codex-core.

This change extracts the reusable fragment machinery into a small codex-context-fragments crate so future extension and skills work can depend on the fragment abstraction directly.

What Changed

  • Added the codex-context-fragments crate with:
    • ContextualUserFragment
    • FragmentRegistration / FragmentRegistrationProxy
    • additional-context fragment types
  • Moved SkillInstructions into codex-core-skills, since skill-specific rendering belongs with skills rather than generic core context machinery.
  • Kept codex-core re-exporting the fragment types it still uses internally, so existing call sites keep the same shape.
  • Updated Cargo and Bazel workspace metadata for the new crate.

Verification

  • cargo metadata --locked --format-version 1 --no-deps
  • just bazel-lock-update
  • just bazel-lock-check

@jif-oai jif-oai requested a review from a team as a code owner June 3, 2026 09:21
@jif-oai jif-oai changed the title chore: extract fragment in a dedicated crate chore: extract context fragments into dedicated crate Jun 3, 2026

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

Copy link
Copy Markdown
Contributor

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: e5a46ba2ca

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

Comment thread codex-rs/Cargo.toml
Comment thread codex-rs/core-skills/src/skill_instructions.rs
@jif-oai jif-oai merged commit ac67905 into main Jun 3, 2026
46 checks passed
@jif-oai jif-oai deleted the jif/extract-fragment branch June 3, 2026 10:25
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 3, 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.

1 participant