Repository navigation
improve(gateway): defer inactive plugin runtime imports - #119733
Conversation
d476bb9 to
0b320c9
Compare
Punchcard-Session: coral-workshop-workshop-3f
Punchcard-Session: coral-workshop-workshop-3f
Punchcard-Session: coral-workshop-workshop-3f
Punchcard-Session: coral-workshop-workshop-3f
Punchcard-Session: coral-workshop-workshop-3f
0b320c9 to
d7a9524
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 6:31 PM ET / 22:31 UTC. ClawSweeper reviewWhat this changesThe PR defers unused Talk, ACPX, Google Meet, and memory runtime imports so gateway startup and inactive plugin paths load less code before first use. Merge readinessNo blocking correctness or security finding was identified on the exact PR head. This is a maintainer-authored, maintainer-labeled partial repair for the broader cold-start report, so it should remain open for normal maintainer review rather than automated cleanup. Priority: P2 Review scores
Verification
How this fits togetherGateway startup registers bundled plugins before accepting connections, then routes later catalog, meeting, memory, and Talk work to those owners. The PR keeps registration lightweight and imports each owner runtime only when its operation is invoked. flowchart LR
A[Gateway startup] --> B[Plugin registration]
B --> C[Lightweight metadata]
C --> D[Gateway listener]
D --> E[First plugin operation]
E --> F[Owner runtime import]
F --> G[Catalog, meeting, memory, or Talk operation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +176, Tests +455. Total +631 across 23 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the lightweight registration/owner-runtime split, preserving the existing first-use contracts and the broader readiness decision tracked by #119087. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a performance refactor, and its body supplies matched runtime benchmarks rather than a discrete new functional bug reproduction. Is this the best way to solve the issue? Yes: keeping process-stable registration light and loading owner runtimes at first use addresses the import cost at its owner boundaries without changing readiness, config, or storage contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6d2ba0d5622f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer review completed against exact head
Proceeding to repo-native prepare; merge remains gated on the prepared exact head and green checks. |
|
Merged via squash.
|
) * perf(gateway): defer Talk relay cleanup imports Punchcard-Session: coral-workshop-workshop-3f * perf(acpx): defer Pi session catalog runtime Punchcard-Session: coral-workshop-workshop-3f * perf(google-meet): defer meeting runtime imports Punchcard-Session: coral-workshop-workshop-3f * improve(memory-core): defer scoped runtime access Punchcard-Session: coral-workshop-workshop-3f * perf(google-meet): defer SDK action helpers Punchcard-Session: coral-workshop-workshop-3f
…cope * origin/main: (24 commits) fix(backup): skip transient gateway lock databases (openclaw#119782) test(agents): use canonical auth session fixtures (openclaw#119821) fix(memory): keep QMD file hints after stale docid misses (issue openclaw#113041) (openclaw#113515) test(doctor): align fast-path repair contracts (openclaw#119812) perf(agents): index subagent recovery ownership (openclaw#119793) fix(gateway): keep chat startup off catalog discovery (openclaw#119742) fix(test): keep TUI PTY suites in their owner lane (openclaw#119787) docs: correct dashboard auth precedence (openclaw#119785) docs: document control ui owner handoff fix: grant host-authorized control ui owner access fix(worktrees): preserve registered roots during orphan cleanup (openclaw#119709) fix(matrix): prevent shared client key collisions (openclaw#119667) fix(diagnostics-otel): propagate exported span context (openclaw#112283) fix(worker): isolate state observer failures (openclaw#117507) fix(qa): attest realized profile executions (openclaw#119761) fix(gateway): finish successful sessions after timestamp races (openclaw#119752) fix(agents): fence restart recovery lifecycle (openclaw#119776) fix(ui): preserve chat history and active run timing (openclaw#119729) improve(ollama): reduce inactive startup cost (openclaw#119745) improve(gateway): defer inactive plugin runtime imports (openclaw#119733) ...
Related: #119087
What Problem This Solves
Reduces eager default-plugin runtime loading during Gateway startup and standalone agent commands when Talk relay cleanup, ACPX session catalog access, Google Meet operations, and memory operations are not used.
This is a partial repair for #119087. It does not change the Gateway readiness contract or claim to resolve the remaining product decision around core readiness versus optional plugin availability.
Why This Change Was Made
Keeps process-stable registration and cleanup metadata in lightweight modules, then defers owner-specific runtime imports until the operation that needs them. Configuration, storage, protocol, and readiness semantics remain unchanged.
The four owner-local changes are:
User Impact
Evidence
ad80956428560ca7f450bd3dadd2eb897acb0d6dd7a95249350fdbc448daccac50e8d1ac861305456d2ba0d5622fa7aa21a4770cb4c6fd93cae44e04; the two newer main commits are path-disjoint and GitHub reports the PR mergeable.2db3431f4aa198ba84c465bdf15506e783575431aa46d04457393283c7edfe672eeadc4c96b4c842; the current head preserves the same PR production diff after rebasing and includes only the previously reviewed lazy-import test-type narrowing.5028 -> 4778ms(-5.0%)5520 -> 5614ms(+1.7%; readiness semantics unchanged)956.1 -> 963.3MB(+0.8%); p95967.1 -> 967.9MB4450 -> 3729ms(-16.2%)4218 -> 3485ms(-17.4%)4546.9 -> 3714.4ms(-18.3%)4265 -> 3586ms(-15.9%)885.1 -> 857.3MB(-3.1%)5664 -> 4411ms(-22.1%)6171 -> 5298.5ms(-14.1%)960.4 -> 964.7MB(+0.45%)703.2 -> 628.0MB(-10.7%)511.7 -> 135.0MB(-73.6%)547.8 -> 364.3MB(-33.5%)3662 -> 2615ms(-28.6%)4026 -> 2795ms(-30.6%)5258 -> 2937ms(-44.1%)5002 -> 2848ms(-43.1%)gateway.ws-importsfalls from561.1 -> 11.4ms, whilesidecars.model-runtime-build.runtimePluginMsrises from261.8 -> 1147.9mson separate runners. The PR therefore does not claim to remove all readiness cost or close [Bug]: Gateway cold start regressed ~2.5x from 2026.7.1-beta.1 to 2026.7.2-beta.7 on a 1-vCPU container #119087.git diff --check, oxfmt, direct changed-file oxlint, and the no-reconcilesourcePerformancebuild pass.+578/-1067, net-489lines. Tests:+483/-36.Root cause: default plugin entrypoints mixed process-stable registration metadata with operational runtime imports, so registry construction loaded unrelated runtime graphs. The canonical fix is to keep registration lightweight and let each owner import its runtime at first use. No readiness fallback, compatibility shim, cache, or alternate execution path is added.
Sibling Codex protocol/runtime verification was performed against
openai/codexcommit9d00bb01c0a712fb7c2f5b002bdf33bcc0fc352c:codex-rs/app-server-protocol/src/protocol/common.rs:474-510,855-870codex-rs/app-server/src/message_processor.rs:520-579,659-681,699-735,763-817codex-rs/app-server/src/lib.rs:1150-1160The lazy plugin registration changes do not alter Codex initialize, thread/turn ordering, or shutdown-drain contracts.
Merge Gate
Merge only after clean exact-head CI and the latest exact-head ClawSweeper review has no unresolved
Before merge, finding, security, owner-decision, merge-risk, or blocking rank-up item.This PR was prepared with AI assistance.
Punchcard-Session: coral-workshop-workshop-3f