Repository navigation
fix: CLI keyless explicit ollama/ models and tolerant local probe - #6229
Conversation
…erant (fixes #6228) - Gate explicit ollama/ and ollama_chat/ models on the server answering /api/tags (OLLAMA_API_BASE, OLLAMA_HOST, or 127.0.0.1:11434) instead of requiring OLLAMA_HOST as a credential. - Unreachable Ollama now says to start it with `ollama serve` rather than asking for an API key. - Raise the local probe timeout from 0.15s to 1s; a running Ollama can take ~0.35s on its first call. - Only print the 'would be used automatically' hint when auto-detection actually ran; name the model when one was given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
@coderabbitai review |
|
/review |
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Action not completed
|
[Medium impact] The changes affect keyless model checks across CLI workflows. The PR still needs to fix the endpoint check for remote agents whose model comes from outside their definition. Findings
SummaryThis PR lets explicit Ollama models pass the CLI's credential check when their server answers.
Reviews (2) · Last reviewed commit: "fix: gate explicit Ollama agents on thei..." · Reviewed by Greptile |
| return ( | ||
| os.environ.get("OLLAMA_API_BASE") | ||
| or os.environ.get("OLLAMA_HOST") | ||
| or _DEFAULT_OLLAMA_HOST | ||
| ) |
There was a problem hiding this comment.
Working remote agents are blocked
For run --agent, the gate receives only llm.model, but the agent later sends requests to its declared llm.base_url. This new check ignores that address and probes OLLAMA_API_BASE, OLLAMA_HOST, or localhost instead. If that different server is down, the CLI rejects the agent even when its actual Ollama server is running. Previously, setting OLLAMA_HOST let these configurations pass.
Pass the selected endpoint into the gate and probe the server the agent will actually use.
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Review changes in this PR. Python SDK: praisonaiagents, praisonai. TypeScript SDK: src/praisonai-ts/. Do NOT modify src/praisonai-rust. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. MANDATORY READ (before reviewing):
Phase 1: Review per AGENTS.md
MANDATORY COMMENT FORMAT — include this Phase 1 table in your review comment: Phase 1 — AGENTS.md review
For TypeScript PRs (src/praisonai-ts/), also add: Phase 2: FIX Valid Issues Phase 3: Final Verdict |
…MA_HOST Addresses review on #6229: run --agent with llm.base_url probed the env/default host instead of the server the agent actually calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final architecture reviewPhase 1 — AGENTS.md review
Phase 2 — Fixes pushed (5baea8d)Valid finding fixed (Greptile P1: working remote agents were blocked):
Skipped: I did not change the signature of Tests: All 22 tests in Phase 3 — Verdict✅ Approve. Every Phase 1 row passes and the one blocking finding is resolved. |
|
Merge gate scan — eligible for assessment. Claude merge gate will assess and may auto-merge on an APPROVE verdict. |
|
MERGE_GATE_VERDICT: BLOCK
Checks that passed: the author is an allowlisted bot. The PR touches 4 files with +230/−8 lines, all in the |
|
MERGE_GATE_VERDICT: APPROVE
|
|
Merged by Claude PR merge gate ( |
Fixes #6228
Summary
All changes are in
src/praisonai-code/praisonai_code/llm/. No new public API, params or dependencies.ollama/(orollama_chat/) model no longer needs a key.is_configured()now checks that Ollama answers/api/tags(viaOLLAMA_API_BASE, thenOLLAMA_HOST, thenhttp://127.0.0.1:11434) instead of treatingOLLAMA_HOSTas a required credential.Error: Ollama isn't reachable at http://127.0.0.1:11434 — start it with `ollama serve`instead of the API-key message._PROBE_TIMEOUT_Sgoes from 0.15 s to 1.0 s. A first/api/tagscall was measured at ~0.35 s. A closed port still refuses at once, so runs with nothing listening stay fast. This probe only runs on the keyless path.No API key configured for model gpt-4o-mini.Tests
tests/unit/test_ollama_explicit_model.py: 8 tests, no network,urlopenmocked. They cover a reachable and an unreachable endpoint,OLLAMA_API_BASE, a slow first response (0.4 s), and the error text for explicit and auto-detect cases.tests/unit, the failing tests are the same before and after this change. They are pre-existing failures from thepraisonai/praisonai_botpackages not being installed in the runner.Not in scope
The issue's lower-priority items are left for separate issues: raw tool output shown as the answer, the DuckDuckGo error used as the reply, and docs that describe
OLLAMA_HOST.🤖 Generated with Claude Code