Skip to content

fix(models): use the configured proxy for local catalog refresh - #168554

Merged
obviyus merged 3 commits into
mainfrom
fix/models-list-refresh-proxy
Oct 10, 2026
Merged

obviyus merged 3 commits into
mainfrom
fix/models-list-refresh-proxy

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: openclaw models list --refresh skips the configured managed proxy when no Gateway is running.

User Impact

Users can refresh provider models through their configured proxy without starting a Gateway. Cached lists and Gateway requests still bypass CLI proxy startup. No config changes are required.

Why This Change Was Made

The CLI startup policy bypasses the proxy for model lists. Local refresh can make provider requests after that decision. Start the existing managed proxy only around local refresh, and release it in finally, including when discovery fails.

Evidence

  • The regression test on main (8bb392d9810) failed in two cases: local refresh did not start the proxy, and failed discovery did not release its handle. With this change, all 24 tests in list.prepared-catalog.test.ts passed. These cases also cover cached lists and Gateway refresh without proxy startup.
  • Ran the CLI with an isolated profile and no Gateway, using a local HTTP proxy and a synthetic Ollama server. The proxy logged CONNECT 192.168.254.254:19875, GET /api/tags, and POST /api/show. The CLI returned ollama/proxy-proof:latest as available, with a ready provider outcome.
  • Targeted lint passed. The formatter ran on the changed test, and git diff --check passed. Full-repository checks were not run locally.
  • The cached CLI command exited successfully with no proxy startup message and no new proxy log entries. It returned an empty cached inventory.

Merge risk: two-way door; a revert restores the prior behavior without a state migration. The change affects only provider discovery during local models list --refresh. Cached lists and Gateway transport keep their current policy.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: S labels Oct 10, 2026
@obviyus
obviyus marked this pull request as ready for review October 10, 2026 17:18
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR uses the existing managed proxy during standalone model catalog refresh and releases it afterward.

Example: Run openclaw models list --refresh without a Gateway against an Ollama endpoint reachable through the configured proxy.

  • Before: Discovery runs without activating the configured managed proxy.
  • After: The supplied CLI run discovers ollama/proxy-proof:latest as available with a ready provider outcome.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct lifecycle repair with relevant reported CLI transport evidence and no open findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The supplied isolated standalone CLI run exercises catalog discovery through a real HTTP proxy and synthetic Ollama server, records discovery requests and an available model, and includes a cached-read control; this review inspected the reported evidence without executing target code.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Without a Gateway, explicit model refresh can bypass the configured proxy and fail to discover provider models.
Reason: Restores existing operator-configured networking behavior with a narrow lifecycle repair and no new settings.

Merge readiness

✅ Ready for maintainer review

Keep this PR: current main still skips managed proxy activation during standalone catalog refresh, and the focused repair has no identified correctness defect.

Priority: P2
Reviewed head: 9b4fdf9294bfb5a4e45d080029c4efd408e6ba78

Before merge

None.

Findings

None.

Agent review details

How this fits together

The models CLI selects Gateway inventory or a standalone catalog owner, acquires provider models on explicit refresh, and renders the resulting inventory.

flowchart TD
  A[Models CLI] --> B[Gateway selection]
  B --> C[Gateway inventory]
  B --> D[Standalone catalog owner]
  D --> E[Managed proxy during refresh]
  E --> F[Provider discovery]
  C --> G[Model rows]
  F --> G
Loading

Technical review

Best possible solution:

Use the existing managed proxy lifecycle around standalone refresh while preserving passive reads and Gateway-owned requests.

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

Current-main source shows explicit standalone discovery after CLI startup bypasses managed proxy activation; the contributor also reports failing baseline regressions and successful CLI discovery after the fix.

Is this the best way to solve the issue?

The patch repairs routing at the standalone discovery boundary using the existing lifecycle owner, without adding networking policy or changing catalog ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 471035c7b7c8.

