Repository navigation
perf: avoid plugin cold loads in request hot paths - #109348
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29409e05cd
ℹ️ 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".
8b8a789 to
3bb1b0a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bb1b0a141
ℹ️ 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".
| if (runtime !== "auto") { | ||
| return normalizeOptionalLowercaseString(runtime) || undefined; |
There was a problem hiding this comment.
Preserve implicit Codex fallback in status
When an OpenAI model implicitly resolves to Codex but the Codex harness is not registered or rejects the route, selectAgentHarness still falls back to OpenClaw (covered by the implicit-unavailable/unsupported selection tests). This early return bypasses that availability check, so /status can report Runtime: OpenAI Codex and load Codex synthetic usage even though the next turn will run on OpenClaw. Please route implicit policies through the same availability/selection path and only trust this direct return for explicit session/config overrides.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
* perf: avoid cold plugin discovery in hot paths * chore: remove stale harness policy re-export * fix: preserve active thinking clamps in status
* perf: avoid cold plugin discovery in hot paths * chore: remove stale harness policy re-export * fix: preserve active thinking clamps in status
Related: #41608
What Problem This Solves
Fixes an issue where status rendering and configured binding resolution could cold-load plugin manifests and evaluate bundled plugin source through jiti on request-time paths. CPU profiles showed one Slack routing test spending most of its runtime in jiti and filesystem discovery, while
/statusrepeated the same work for providers absent from the active registry.Why This Change Was Made
Configured binding compilation now rejects ordinary route bindings before consulting the loaded channel registry, and stateful bindings use only active channel plugins. Agent harness auto-selection and status thinking resolution now consume registered harness hints and active provider facts. A lightweight active-registry thinking projection preserves always-thinking provider clamps without restoring manifest discovery. Dynamic probing remains for external harnesses that do not publish hints, and Codex retains its static OpenAI thinking policy.
No changelog edit: release-note context belongs in the PR body for this maintainer change.
User Impact
Gateway routing and
/statusavoid broad plugin discovery on hot paths. Existing explicit harness selection, unknown external harness probing, ACP bindings, always-thinking models, and Codex thinking-level behavior remain intact.Evidence
/status: 576ms solo locally after the final review fix (reported baseline: 4.8s).pnpm buildpassed.AI-assisted. I reviewed the implementation and validation evidence.