Files
codex/codex-rs/core/src/context/subagent_notification.rs
T
jif 3389fa554e 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.
2026-06-03 13:32:55 +02:00

43 lines
1020 B
Rust

use codex_protocol::protocol::AgentStatus;
use super::ContextualUserFragment;
#[derive(Debug, Clone, PartialEq)]
pub(crate) struct SubagentNotification {
pub(crate) agent_reference: String,
pub(crate) status: AgentStatus,
}
impl SubagentNotification {
pub(crate) fn new(agent_reference: impl Into<String>, status: AgentStatus) -> Self {
Self {
agent_reference: agent_reference.into(),
status,
}
}
}
impl ContextualUserFragment for SubagentNotification {
fn role(&self) -> &'static str {
"user"
}
fn markers(&self) -> (&'static str, &'static str) {
Self::type_markers()
}
fn type_markers() -> (&'static str, &'static str) {
("<subagent_notification>", "</subagent_notification>")
}
fn body(&self) -> String {
format!(
"\n{}\n",
serde_json::json!({
"agent_path": &self.agent_reference,
"status": &self.status,
})
)
}
}