Skip to content

Refresh selected skill context at runtime#29965

Open
jif-oai wants to merge 1 commit into
jif/activate-selected-capability-skillsfrom
jif/refresh-selected-skill-context
Open

Refresh selected skill context at runtime#29965
jif-oai wants to merge 1 commit into
jif/activate-selected-capability-skillsfrom
jif/refresh-selected-skill-context

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • let initialized turn-input contributors append bounded context after runtime preparation and newly accepted steers
  • refresh selected executor skill catalogs and instructions by capability generation while preserving full-catalog precedence
  • cover same-generation skill steers and same-turn continuation visibility end to end

@jif-oai jif-oai requested a review from a team as a code owner June 25, 2026 02:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +315 to +318
let Some((generation, executor_catalog)) = thread_state.executor_catalog_snapshot()
else {
return Vec::new();
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant