fix(gateway): ensure undici env proxy dispatcher after startup#63490
fix(gateway): ensure undici env proxy dispatcher after startup#63490bowenluo718 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a call to Confidence Score: 5/5Safe to merge; the change is minimal, idempotent, and well-tested by existing coverage. Only finding is a P2 suggestion to pair the call with No files require special attention.
|
| // Ensure the env-based proxy dispatcher runs after startup so outbound traffic uses a consistent network profile. | ||
| ensureGlobalUndiciEnvProxyDispatcher(); |
There was a problem hiding this comment.
Missing
ensureGlobalUndiciStreamTimeouts companion call
The EnvHttpProxyAgent installed here has no timeout options set (bodyTimeout, headersTimeout). In attempt.ts, both functions are always called together — ensureGlobalUndiciEnvProxyDispatcher() then ensureGlobalUndiciStreamTimeouts() — so the agent-run path is fine. However, any gateway-level undici traffic that occurs between startup and the first agent run will go through a proxy dispatcher with no explicit stream timeouts. If that window is expected to be idle, this is acceptable; otherwise, consider pairing the calls here the same way attempt.ts does.
| // Ensure the env-based proxy dispatcher runs after startup so outbound traffic uses a consistent network profile. | |
| ensureGlobalUndiciEnvProxyDispatcher(); | |
| // Ensure the env-based proxy dispatcher runs after startup so outbound traffic uses a consistent network profile. | |
| ensureGlobalUndiciEnvProxyDispatcher(); | |
| ensureGlobalUndiciStreamTimeouts(); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/gateway/server.impl.ts
Line: 597-598
Comment:
**Missing `ensureGlobalUndiciStreamTimeouts` companion call**
The `EnvHttpProxyAgent` installed here has no timeout options set (`bodyTimeout`, `headersTimeout`). In `attempt.ts`, both functions are always called together — `ensureGlobalUndiciEnvProxyDispatcher()` then `ensureGlobalUndiciStreamTimeouts()` — so the agent-run path is fine. However, any gateway-level undici traffic that occurs between startup and the first agent run will go through a proxy dispatcher with no explicit stream timeouts. If that window is expected to be idle, this is acceptable; otherwise, consider pairing the calls here the same way `attempt.ts` does.
```suggestion
// Ensure the env-based proxy dispatcher runs after startup so outbound traffic uses a consistent network profile.
ensureGlobalUndiciEnvProxyDispatcher();
ensureGlobalUndiciStreamTimeouts();
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
It has been revised according to the feedback.
44e363e to
23f1918
Compare
|
Closing this as implemented after Codex automated review. Current main already implements PR #63490's central gateway env-proxy bootstrap. Best possible solution: Close #63490 as implemented on current main. Keep the maintained gateway startup bootstrap in What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Codex Review notes: model gpt-5.5, reasoning high; reviewed against d54d2d6b9b8a; fix evidence: commit d54d2d6b9b8a. |
Summary
Describe the problem and fix in 2–5 bullets:
If this PR fixes a plugin beta-release blocker, title it
fix(<plugin-id>): beta blocker - <summary>and link the matchingBeta blocker: <plugin-name> - <summary>issue labeledbeta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.