Skip to content

Move plugin and skill warmup into session startup#23535

Merged
aibrahim-oai merged 5 commits into
mainfrom
aibrahim/non-blocking-plugin-skill-warmup
May 20, 2026
Merged

Move plugin and skill warmup into session startup#23535
aibrahim-oai merged 5 commits into
mainfrom
aibrahim/non-blocking-plugin-skill-warmup

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented May 19, 2026

Why

Plugin and skill loading is useful as warmup and early validation, but session startup does not need to wait for that work before it can continue building the session. Keeping it on the serial startup path adds avoidable latency to every fresh thread start.

We still want invalid skill configurations to show up quickly, and we want the warmup to exercise the same plugin and skill manager caches that the normal turn path uses.

What changed

  • moved plugin and skill warmup into the session startup async path instead of eagerly awaiting it on the serial setup path
  • kept the warmup using the session's resolved filesystem/environment context so skill loading still sees the right roots
  • preserved early skill-load error logging so broken skill configurations still surface during startup
  • left the per-turn plugin and skill loading path unchanged, so turns still use the normal cached managers

Testing

  • Not run locally; relying on CI for validation.

@aibrahim-oai aibrahim-oai requested a review from a team as a code owner May 19, 2026 19:21
@aibrahim-oai aibrahim-oai changed the title Make session plugin and skill warmup non-blocking Move plugin and skill warmup into session startup May 19, 2026
@aibrahim-oai
Copy link
Copy Markdown
Collaborator Author

@codex review this

Copy link
Copy Markdown
Contributor

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

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: 1960204afa

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

thread_persistence_fut,
state_db_fut,
auth_and_mcp_fut,
plugin_and_skill_warmup_fut
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 Guard live thread before awaiting plugin warmup

When session startup is canceled while plugin/skill warmup is slow or blocked, adding plugin_and_skill_warmup_fut to this tokio::join! can leave a completed thread_persistence_fut result holding a LiveThread before LiveThreadInitGuard is constructed below. Dropping that unguarded LiveThread skips discard_thread, so the local store can retain a live recorder for a thread that never finished initializing; before this change, this warmup ran before opening thread persistence and did not create that cancellation window.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

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

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: d947f23d8d

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

use codex_protocol::protocol::ThreadMemoryMode;

use super::*;
use crate::BaseInstructions;
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.

P1 Badge Fix the new thread-store test imports

Running cargo test -p codex-thread-store init_guard_from_completed_join_branch_discards_on_task_cancellation fails to compile this new test because codex-thread-store does not expose crate::BaseInstructions; the codex_protocol::SessionSource reference below has the same module-path issue. Import BaseInstructions from codex_protocol::models and SessionSource from codex_protocol::protocol (then use SessionSource::Exec) so the crate's test target can build.

Useful? React with 👍 / 👎.

@aibrahim-oai aibrahim-oai merged commit 532b9c8 into main May 20, 2026
31 checks passed
@aibrahim-oai aibrahim-oai deleted the aibrahim/non-blocking-plugin-skill-warmup branch May 20, 2026 03:05
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants