Skip to content

[skills] clear all caches on forced reload#29974

Open
hlevy-openai wants to merge 1 commit into
mainfrom
hlevy/skills-force-reload-cache
Open

[skills] clear all caches on forced reload#29974
hlevy-openai wants to merge 1 commit into
mainfrom
hlevy/skills-force-reload-cache

Conversation

@hlevy-openai

Copy link
Copy Markdown

Summary

  • Clear the shared skills cache when skills/list is called with forceReload, so turn-facing config-keyed snapshots are invalidated along with cwd snapshots.
  • Add an app-server regression covering a thread initialized before a user skill is added and verifying that the first turn after forced reload sees the new skill.

Validation

  • cargo fmt --check
  • cargo test -p codex-app-server --test all skills_list_force_reload_clears_turn_skills_cache -- --nocapture

The repository-prescribed just wrapper was unavailable in this environment, so the equivalent Cargo commands were run directly.

@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@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: 335a21340d

ℹ️ 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 skills_service = self.thread_manager.skills_service();
let plugins_manager = self.thread_manager.plugins_manager();
if force_reload {
skills_service.clear_cache();

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 Clear plugin snapshots during forced skill reload

forceReload now drops only SkillsService caches. For plugin-provided skills, a thread that has already warmed plugins_manager.plugins_for_config() keeps parsed PluginSkillSnapshots in the plugin manager cache; after a plugin skill is edited, skills/list can rescan it via the uncached layer-stack path, but the next turn rebuilds its skills snapshot from those stale plugin snapshots, leaving the model context with the old plugin skill despite the forced reload. Clear the plugin manager cache here as well before clearing the skills cache.

Useful? React with 👍 / 👎.

&server.uri(),
)?;

let mut mcp = TestAppServer::new(codex_home.path()).await?;

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 Use the auto environment for this thread test

In remote app/exec integration runs, starting the app server this way and then using a host TempDir as thread/start.cwd leaves the test bound to the app host instead of the executor fixture, so the new turn-based regression can fail or miss the foreign-OS path. Use TestAppServer::new_with_auto_env() together with send_thread_start_request_with_auto_env() for this test.

AGENTS.md reference: AGENTS.md:L252-L258

Useful? React with 👍 / 👎.

@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: 335a21340d

ℹ️ 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".

&server.uri(),
)?;

let mut mcp = TestAppServer::new(codex_home.path()).await?;

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 Use auto environment selection in this turn test

In foreign app/exec test runs, TestAppServer::new can inherit a remote executor while the test starts the thread with a host TempDir cwd, so the turn may resolve its primary environment against a path that the executor cannot see before this regression actually verifies cache invalidation. Use the auto-env helper and corresponding thread-start helper (or otherwise select the target-native test cwd) for this app-server integration test.

AGENTS.md reference: AGENTS.md:L256-L258

Useful? React with 👍 / 👎.

let skills_service = self.thread_manager.skills_service();
let plugins_manager = self.thread_manager.plugins_manager();
if force_reload {
skills_service.clear_cache();

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 Clear plugin skill snapshots on forced reload

When plugins are enabled, clearing only SkillsService still leaves PluginsManager's loaded plugin cache and its PluginSkillSnapshots intact. If a thread has already warmed plugins and then a plugin skill is added or edited, skills/list with forceReload can display the fresh disk scan, but the next turn's snapshot_for_config can be rebuilt from stale plugin snapshots, so the model still sees the old plugin skill set; clear the plugin cache along with the skills cache for this forced app-server API reload.

AGENTS.md reference: AGENTS.md:L102-L106

Useful? React with 👍 / 👎.

.await;
let skills_service = self.thread_manager.skills_service();
let plugins_manager = self.thread_manager.plugins_manager();
if force_reload {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@codex Doesn't snapshot_for_cwd handle force_reload and reset the cache already?

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.

Summary

Testing

  • cargo fmt --all
  • cargo fmt --all -- --check
  • git diff --check
  • ⚠️ just fmt (warning: environment lacked dotslash, and Python formatter dependency downloads were blocked by proxy/network 403)
  • ⚠️ just test -p codex-app-server --test all skills_list_force_reload_clears -- --nocapture (warning: cargo-nextest was not installed)
  • ⚠️ cargo install cargo-nextest --locked (warning: crates.io access was blocked by proxy/network 403)
  • ⚠️ cargo check -p codex-app-server --test all (warning: rusty_v8 archive download from GitHub was blocked by proxy/network 403)

Committed changes on the current branch and opened the follow-up PR: [skills] clear plugin snapshots on forced reload.

View task →

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.

2 participants