Repository navigation
improve(decisions): reuse connections for repeated evaluations - #174002
Merged
vincentkoc merged 3 commits intoOct 17, 2026
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
vincentkoc
marked this pull request as ready for review
October 16, 2026 08:11
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
vincentkoc
deleted the
perf/decision-provider-transport-reuse-20261016
branch
October 17, 2026 02:45
Member
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 17, 2026
…law#174002) * perf(decisions): reuse guarded provider connections * test(decisions): intercept the pooled TypeSafe transport * fix(agents): keep provider dispatcher pool private
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Repeated OpenAI and TypeSafe Decision evaluations create fresh direct HTTP transports instead of reusing the bounded connection pool already used for model requests.
User Impact
Eligible direct Decision requests can reuse connections without changing payloads, credentials, deadlines, retries, or proxy/TLS behavior. No configuration or migration is required.
Why This Change Was Made
Expose
fetchWithProviderHttpGuardthrough the existingprovider-httpSDK entry and route model fetches plus both Decision adapters through that helper. The existing provider lifecycle remains the sole pool owner; plugins receive no raw pool or shutdown capability.The guard performs fresh DNS/SSRF validation before acquisition and pools only eligible direct requests. Each caller retains response parsing and
finallyrelease. Shutdown keeps the closing generation until it settles; requests during closure use caller-owned dispatchers rather than publishing a competing pool. The correction makes the unused internal getter private and exercises that lifecycle through a real public-SDK HTTP socket test.Current diff: production +25/-13 (net +12), tests +100/-68 (net +32), documentation +8. The production delta establishes the shared SDK capability while removing duplicate pool selection. No production latency, cost-saving, authenticated inference, or external-service benchmark claim is made.
Evidence
bc5cdd489f3018e3e519b25c102ac86421f8b7de. Signed commits, targeted formatting, direct source review and independent review are clean. Current main's adjacent credential-authority checks and response cleanup remain separate and must be preserved by the merge.34a1ccda3d806f6585d5fceededf0d3a4efbce70, composing bc5 with main33f497e178d7acf5a48c940f00b18096de279672, not the literal branch tree.node scripts/generate-npm-package-lock.mjs --all --jobs 1, exit 0, literal bc5 inputs unchanged before/after. The qualified local fallback used macOS arm64, official checksum-verified Node 24.21.0 and bundled npm 11.19.0, isolated HOME/config/cache/temp, the unchanged generator dependency closure, and the normal child timeout. This is local recovery proof, not a green rerun or Linux execution claim. A prior attempt failed before validation because two isolated npm config selectors pointed to the same file; distinct absent config files repaired that envelope only.3ce2e8ff2248f7b9802369da677cb7ec7d9d5f81proof remains historical. Queued remote allocations that never ran are not test evidence.Broader Failed Run
The main-shaped run remains failed. Its eight nonaggregate failures and downstream aggregate are retained; they are not relabeled as green PR CI. Independent review accepted the following existing-source attributions and targeted recovery:
586e70d4in #174015 addresses the baseline import boundary.ECONNRESET, before any completed mismatch assertion. The exact-source 105-lock local pass above closes this incomplete proof.7a43e126in #173991 andc316ecaain #173919. The F2 pool getter is private in bc5 and is not among these remaining diagnostics.embedded-agent-subscribe.directive-delivery.test.ts:294. It independently reproduced in non-F2 run38936572406/job117094242847, and again at the later U3 head; relevant owner/dependency inputs are unchanged by F2. This is not a matched-runtime untouched-main replay.acaaa6088a1c90500c08425fdfc88714070b9bbbremoves that batching owner. Historical run38881445511/job116909405647 has the exact repaired owner blob and records 4096 events in 213.361 ms, test 236 ms. Node 24.21 versus failing 24.19 means this is not fresh matched-runtime proof.ran, receivedfailed. Independent scheduled-main run38962862509/job117182388806, head6c07f3ddc035e3d6ee1bdf266f3f368b8a705bd3, fails the same assertion with the explicit reason that the heartbeat session was deleted while work was starting. The fixture's epoch clock creates a row removed by wall-clock retention. Canonical18c09e5c0f381d4e8cac3cbae8c5e7c2a2dbfd83usesDate.nowand preserves the assertions. The original F2 log did not expose that full reason; no fresh F2 heartbeat execution is claimed.instructions. Direct inspection of pinned Codex 0.162.0 shows base instructions prepended to request input in client.rs:900-1018, with developer role in context/base_instructions.rs:26-44. Canonicale2872f9330af34aeb243b0366248d4f00d1fd14ccorrects the assertion while retaining exact serialized instruction equality. This is contract attribution, not fresh F2 execution.Aggregate117048807484 failed downstream. The successful PR run and failed manual broader run remain distinct. Native completed-evidence qualification and ordinary live head, authority, review, security, and required-check guards decide admission; no invented tested-merge identity or blanket admin waiver is used.