Skip to content

fix(deepinfra): model list fails when HTTP proxy is required - #111428

Merged
steipete merged 1 commit into
openclaw:mainfrom
mushuiyu886:fix/deepinfra-discovery-trusted-proxy
Jul 19, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
mushuiyu886:fix/deepinfra-discovery-trusted-proxy

Conversation

@mushuiyu886

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users whose network requires a standard HTTP(S) proxy could not run the DeepInfra model list. The public catalog request timed out after five seconds and consumed the prepared model-runtime publication deadline, so the CLI exited before showing any models.

Why This Change Was Made

The fixed DeepInfra-owned catalog endpoint now uses OpenClaw's existing trusted-environment-proxy guarded-fetch preset. The change retains the existing hostname policy, SSRF checks, timeout, cache, pagination, redirect handling, response limits, connection release, and offline behavior.

Related implementation pattern: #110924

User Impact

DeepInfra users behind an eligible HTTP(S) proxy can list the current live catalog instead of seeing the CLI fail during startup. Networks without a working proxy continue to use the existing guarded timeout path.

Evidence

Live proof used only pnpm openclaw for OpenClaw runtime verification, with an isolated state directory and a test-only placeholder DEEPINFRA_API_KEY:

  • Before: pnpm openclaw models list --provider deepinfra --plain logged a 5,005 ms timeout for the official catalog and exited with prepared model runtime publication timed out.
  • Third-party control: DeepInfra's public OpenClaw model projection endpoint returned HTTP 200 with 168 tagged rows; 90 were tagged for the chat surface.
  • After: the same pnpm openclaw models list --provider deepinfra --plain command completed and listed 92 DeepInfra entries, including live models outside the 8 bundled fallback rows. A direct provider projection check reported live=true and 90 chat rows.
  • No-proxy control: after clearing all HTTP(S)/ALL proxy variables, the guarded request timed out after 5,004 ms and retained the pre-fix CLI failure, confirming the patch does not bypass the existing direct-network boundary.

Focused and extension verification:

  • Regression test failed before the production change because the guarded request omitted trusted_env_proxy.
  • node scripts/run-vitest.mjs extensions/deepinfra/provider-models.proxy.test.ts: 1/1 passed.
  • pnpm test:extension deepinfra: 13 files, 73/73 tests passed.
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 CI=1 node scripts/check-changed.mjs: passed, including format, Plugin SDK baseline, extension production/test typechecks, targeted lint, boundary, database-first, sidecar, and import-cycle checks.
  • codex review --base origin/main: no findings; reviewer independently ran 19 related tests and live proxy/direct controls.

No real inference request was made; the exercised third-party boundary is DeepInfra's public model catalog.

@mushuiyu886
mushuiyu886 marked this pull request as ready for review July 19, 2026 13:54
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 9:59 AM ET / 13:59 UTC.

Summary
The PR routes DeepInfra live model-catalog discovery through the existing trusted environment-proxy guarded-fetch mode and adds a focused regression test for that transport policy.

PR surface: Source +4, Tests +51. Total +55 across 2 files.

Reproducibility: yes. at source level: configure a network that requires an eligible HTTP(S) proxy and run pnpm openclaw models list --provider deepinfra --plain; the supplied before/after and no-proxy controls make the path concrete, though this review did not independently rerun it.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Next step before merge

  • [P2] No concrete repair is needed beyond routine maintainer review and normal CI gating for the current PR head.

Security
Cleared: The patch uses an existing SDK guarded-fetch preset for one fixed official HTTPS endpoint and introduces no dependency, permission, secret, or workflow change.

Review details

Best possible solution:

Keep the fixed DeepInfra URL on the shared guarded-fetch path, retain the focused regression test, and merge once the normal checks gate the current head.

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

Yes, at source level: configure a network that requires an eligible HTTP(S) proxy and run pnpm openclaw models list --provider deepinfra --plain; the supplied before/after and no-proxy controls make the path concrete, though this review did not independently rerun it.

Is this the best way to solve the issue?

Yes. Reusing the existing trusted environment-proxy mode at the fixed DeepInfra catalog boundary is narrower and safer than adding provider-specific proxy configuration or bypassing the shared SSRF guard.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5ae1f7f0f5e5.

Label changes

