Skip to content

fix(agent): prefer /props over /v1/props for llama.cpp server detection#13539

Open
Tranquil-Flow wants to merge 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/llamacpp-props-endpoint
Open

fix(agent): prefer /props over /v1/props for llama.cpp server detection#13539
Tranquil-Flow wants to merge 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/llamacpp-props-endpoint

Conversation

@Tranquil-Flow

@Tranquil-Flow Tranquil-Flow commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

llama.cpp exposes its properties endpoint at /props (server root), not /v1/props. The code had the probe order reversed — trying /v1/props first and falling back to /props. This caused detection failures or unnecessary latency when hitting current llama.cpp builds.

Swaps the probe order in both:

  • detect_local_server_type() — server type detection
  • fetch_endpoint_model_metadata() — model metadata fetching

Now tries /props first (native llama.cpp path), with /v1/props as fallback for older builds.

Related Issue

Closes #13091

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • detect_local_server_type(): swap probe order — try /props first, fall back to /v1/props
  • fetch_endpoint_model_metadata(): same swap

How to Test

  1. Run the new tests:
    pytest tests/agent/test_llamacpp_props_order.py -v
  2. 5 tests covering: correct probe order, fallback to /v1/props on 404, both-fail returns None, content validation (must contain default_generation_settings), and /v1 URL suffix normalization.

Platform tested: macOS 15 (Apple Silicon).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15 (Apple Silicon)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

pytest tests/agent/test_llamacpp_props_order.py -v
5 passed

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent loop, run_agent.py, prompt builder provider/ollama Ollama / local models labels Apr 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #13317 (open) which targets the same /props endpoint fix — may be a competing PR.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #13317 (open) which targets the same /props endpoint fix — may be a competing PR.

@Tranquil-Flow Tranquil-Flow force-pushed the fix/llamacpp-props-endpoint branch from f3bad1a to eef8c13 Compare May 25, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder provider/ollama Ollama / local models type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /v1/props should be GET /props

2 participants