Skip to content

fix(llama-cpp): detect llama-server on its new default port 9931 - #196594

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
erusev:llama-cpp-port-9931
Nov 25, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
erusev:llama-cpp-port-9931

Conversation

@erusev

@erusev erusev commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: openclaw onboard and runtime discovery don't find a llama-server started with default settings, because llama.cpp changed its default port.

User Impact

User impact: a llama-server on llama.cpp's current default port is detected with no URL to type. A llama-server from before llama.cpp b11521 still listens on 8080 by default; its URL now needs to be entered during setup, as the docs say. Saved configs are unaffected, since they always store an explicit baseUrl. For the official Docker image, publish host port 9931 to container port 8080 for automatic detection, or enter the existing published host port.

Why This Change Was Made

llama.cpp moved llama-server's default port from 8080 to 9931 in b11521 (ggml-org/llama.cpp#30159), and the plugin's external-server default still assumed 8080.

Evidence

  • vitest run extensions/llama-cpp: 25 files, 312 tests pass
  • Live, against llama-server on 9931 with isolated OpenClaw state: openclaw onboard --non-interactive --auth-choice llama-cpp-existing-server with no --custom-base-url discovered the server's 5 router models and set a default; openclaw agent --local completed a chat turn

Maintainer verification used the PR plugin source on OpenClaw 2026.11.7 with isolated profiles and two real llama.cpp b10210 routers explicitly bound to ports 9931 and 8080. The native default in llama.cpp b11521 and the Docker image's internal port were checked separately.

Operator action Observed result
Fresh non-interactive onboarding with --auth-choice llama-cpp-existing-server and no URL Saved http://127.0.0.1:9931/v1, selected llama-cpp/proof-gemma, and refreshed it as available.
Local agent turn on the automatically selected model status=ok, provider=llama-cpp, model=proof-gemma. The response reached the configured 64-token limit.
Reopen a configuration saved by OpenClaw 2026.11.1 and repeat onboarding without a URL Kept http://127.0.0.1:8080/v1 and llama-cpp/proof-legacy. A separate same-core plugin upgrade also refreshed the saved 8080 model as available.

The endpoint resolver returned default/saved ports 8080/8080 at base 46589542ffb6 and 9931/8080 with the fix. Focused CI exercised setup, explicit endpoints, and saved auth.

Independent committed-range autoreview covered 46589542ffb6..7eb55b5fd5c4 through P2 and reported no actionable findings. The maintainer correction adds only the Docker port-mapping instructions. The affected plugin code and tests are identical to the original tested revision.

llama.cpp moved llama-server's default port from 8080 to 9931 in b11521 (ggml-org/llama.cpp#30159), so guided detection, runtime discovery, and the setup placeholder missed servers started with defaults. Saved configs always carry an explicit baseUrl, so only unconfigured detection changes; a pre-b11521 server on 8080 now needs its URL entered in setup, which the docs say.
@clawsweeper

clawsweeper Bot commented Nov 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 extensions: llama-cpp size: XS labels Nov 10, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Changes unconfigured external llama-server discovery from port 8080 to 9931 and updates setup examples and Docker guidance.

Example: A native llama-server listens on port 9931 and the user onboards without entering a URL.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, source-consistent repair with real-entry-point results and verified preservation of explicit endpoints; exact-head CI remains in progress.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated body supplies observed results from real-router CLI onboarding, model refresh, and a local agent turn using the PR plugin on OpenClaw 2026.11.7, plus preservation of a saved 8080 configuration; the latest commit changes only documentation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A native llama-server started with current defaults is missed unless the user supplies its URL.
Reason: The upstream contract verifies the mismatch, and the repository member's corrective documentation commit adopts the 9931 default while explaining older native servers and Docker.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still uses port 8080, and this PR provides a focused correction for the verified upstream default change with no actionable code findings.

Reviewed head: 7eb55b5fd5c4f99d4c3bbb80d06d5da8678ba950

Before merge

None.

Findings

None.

Agent review details

How this fits together

The llama.cpp plugin resolves explicit or default endpoints for onboarding and model discovery, then supplies connection settings and discovered models to the normal inference transport.

