Skip to content

fix(doctor): diagnose ignored web fetch proxy settings#109778

Merged
steipete merged 3 commits into
mainfrom
codex/doctor-trusted-proxy-env
Jul 17, 2026
Merged

fix(doctor): diagnose ignored web fetch proxy settings#109778
steipete merged 3 commits into
mainfrom
codex/doctor-trusted-proxy-env

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #95560

AI-assisted (approved by Peter)

What Problem This Solves

Fixes an issue where operators with HTTP(S) proxy environment variables could see web_fetch time out without doctor explaining that the tool still uses direct connections unless trusted proxy routing is explicitly enabled.

Why This Change Was Made

Doctor now detects effective HTTP(S) proxy variables in its process or the installed Gateway service, reports only variable names, probes direct TLS connectivity, and names the existing tools.web.fetch.useTrustedEnvProxy opt-in. It remains read-only: no startup warning and no automatic proxy trust.

User Impact

Operators get a concrete diagnosis and remediation command while the secure explicit-opt-in default remains unchanged. Thanks @Footree for the report and detailed reproduction.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: M maintainer Maintainer-authored PR labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(doctor): diagnose ignored web fetch proxy settings This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@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: ff2a1b00c6

ℹ️ 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".

service: Pick<GatewayService, "readCommand">;
}): Promise<ProxyEnvSource[]> {
const sources: ProxyEnvSource[] = [];
if (hasEnvHttpProxyConfigured("https", params.env)) {

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 Respect NO_PROXY before recommending proxy opt-in

When NO_PROXY/no_proxy bypasses the target, especially NO_PROXY=* or NO_PROXY=docs.openclaw.ai, this still treats the proxy as usable because hasEnvHttpProxyConfigured ignores bypass rules. The runtime path in src/infra/net/fetch-guard.ts only switches to the env proxy when shouldUseEnvHttpProxyForUrl(...) is true, and that helper returns false on NO_PROXY matches, so doctor can recommend tools.web.fetch.useTrustedEnvProxy even though enabling it will not change web_fetch routing for those targets.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 4:06 AM ET / 08:06 UTC.

Summary
Adds a read-only doctor diagnostic that detects HTTP(S) proxy variables, probes direct TLS connectivity, recommends the existing trusted-env-proxy opt-in, documents the behavior, and adds focused tests.

PR surface: Source +130, Tests +152, Docs +1. Total +283 across 5 files.

Reproducibility: no. high-confidence runtime reproduction was executed, but the source path is concrete: NO_PROXY=* or a matching bypass can leave proxy variables configured while the runtime still selects direct routing.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-web-fetch-proxy.test.ts, migration/backfill/repair: src/commands/doctor-web-fetch-proxy.ts, migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.ts, unknown-data-model-change: src/commands/doctor-web-fetch-proxy.test.ts, unknown-data-model-change: src/commands/doctor-web-fetch-proxy.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #95560
Summary: This PR is the candidate diagnostic fix for the open proxy-discoverability issue; the older global-proxy request covers substantially broader runtime behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Handle NO_PROXY and no_proxy using the same effective routing contract as web_fetch.
  • [P1] Attach a redacted terminal transcript or linked artifact showing the after-fix doctor output in a real fixture-proxy run.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR describes a live fixture-proxy run but provides no inspectable redacted terminal transcript or artifact; after adding proof, update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The live fixture claim does not show the actual emitted text, secret redaction, or observed result in a reviewable artifact.
  • [P1] The branch is behind current main, so the corrected head should be rebased and reviewed against the latest proxy contract before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the read-only doctor diagnostic, but gate its remediation through the same protocol-aware proxy and NO_PROXY applicability contract as web_fetch, add bypass regression cases, and attach a redacted terminal transcript from a real doctor run.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The contributor should resolve the existing NO_PROXY finding and add inspectable real behavior proof; the protected maintainer label keeps the PR in explicit human review.

Security
Cleared: The diff remains read-only, reports proxy variable names rather than values, preserves explicit proxy trust, and introduces no dependency, workflow, permission, or package-execution changes.

Review findings

  • [P2] Respect NO_PROXY before recommending proxy opt-in — src/commands/doctor-web-fetch-proxy.ts:54
Review details

Best possible solution:

Keep the read-only doctor diagnostic, but gate its remediation through the same protocol-aware proxy and NO_PROXY applicability contract as web_fetch, add bypass regression cases, and attach a redacted terminal transcript from a real doctor run.

Do we have a high-confidence way to reproduce the issue?

No high-confidence runtime reproduction was executed, but the source path is concrete: NO_PROXY=* or a matching bypass can leave proxy variables configured while the runtime still selects direct routing.

Is this the best way to solve the issue?

No in its current form; doctor is the correct owner and a read-only diagnostic is the narrowest safe approach, but it must reuse the runtime's effective proxy-and-bypass decision rather than infer applicability from proxy-variable presence.

Full review comments:

  • [P2] Respect NO_PROXY before recommending proxy opt-in — src/commands/doctor-web-fetch-proxy.ts:54
    Use the runtime's effective proxy decision before recommending tools.web.fetch.useTrustedEnvProxy. With NO_PROXY=* or a matching host bypass, the proxy variables are present but enabling the setting still leaves that destination on direct routing, so the current remediation can be ineffective; this blocker remains from the prior review cycle.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6ac15970a742.

Label changes

Label justifications:

  • P2: This addresses a real but bounded doctor-diagnostic gap, while the remaining defect affects remediation accuracy rather than core runtime availability.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR describes a live fixture-proxy run but provides no inspectable redacted terminal transcript or artifact; after adding proof, update the PR body to trigger review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +130, Tests +152, Docs +1. Total +283 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 130 0 +130
Tests 2 152 0 +152
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 283 0 +283

What I checked:

  • Diagnostic ignores bypass applicability: The new diagnostic treats an HTTP(S) proxy variable as actionable without checking whether NO_PROXY or no_proxy prevents the target from using that proxy. (src/commands/doctor-web-fetch-proxy.ts:54, e41b33eb44d8)
  • Current runtime contract: Merged proxy-routing history established that effective trusted proxy selection must combine protocol-aware HTTP(S) proxy detection with NO_PROXY matching; the implementation landed after review in merge commit f408bba. (src/infra/net/proxy-env.ts:74, f408bba)
  • Prior finding remains: The previous review raised the same NO_PROXY issue at SHA 432187f; the only later supplied commit changes a test-side emitted-value type assertion, not the diagnostic source. (src/commands/doctor-web-fetch-proxy.test.ts:14, e41b33eb44d8)
  • Proof is not inspectable: The PR body summarizes a fixture-proxy run but does not include the redacted terminal output or a linked artifact showing the actual after-fix diagnostic. (e41b33eb44d8)
  • Issue ownership: The PR explicitly targets the still-open proxy-discoverability report, while the older global-proxy request is broader than this doctor-only change. (e41b33eb44d8)

Likely related people:

  • steipete: Merged the trusted-proxy routing and hardened proxy-applicability changes, and authored the current doctor integration branch. (role: merger and recent adjacent contributor; confidence: high; commits: d7c3210cd6f5, f408bba, ff2a1b00c6c0; files: src/infra/net/fetch-guard.ts, src/infra/net/proxy-env.ts, src/commands/doctor-web-fetch-proxy.ts)
  • DhtIsCoding: Contributed the merged proxy-applicability work whose final form was rewritten to preserve strict routing for NO_PROXY and unsupported proxy cases. (role: recent proxy-contract contributor; confidence: high; commits: 56ef7fd, 6740ab2, f408bba; files: src/infra/net/proxy-env.ts, src/memory-host-sdk/host/remote-http.ts, packages/memory-host-sdk/src/host/remote-http.ts)
  • cluster2600: Authored the merged DNS-before-proxy dispatch change that established the trusted environment proxy path used by web fetch. (role: introduced adjacent trusted-proxy behavior; confidence: high; commits: 2a915fb22d, d7c3210cd6f5; files: src/infra/net/fetch-guard.ts, src/infra/net/fetch-guard.ssrf.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-17T07:58:00.283Z sha 432187f :: needs real behavior proof before merge. :: [P2] Respect NO_PROXY before recommending proxy opt-in

@steipete
steipete merged commit 92e5a10 into main Jul 17, 2026
115 of 119 checks passed
@steipete
steipete deleted the codex/doctor-trusted-proxy-env branch July 17, 2026 08:24
@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 18, 2026
* fix(doctor): diagnose direct web fetch proxy routing

* test(doctor): cover proxy diagnostic through public API

* test(doctor): validate emitted proxy diagnostic type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web_fetch: auto-enable useTrustedEnvProxy when HTTP_PROXY is detected

1 participant