Classify contextual fragments with content kinds (#40180)

## What changed

- Require each `ContextualUserFragment` to provide a stable `<feature>.<name>`
  `ContentItemKind`.
- Add `AnnotatedContent` and `RenderedFragment` so rendered text, its role, and
  its classification can travel together to API boundaries.
- Derive extension-owned world-state classifications from the extension ID and
  keep the skills catalog classification with its fragment implementation.

## Testing

- Verify that an extension-owned world-state section renders with an
  `<extension-id>.instructions` content kind.

GitOrigin-RevId: e46b74a0bb41e0b6112667c9d36bc9e7f2714451
This commit is contained in:
pakrym-oai authored and copyberry committed 2026-08-23 03:44:21 +00:00
1 parent a1d4aea265
commit 422239eb4b
48 files changed
+375 -15

No files matched your search

@@ -2,6 +2,7 @@ use codex_context_fragments::ContextualUserFragment;
use codex_execpolicy::Policy;
use codex_protocol::config_types::ApprovalsReviewer;
use codex_protocol::config_types::SandboxMode;
use codex_protocol::models::ContentItemKind;
use codex_protocol::models::PermissionProfile;
use codex_protocol::models::format_allow_prefixes;
use codex_protocol::openai_models::ApprovalMessages;
@@ -177,6 +178,10 @@ impl ContextualUserFragment for PermissionsInstructions {
"developer"
}
fn content_kind(&self) -> ContentItemKind {
ContentItemKind("generic.permissions_instructions".to_string())
}
fn markers(&self) -> (&'static str, &'static str) {
Self::type_markers()
}