Refresh selected skill context at runtime#29965
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fab7e9a36
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let Some((generation, executor_catalog)) = thread_state.executor_catalog_snapshot() | ||
| else { | ||
| return Vec::new(); | ||
| }; |
There was a problem hiding this comment.
Handle host-skill steers when no executor snapshot exists
In sessions without selected executor capabilities, executor_catalog_snapshot() is None, so this new runtime-update path returns before checking whether input.user_input grew. A user who steers during a running turn with a normal host or bundled skill mention, for example $demo while a tool is executing, will have that input recorded but the skill contributor will not inject the skill instructions before the next model request; initial-turn mentions still work, so this only affects same-turn steers in threads with no executor snapshot. Use the existing turn catalog when only the input count advances, and treat the executor snapshot as optional.
Useful? React with 👍 / 👎.
| self.emit_warning(&input.turn_id, warning.clone()); | ||
| warnings.push(warning); | ||
| } | ||
| fragments.push(Box::new(SkillInstructions { |
There was a problem hiding this comment.
Review runtime skill instructions over 1k tokens
This runtime-update path can append a new SkillInstructions item after a same-turn steer selects a skill; contents comes from truncate_main_prompt_contents, whose cap is 8,000 bytes, so a single newly appended model-context item can still exceed 1k tokens. The repo's model-visible-context rule requires any new item that can cross that threshold to be highlighted as P0 for manual review, so this path needs that review or a smaller per-item bound.
AGENTS.md reference: AGENTS.md:L99-L99
Useful? React with 👍 / 👎.
| let config = thread_state.config(); | ||
| let mut fragments: Vec<Box<dyn ContextualUserFragment + Send>> = Vec::new(); | ||
| if config.include_instructions | ||
| && let Some(fragment) = available_skills_fragment(&incremental_catalog) |
There was a problem hiding this comment.
Review runtime skill catalogs over 1k tokens
This new runtime-update branch can append an AvailableSkillsInstructions developer fragment whenever executor skill generation advances; available_skills_fragment allows up to 8,000 bytes of skill-list text, so this is another new individual model-context item that can exceed 1k tokens. The model-visible-context rule requires such new items to be highlighted as P0 for manual review, or to be bounded below that threshold.
AGENTS.md reference: AGENTS.md:L99-L99
Useful? React with 👍 / 👎.
Summary