Skip to content

perf: avoid plugin cold loads in request hot paths - #109348

Merged
steipete merged 3 commits into
mainfrom
codex/avoid-hot-plugin-discovery
Jul 16, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/avoid-hot-plugin-discovery

Conversation

@steipete

@steipete steipete commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

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 /status repeated 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 /status avoid 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

  • Slack focused file: 65.46s test time before; 487ms after on Testbox. Local M4 wall time after: 12.00s (reported baseline: 43.7s).
  • DeepSeek /status: 576ms solo locally after the final review fix (reported baseline: 4.8s).
  • Focused files: 123 Slack tests and 41 status tests passed.
  • Sibling coverage passed across thinking, harness selection/runtime, provider policy, Codex/Copilot harnesses, and ACP bindings.
  • pnpm build passed.
  • Exact changed-surface gate passed: formatting, tsgo, oxlint, SDK surfaces, plugin boundaries, import cycles, and storage/runtime guards.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/29535537961
  • Final autoreview: clean, no accepted/actionable findings.

AI-assisted. I reviewed the implementation and validation evidence.

@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: 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".

Comment thread src/status/status-text.ts Resolved
@steipete
steipete force-pushed the codex/avoid-hot-plugin-discovery branch from 8b8a789 to 3bb1b0a Compare July 16, 2026 21:43

@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: 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".

Comment thread src/status/status-text.ts
Comment on lines +235 to +236
if (runtime !== "auto") {
return normalizeOptionalLowercaseString(runtime) || undefined;

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

@steipete
steipete merged commit 40b10eb into main Jul 16, 2026
184 of 188 checks passed
@steipete
steipete deleted the codex/avoid-hot-plugin-discovery branch July 16, 2026 21:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 17, 2026
* perf: avoid cold plugin discovery in hot paths

* chore: remove stale harness policy re-export

* fix: preserve active thinking clamps in status
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* perf: avoid cold plugin discovery in hot paths

* chore: remove stale harness policy re-export

* fix: preserve active thinking clamps in status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant