skills: resolve per-turn catalogs from turn input context (#26106)

## Why

The skills extension needs the resolved turn environments to build a
real per-turn `SkillListQuery`. The previous `TurnLifecycleContributor`
hook only had a turn id, so it could only seed a placeholder query and
never carry the executor authorities that executor-scoped skill routing
will need.

Moving catalog resolution onto `TurnInputContributor` puts the skills
extension on the same turn-preparation path that already has the
environment ids and working directories for the submitted turn, while
keeping the actual prompt injection work for follow-up changes.

## What changed

- switch `ext/skills` from `TurnLifecycleContributor` to
`TurnInputContributor`
- build `executor_authorities` from `TurnInputContext.environments` and
pass them through `SkillListQuery`
- keep storing the resolved catalog in `SkillsTurnState`, but drop the
placeholder query helper that no longer matches the real data flow
- update the extension TODOs to reflect that per-turn catalog resolution
now happens in the turn-input contributor, and that prompt/context
injection still needs to move later

## Testing

- Not run locally.
This commit is contained in:
jif
2026-06-03 13:32:55 +02:00
committed by GitHub
parent 51493157cd
commit 3389fa554e
35 changed files with 92 additions and 74 deletions
@@ -14,7 +14,7 @@ impl ApprovedCommandPrefixSaved {
}
impl ContextualUserFragment for ApprovedCommandPrefixSaved {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -18,7 +18,7 @@ impl AppsInstructions {
}
impl ContextualUserFragment for AppsInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -22,7 +22,7 @@ impl AvailablePluginsInstructions {
}
impl ContextualUserFragment for AvailablePluginsInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -21,7 +21,7 @@ impl From<AvailableSkills> for AvailableSkillsInstructions {
}
impl ContextualUserFragment for AvailableSkillsInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -22,7 +22,7 @@ impl CollaborationModeInstructions {
}
impl ContextualUserFragment for CollaborationModeInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -523,7 +523,7 @@ fn workspace_roots_from_turn_context_item(
}
impl ContextualUserFragment for EnvironmentContext {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -4,7 +4,7 @@ use super::ContextualUserFragment;
pub(crate) struct GuardianFollowupReviewReminder;
impl ContextualUserFragment for GuardianFollowupReviewReminder {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -12,7 +12,7 @@ impl HookAdditionalContext {
}
impl ContextualUserFragment for HookAdditionalContext {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -17,7 +17,7 @@ impl ImageGenerationInstructions {
}
impl ContextualUserFragment for ImageGenerationInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -76,7 +76,7 @@ impl InternalModelContextFragment {
}
impl ContextualUserFragment for InternalModelContextFragment {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -5,7 +5,7 @@ use super::ContextualUserFragment;
pub(crate) struct LegacyApplyPatchExecCommandWarning;
impl ContextualUserFragment for LegacyApplyPatchExecCommandWarning {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -5,7 +5,7 @@ use super::ContextualUserFragment;
pub(crate) struct LegacyModelMismatchWarning;
impl ContextualUserFragment for LegacyModelMismatchWarning {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -5,7 +5,7 @@ use super::ContextualUserFragment;
pub(crate) struct LegacyUnifiedExecProcessLimitWarning;
impl ContextualUserFragment for LegacyUnifiedExecProcessLimitWarning {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -14,7 +14,7 @@ impl ModelSwitchInstructions {
}
impl ContextualUserFragment for ModelSwitchInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -18,7 +18,7 @@ impl NetworkRuleSaved {
}
impl ContextualUserFragment for NetworkRuleSaved {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -12,7 +12,7 @@ impl PersonalitySpecInstructions {
}
impl ContextualUserFragment for PersonalitySpecInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -12,7 +12,7 @@ impl PluginInstructions {
}
impl ContextualUserFragment for PluginInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -17,7 +17,7 @@ impl RealtimeEndInstructions {
}
impl ContextualUserFragment for RealtimeEndInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -7,7 +7,7 @@ use codex_protocol::protocol::REALTIME_CONVERSATION_OPEN_TAG;
pub(crate) struct RealtimeStartInstructions;
impl ContextualUserFragment for RealtimeStartInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -16,7 +16,7 @@ impl RealtimeStartWithInstructions {
}
impl ContextualUserFragment for RealtimeStartWithInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"developer"
}
@@ -18,7 +18,7 @@ impl SubagentNotification {
}
impl ContextualUserFragment for SubagentNotification {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
+1 -1
View File
@@ -17,7 +17,7 @@ impl TurnAborted {
}
impl ContextualUserFragment for TurnAborted {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -7,7 +7,7 @@ pub(crate) struct UserInstructions {
}
impl ContextualUserFragment for UserInstructions {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}
@@ -27,7 +27,7 @@ impl UserShellCommand {
}
impl ContextualUserFragment for UserShellCommand {
fn role() -> &'static str {
fn role(&self) -> &'static str {
"user"
}