mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
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:
@@ -628,7 +628,7 @@ async fn build_extension_turn_input_items(
|
||||
|
||||
let mut items = Vec::new();
|
||||
for contributor in contributors {
|
||||
let contributed_items = contributor
|
||||
let contributed_fragments = contributor
|
||||
.contribute(
|
||||
input.clone(),
|
||||
&sess.services.session_extension_data,
|
||||
@@ -638,7 +638,11 @@ async fn build_extension_turn_input_items(
|
||||
.or_cancel(cancellation_token)
|
||||
.await
|
||||
.ok()?;
|
||||
items.extend(contributed_items);
|
||||
items.extend(
|
||||
contributed_fragments
|
||||
.into_iter()
|
||||
.map(ContextualUserFragment::into_boxed_response_item),
|
||||
);
|
||||
}
|
||||
|
||||
Some(items)
|
||||
|
||||
Reference in New Issue
Block a user