Skip to content

[codex] Make contextual user fragments dyn-renderable#23397

Merged
pakrym-oai merged 1 commit into
mainfrom
pakrym/contextual-user-fragment-dyn
May 19, 2026
Merged

[codex] Make contextual user fragments dyn-renderable#23397
pakrym-oai merged 1 commit into
mainfrom
pakrym/contextual-user-fragment-dyn

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

ContextualUserFragment needs to be usable behind dyn for render-only paths, but associated constants made the trait non-object-safe.

What changed

  • Replaced associated constants with trait methods so dyn ContextualUserFragment can render fragments.
  • Preserved the existing typed T::matches_text(text) registration pattern via type_markers().
  • Kept default render() on the main trait so implementations only provide role, markers, and body.
  • Added unit coverage for rendering a Box<dyn ContextualUserFragment>.

Verification

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

@pakrym-oai pakrym-oai marked this pull request as ready for review May 19, 2026 02:40
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 19, 2026 02:40
@pakrym-oai pakrym-oai merged commit ccbf013 into main May 19, 2026
31 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/contextual-user-fragment-dyn branch May 19, 2026 17:42
@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