skills: cache orchestrator resources per thread#28336
Conversation
There was a problem hiding this comment.
💡 Codex Review
codex/codex-rs/ext/skills/src/state.rs
Lines 73 to 79 in 6234ef5
The catalog is now stored in a per-thread OnceCell, but MCP resources are intentionally hot-swapped when account/plugin changes queue a refresh (Session::refresh_mcp_servers_inner installs a new manager, and the app-server plugin/account processors clear skill caches). If discovery happens before apps are available, or a plugin/account change alters codex_apps, subsequent turns keep serving the stale empty/old catalog for this thread instead of observing the refreshed server. Please key this cache by a manager generation or clear it during refresh.
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Why
Hosted orchestrator skills are read through the remote MCP resource server. Within one thread, the same catalog or skill resource can be requested multiple times by prompt injection and the
skills.list/skills.readtools. Re-fetching adds latency and can make those surfaces observe different remote contents during the same thread.This is a follow-up to #28333: orchestrator skills remain limited to threads without a local executor, and those threads now get a stable per-thread view of the remote skill data they use.
What changed
skills.listandskills.readavailability checks.Verification