Provenance checked

  • Standalone catalog acquisition and CLI documentation keeps the original intent (89fcceb: Make ordinary browsing consume published inventory and reserve standalone discovery for explicit refresh.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current-main defect: Current main invokes standalone explicit catalog refresh without activating the managed proxy; the CLI startup policy separately gives models list networkProxy bypass. (src/commands/models/list.list-command.ts:108, 471035c7b7c8)
  • Introduced repair: The pinned introduced patch starts the existing proxy only for standalone refresh and awaits stopProxy in finally, preserving Gateway selection and catalog projection. (src/commands/models/list.list-command.ts:109, 9b4fdf9294bf)
  • Supplied CLI transport evidence: The complete PR body reports an isolated CLI run through a real local HTTP proxy and synthetic Ollama server, recording CONNECT, GET /api/tags, POST /api/show, and an available model; a cached-read control produced no new proxy traffic. (9b4fdf9294bf)
  • Original catalog ownership intent: refactor(models): read published catalog inventory through the Gateway #142063 established Gateway-owned browsing and standalone discovery only on explicit refresh; this PR preserves that contract. (src/commands/models/list.list-command.ts:108, 89fcceb655c1)
  • Lifecycle and regression coverage: The existing proxy owner supports disabled configuration, nested handles, startup rollback, and routing restoration; added tests protect activation ordering, cached/Gateway bypass, and release after failure. (src/infra/net/proxy/proxy-lifecycle.ts:191, 9b4fdf9294bf)
  • Re-review and inspection limits: The changed files are identical to the previous reviewed head, whose projection records no findings or published rank-up moves. Older history traversal encountered unavailable promisor objects; current source and relevant catalog history were readable. No target code or second reviewer ran, and the checkout remains clean. (9b4fdf9294bf)

PR surface

Source +6, Tests +29, Docs +2. Total +37 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 29 23 +6
Tests 1 29 0 +29
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 61 24 +37

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Standalone discovery can fail for operators who depend on their configured proxy, while Gateway refresh remains available.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-10T17:24:43.023Z sha e52cc51 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T17:44:41.208Z sha f7bf61d :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 2:17 PM ET / 18:17 UTC (Revision 3).

@obviyus
obviyus merged commit 4b1de20 into main Oct 10, 2026
103 checks passed
@obviyus
obviyus deleted the fix/models-list-refresh-proxy branch October 10, 2026 18:19
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 4b1de20. openclaw models list --refresh with no Gateway running now sends provider discovery through the configured managed proxy and releases it afterwards; cached lists and Gateway requests still start no proxy. Proof: regression red on main, and a local proxy logged the discovery requests on a real refresh while a cached list logged none.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…claw#168554)

## What Problem This Solves

Fixes: `openclaw models list --refresh` skips the configured managed proxy when no Gateway is running.

## User Impact

Users can refresh provider models through their configured proxy without starting a Gateway. Cached lists and Gateway requests still bypass CLI proxy startup. No config changes are required.

## Why This Change Was Made

The CLI startup policy bypasses the proxy for model lists. Local refresh can make provider requests after that decision. Start the existing managed proxy only around local refresh, and release it in `finally`, including when discovery fails.

## Evidence

- The regression test on main (`53f4d20b1f0`) failed in two cases: local refresh did not start the proxy, and failed discovery did not release its handle. With this change, all 24 tests in `list.prepared-catalog.test.ts` passed. These cases also cover cached lists and Gateway refresh without proxy startup.
- Ran the CLI with an isolated profile and no Gateway, using a local HTTP proxy and a synthetic Ollama server. The proxy logged `CONNECT 192.168.254.254:19875`, `GET /api/tags`, and `POST /api/show`. The CLI returned `ollama/proxy-proof:latest` as available, with a `ready` provider outcome.
- Targeted lint passed. The formatter ran on the changed test, and `git diff --check` passed. Full-repository checks were not run locally.
- The cached CLI command exited successfully with no proxy startup message and no new proxy log entries. It returned an empty cached inventory.

Merge risk: two-way door; a revert restores the prior behavior without a state migration. The change affects only provider discovery during local `models list --refresh`. Cached lists and Gateway transport keep their current policy.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 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.

1 participant