flowchart LR
  A[Onboarding] --> C[Endpoint resolver]
  B[Runtime catalog] --> C
  D[Saved URL or default] --> C
  C --> E[llama-server discovery]
  E --> F[Models and connection settings]
Loading

Technical review

Best possible solution:

Land the shared-default correction with its saved-endpoint preservation and explicit older-server and Docker guidance once existing CI gates pass.

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

Current main defaults to 8080, whereas native llama.cpp b11521 defaults to 9931, so discovery without an explicit URL targets the wrong port; no target code was executed during this review.

Is this the best way to solve the issue?

Updating the existing shared constant is the smallest complete correction: setup and runtime discovery already consume it, explicit endpoints remain authoritative, and every introduced hunk serves the port change.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 57526886eb64.

Provenance checked

  • External-server default changes intended behavior with a stated reason (c2de320: First-class external llama-server support used the native server's then-current port 8080.)
  • Provider identity and documentation keeps the original intent (0135046: Managed and existing servers share one provider identity and protocol while process ownership stays explicit.)
  • URL validation keeps the original intent (6d9efe2: Reject malformed endpoints inline so users can correct them without restarting setup.)
  • Saved URL precedence and setup regression keeps the original intent (8ecdc96: Only saved URLs are prefilled; blank input uses the saved endpoint or the default, avoiding appended typed URLs.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Onur Solmaz: Raw commit c2de320 adds extensions/llama-cpp/src/external-server/setup.ts:387 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c2de3206d43a; files: extensions/llama-cpp/src/external-server/setup.ts)

PR surface

Source +2, Tests 0, Docs +7. Total +9 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 4 2 +2
Tests 1 2 2 0
Docs 1 12 5 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 18 9 +9

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Unconfigured endpoint default 8080 → 9931; no new configuration option Changes automatic discovery for older native servers and existing Docker host mappings; saved explicit URLs retain precedence.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • merge-risk: 🚨 compatibility: Unconfigured 8080 servers require explicit URL entry or a Docker host-port mapping; the maintainer's documentation commit adopts and explains this tradeoff.
  • 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 execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-10T10:26:03.357Z sha 895d2d9 :: needs real behavior proof before merge. :: none

Reviewed November 24, 2026, 9:37 PM ET / November 25, 2026, 02:37 UTC (Revision 2).

@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 25, 2026
@vincentkoc
vincentkoc merged commit 10fb351 into openclaw:main Nov 25, 2026
108 of 111 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…nclaw#196594)

* fix(llama-cpp): detect llama-server on its new default port 9931

llama.cpp moved llama-server's default port from 8080 to 9931 in b11521 (ggml-org/llama.cpp#30159), so guided detection, runtime discovery, and the setup placeholder missed servers started with defaults. Saved configs always carry an explicit baseUrl, so only unconfigured detection changes; a pre-b11521 server on 8080 now needs its URL entered in setup, which the docs say.

* docs(llama-cpp): explain Docker port mapping for discovery

---------

Co-authored-by: Vincent Koc <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 25, 2026
…6594)

* fix(llama-cpp): detect llama-server on its new default port 9931

llama.cpp moved llama-server's default port from 8080 to 9931 in b11521 (ggml-org/llama.cpp#30159), so guided detection, runtime discovery, and the setup placeholder missed servers started with defaults. Saved configs always carry an explicit baseUrl, so only unconfigured detection changes; a pre-b11521 server on 8080 now needs its URL entered in setup, which the docs say.

* docs(llama-cpp): explain Docker port mapping for discovery

---------

Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 10fb351)
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 26, 2026
…6594)

* fix(llama-cpp): detect llama-server on its new default port 9931

llama.cpp moved llama-server's default port from 8080 to 9931 in b11521 (ggml-org/llama.cpp#30159), so guided detection, runtime discovery, and the setup placeholder missed servers started with defaults. Saved configs always carry an explicit baseUrl, so only unconfigured detection changes; a pre-b11521 server on 8080 now needs its URL entered in setup, which the docs say.

* docs(llama-cpp): explain Docker port mapping for discovery

---------

Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 10fb351)
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: llama-cpp merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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: XS 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