Label changes:

  • add P2: This corrects provider-specific catalog discovery for proxy-required users without evidence of a broader runtime outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix CLI behavior, a public catalog control, and a no-proxy control showing that the existing direct-network failure boundary remains intact; redact any private proxy details if this evidence is expanded.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix CLI behavior, a public catalog control, and a no-proxy control showing that the existing direct-network failure boundary remains intact; redact any private proxy details if this evidence is expanded.

Label justifications:

  • P2: This corrects provider-specific catalog discovery for proxy-required users without evidence of a broader runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides after-fix CLI behavior, a public catalog control, and a no-proxy control showing that the existing direct-network failure boundary remains intact; redact any private proxy details if this evidence is expanded.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix CLI behavior, a public catalog control, and a no-proxy control showing that the existing direct-network failure boundary remains intact; redact any private proxy details if this evidence is expanded.
Evidence reviewed

PR surface:

Source +4, Tests +51. Total +55 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 0 +4
Tests 1 51 0 +51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 55 0 +55

What I checked:

  • Changed runtime boundary: The only production change supplies a fetch guard wrapping the existing request parameters with the shared trusted-environment-proxy mode for the fixed DeepInfra catalog URL; it does not add a proxy setting, alter model parsing, or replace the discovery helper. (extensions/deepinfra/provider-models.ts:419, 860285e933a0)
  • Focused regression coverage: The added test verifies that discovery passes mode "trusted_env_proxy" to the SSRF guard for the official DeepInfra URL and releases the returned connection handle after a non-success response. (extensions/deepinfra/provider-models.proxy.test.ts:32, 860285e933a0)
  • Merged adjacent precedent: The related merged Hugging Face proxy-discovery fix uses the same shared transport direction, but it is an adjacent provider implementation rather than a replacement for this DeepInfra change. (extensions/huggingface, 331eb0d43921)
  • Real runtime proof supplied: The PR body records an isolated-state CLI before/after run against DeepInfra’s public catalog, a third-party HTTP 200 control, and a no-proxy control that retained the prior guarded timeout behavior. (860285e933a0)

Likely related people:

  • mushuiyu886: Previously authored the merged current-main Hugging Face provider discovery fix that established the same trusted-proxy guarded-fetch pattern. (role: recent adjacent contributor; confidence: high; commits: 331eb0d43921; files: extensions/huggingface, extensions/deepinfra/provider-models.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.

@steipete steipete self-assigned this Jul 19, 2026
@steipete
steipete force-pushed the fix/deepinfra-discovery-trusted-proxy branch from 860285e to 8f5f6f6 Compare July 19, 2026 16:13
@steipete

Copy link
Copy Markdown
Contributor

Maintainer land-ready verification for 8f5f6f63c1e64d860b2c7ee54b88c54225803b0a:

  • Deep review: the provider-local fetch guard is the best ownership boundary. The shared catalog helper also serves endpoints whose trust shape differs, so enabling environment proxies there by default would be too broad. No config, environment variable, or capability surface is added.
  • Focused proof: node scripts/run-vitest.mjs extensions/deepinfra/provider-models.proxy.test.ts extensions/deepinfra/provider-models.test.ts extensions/deepinfra/index.test.ts extensions/deepinfra/surface-model-catalogs.test.ts — 4 files, 38 tests passed.
  • Changed-surface proof: node scripts/check-changed.mjs -- extensions/deepinfra/provider-models.proxy.test.ts extensions/deepinfra/provider-models.ts — passed on Blacksmith Testbox run 29694191463, including extension production/test typechecks, formatting, lint, SDK baseline, boundary guards, database-first checks, sidecar checks, and import cycles.
  • Live provider control: the exact public projection endpoint returned HTTP 200 with 168 rows, including 90 chat rows; a direct no-proxy request also returned HTTP 200.
  • Autoreview: clean; no accepted/actionable findings.
  • Exact-head CI: run 29694431461 completed successfully, including openclaw/ci-gate.

Known proof gap: this maintainer host does not require an HTTP proxy, so I did not independently repeat the contributor's proxy-backed CLI run end to end. The regression test independently proves that the fixed DeepInfra endpoint enters the trusted environment-proxy mode and that the guarded connection is released; the shared guard's proxy, hostname, redirect, and response-cap contracts are covered by their owning tests.

@steipete
steipete merged commit a626330 into openclaw:main Jul 19, 2026
83 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: deepinfra P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants