Repository navigation
fix(cron): mirror runner env proxy in model preflight - #102116
tonibofarull wants to merge 1 commit into
Conversation
The cron model preflight used STRICT DNS pinning while the model runner selects the env HTTP proxy for proxy-routed local vhosts (e.g. `inference.local`). That mismatch made the preflight false-negative and skip every run. Apply the same `shouldUseEnvHttpProxyForUrl` selection as the runner via `withTrustedEnvProxyGuardedFetchMode`; the hostname allowlist and allowPrivateNetwork policy still apply. Ref: NVIDIA/NemoClaw#5129
|
Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 8:49 PM ET / July 31, 2026, 00:49 UTC. ClawSweeper reviewWhat this changesThis PR makes cron’s local-model endpoint preflight use the same eligible environment HTTP proxy mode as the model runner, with regression coverage for both proxy and strict-DNS paths. Merge readinessKeep this PR open for maintainer review. The supplied patch is a narrow parity fix with credible live proxy evidence, but its July 8 head is behind current main and this review could not complete the required current-main and dependency-contract source pass. Likely related people: steipete is the discussion-routing candidate (low confidence). Priority: P2 Review scores
Verification
How this fits togetherCron jobs preflight a configured local model endpoint before beginning a scheduled run. The result controls whether the job proceeds to the provider transport or records an unavailable result and skips the run temporarily. flowchart LR
A[Cron schedule] --> B[Model provider preflight]
B --> C[Local provider endpoint]
C --> D{Environment proxy applies?}
D -->|Yes| E[Guarded trusted-proxy fetch]
D -->|No| F[Guarded strict fetch]
E --> G[Run or recorded skip]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +73. Total +87 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current main, retain one shared proxy-selection invariant with the normal provider transport, and revalidate both proxy-routed reachability and the denied-host/private-network guard behavior on the rebased head. Do we have a high-confidence way to reproduce the issue? No high-confidence current-main reproduction was completed in this review. The PR supplies a concrete before/after live proxy setup and the proposed source path is clear, so the mechanism is source-reproducible with medium confidence. Is this the best way to solve the issue? Unclear pending the current-main contract pass. Mirroring the runner is the right owner boundary if the current guarded trusted-proxy mode retains the preflight’s hostname and private-network restrictions after rebase. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bca8dd9cc162. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Hi @steipete, can you take a look? I saw you active in the last PRs. |
|
This pull request has been automatically marked as stale due to inactivity. |
NVIDIA/NemoClaw#5129 worked around this by patching OpenClaw's built dist in its Dockerfile. This PR fixes it at the source in OpenClaw directly.
What Problem This Solves
Fixes an issue where cron jobs against a local model provider that is only
reachable through the configured env HTTP proxy would see every scheduled run
silently skipped.
The cron model preflight probes the local provider endpoint before the runner
starts. It probed with strict DNS pinning, but the actual model runner
(
provider-transport-fetch) reaches that same endpoint through the env HTTPproxy. For proxy-routed local vhosts (e.g.
http://inference.local/v1), strictDNS pinning cannot resolve the hostname (it fails with
EAI_AGAIN), so thepreflight reports the endpoint as unavailable and skips the run.
Why This Change Was Made
The preflight now mirrors the runner's proxy selection so it predicts the same
reachability the runner will actually get.
The SSRF guard is unchanged: the probe still uses the configured provider's
exact hostname allowlist plus
allowPrivateNetwork, so the trusted-env-proxyupgrade only changes how the hostname is resolved, not which hosts are
permitted.
User Impact
Operators with cron jobs pointed at a local model provider reachable only via an
env HTTP proxy (e.g. a proxy-routed
inference.localvhost) no longer haveevery scheduled run skipped by a false-negative preflight. The preflight now
reports the endpoint as reachable, so cron runs proceed to the model runner like
any other provider. Hosts that do not need the env proxy are unaffected.
Evidence
Real behavior proof through a local env HTTP proxy. A real local HTTP forward
proxy (CONNECT-tunnel, like a real corporate/sandbox proxy) routes the
non-DNS-resolvable vhost
inference.localto a real local OpenAI-compatibleprovider (llama.cpp at
127.0.0.1:8084). RealHTTP_PROXYenv is set, and thereal
preflightCronModelProvideris called with no mocks ofshouldUseEnvHttpProxyForUrl. Same setup run on both branches.Nothing to redact:
inference.localis a synthetic non-resolvable vhost,127.0.0.1:8084is a local llama.cpp server, and the/v1/modelsGET carriesno credentials (the preflight ignores auth).
Before (origin/main, 6418e19)
shouldUseEnvHttpProxyForUrlis true, butmainprobes with STRICT pinned DNS,so it cannot resolve
inference.local(ENOTFOUND) and returns unavailable. Theskip is cached for 5 minutes, so every scheduled run is skipped.
After (tbc/fix-cron, 76e78cd)
{ "gitHead": "76e78cd5ae", "provider": "my-provider", "model": "unsloth/Qwen-AgentWorld-35B-A3B-GGUF:IQ3_XXS", "baseUrl": "http://inference.local/v1", "upstream": "127.0.0.1:8084", "shouldUseEnvHttpProxyForUrl": true, "httpProxy": "http://127.0.0.1:40913", "elapsedMs": 65, "preflightResult": { "status": "available" } }Same proxy env, but the preflight now mirrors the runner's
withTrustedEnvProxyGuardedFetchMode, so it reaches the real provider throughthe proxy in 68ms and returns available. The cron run proceeds like any other
provider.