Commit Graph

38 Commits

Author SHA1 Message Date
huangjianxiong
29d2a1ed42 fix(ollama): use truncateUtf16Safe for malformed NDJSON log truncation (#102593)
* fix(ollama): use truncateUtf16Safe for malformed NDJSON log warning

The parseNdjsonStream function uses naive .slice(0, 120) on malformed
NDJSON data in log warnings which can split surrogate pairs. Replace
with truncateUtf16Safe().

* test(ollama): cover UTF-16-safe NDJSON warnings

* test(ollama): satisfy lint in NDJSON coverage

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-09 11:38:54 +01:00
Andy Ye
9d9661e473 fix(ollama): fall back when native streams end early (#100482)
* Classify Ollama incomplete stream errors for fallback

* fix(ollama): own incomplete-stream failover classification

* test(ollama): pin incomplete-stream error contract

* docs(changelog): note Ollama fallback routing

Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-06 03:12:49 +01:00
Yzx
3047e6c43d fix: Ollama Cloud tool calls fail on second turn (#96474)
Tested and it works.
2026-06-29 16:48:46 -06:00
Vincent Koc
6037d1a85c fix(ollama): bound stream error bodies 2026-06-19 19:18:38 +02:00
Vincent Koc
6fcc945702 fix(agents): trim dense text delta snapshots
Trim dense plain text-delta stream snapshots for OpenAI-compatible, Responses, and Ollama providers while preserving full snapshots on stream checkpoints and terminal events.

Reconstruct partial-less text deltas in the agent loop so live message updates continue to advance for immutable snapshot providers, and document the optional text_delta.partial contract.

Fixes #86599.
2026-06-09 13:21:23 +09:00
Peter Steinberger
96e5812426 docs: document medium extension sources 2026-06-04 21:33:54 -04:00
Peter Steinberger
7562afdca3 fix(ollama): suppress disabled reasoning output 2026-06-01 01:16:47 +01:00
Peter Steinberger
22cb7fb6b7 chore(lint): enable no-promise-executor-return 2026-05-31 23:06:13 +01:00
Vincent Koc
dfadc7b704 fix(ollama): normalize greedy top_p (#87049) 2026-05-27 02:41:30 +01:00
clawsweeper[bot]
c4bce00727 fix(ollama): strip inline kimi cloud reasoning leak (#86515)
Summary:
- This PR adds an Ollama Kimi-cloud visible-content sanitizer for streamed and final assistant replies, updates stream handling and regression tests, and adds a changelog entry.
- PR surface: Source +183, Tests +473, Docs +1. Total +657 across 7 files.
- Reproducibility: yes. from source and the linked report: current main appends Ollama `message.content` direc ...  payload described in the issue would be shown. I did not run a live vendor repro in this read-only review.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(ollama): sanitize kimi inline reasoning in stream events
- PR branch already contained follow-up commit before automerge: fix(ollama): buffer kimi cloud stream reasoning
- PR branch already contained follow-up commit before automerge: fix(ollama): cover kimi inline boundary variants
- PR branch already contained follow-up commit before automerge: fix(ollama): preserve text start partial state
- PR branch already contained follow-up commit before automerge: fix(ollama): bound kimi stream sanitizer hold
- PR branch already contained follow-up commit before automerge: fix(ollama): keep kimi sanitizer deltas append-only

Validation:
- ClawSweeper review passed for head b709229157.
- Required merge gates passed before the squash merge.

Prepared head SHA: b709229157
Review: https://github.com/openclaw/openclaw/pull/86515#issuecomment-4534945393

Co-authored-by: Jason O'Neal <jason.allen.oneal@gmail.com>
Co-authored-by: Onur Solmaz <2453968+osolmaz@users.noreply.github.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: osolmaz
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
2026-05-25 15:16:42 +00:00
WhatsSkiLL
2000227e9e fix(ollama): preserve tool call ids [AI-assisted] (#84855)
Summary:
- The PR preserves native Ollama tool-call IDs through ingest and replay, opts native Ollama out of strict replay ID sanitization, and adds focused regression tests plus a changelog entry.
- Reproducibility: yes. Current main drops native Ollama tool-call IDs on ingest and replay and applies strict ...  PR discussion includes a maintainer-side before/after probe that reproduced the source-level failure path.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(ollama): keep native tool ids through replay

Validation:
- ClawSweeper review passed for head bb9fef7d4c.
- Required merge gates passed before the squash merge.

Prepared head SHA: bb9fef7d4c
Review: https://github.com/openclaw/openclaw/pull/84855#issuecomment-4505423891

Co-authored-by: IWhatsskill <whatsskilll@gmail.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: osolmaz
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
2026-05-21 09:51:00 +00:00
吴杨帆
eebdbabae9 fix: omit Ollama think for non-reasoning models
Preserve native Ollama thinking controls for supported models and explicit think=false, but avoid sending truthy think payloads for models marked reasoning=false.\n\nCo-authored-by: 吴杨帆 <85487201+leno23@users.noreply.github.com>
2026-05-16 15:10:12 +01:00
Peter Steinberger
cce9a9ef2a test: guard mixed extension mock calls 2026-05-12 10:10:52 +01:00
Peter Steinberger
2d0c3750d8 test: guard extension provider helpers 2026-05-11 21:01:56 +01:00
Peter Steinberger
a7ae7bc6c8 test: clear ollama stream runtime broad matchers 2026-05-10 09:40:40 +01:00
Peter Steinberger
a8c745a623 fix: stop forcing native ollama num_ctx 2026-05-10 09:34:36 +01:00
Shakker
84c4a4fc5b test: tighten provider empty array assertions 2026-05-09 04:55:18 +01:00
Shakker
c9e85fdbd6 test: clear ollama stream timeout guard 2026-05-09 01:01:04 +01:00
Peter Steinberger
9ef37d1907 test: tighten assertions and harness coverage 2026-05-08 05:28:12 +01:00
Chunyue Wang
c1b9af2770 fix(ollama): restore catalog-driven num_ctx for native /api/chat (#76181)
Merged via squash.

Prepared head SHA: d3142252d5
Co-authored-by: openperf <80630709+openperf@users.noreply.github.com>
Co-authored-by: openperf <80630709+openperf@users.noreply.github.com>
Reviewed-by: @openperf
2026-05-03 19:47:36 +08:00
clawsweeper[bot]
7b97af4899 fix: Found one narrow regression risk in the new Ollama tool-call name (#74563)
Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
2026-04-29 14:08:33 -07:00
Peter Steinberger
89f871679e fix(ollama): normalize prefixed tool calls 2026-04-29 19:28:53 +01:00
Peter Steinberger
a31342ab6b fix(ollama): preserve aborts with stream timeouts 2026-04-29 08:33:23 +01:00
Peter Steinberger
1b13f53047 fix(ollama): reject garbled Kimi symbol output 2026-04-28 11:20:15 +01:00
Peter Steinberger
732e5805e3 fix(ollama): preserve configured native thinking 2026-04-28 09:20:44 +01:00
Peter Steinberger
7559845597 fix(ollama): avoid implicit native num_ctx override 2026-04-27 07:42:14 +01:00
Peter Steinberger
5d5c37775e fix(ollama): estimate usage when counters are omitted 2026-04-27 05:54:03 +01:00
Peter Steinberger
18b76e3995 fix(ollama): scope request timeouts to providers 2026-04-27 04:55:11 +01:00
Peter Steinberger
0b46227d6c fix(ollama): keep configured max thinking compatible 2026-04-27 03:13:15 +01:00
Peter Steinberger
aa071e0b60 fix(ollama): forward native model params 2026-04-27 03:08:11 +01:00
Peter Steinberger
2dba9e6a76 fix(ollama): honor configured num_ctx params 2026-04-27 03:02:24 +01:00
Peter Steinberger
acfa9877b3 fix: parse Ollama tool call arguments 2026-04-27 02:07:59 +01:00
Peter Steinberger
a3e0674261 fix(ollama): harden native provider routing 2026-04-27 01:02:13 +01:00
Peter Steinberger
ff570f3a61 fix(ollama): expose native thinking efforts 2026-04-26 22:49:13 +01:00
Zihao WAN
d4f91a354e fix(ollama): forward think:false for qwen3 chat requests (#69967)
Forward top-level Ollama think flags on native /api/chat requests so --thinking off sends think:false.\n\nThanks @WZH8898.
2026-04-22 05:49:16 +01:00
Peter Steinberger
5dbfaa15fa refactor: keep ollama compat in extension 2026-04-18 19:42:10 +01:00
Subash Natarajan
6f5459364a fix: restore Ollama chat model IDs (#67457) (thanks @suboss87)
* fix(ollama): strip provider prefix from model ID in chat requests

buildOllamaChatRequest passed params.modelId directly to the Ollama API
without stripping the "ollama/" provider prefix. The embedding provider
already handles this (normalizeEmbeddingModel at line 100), but the chat
stream path did not. When setup writes the primary model as
"ollama/<model>" or the model ID flows through without normalization,
the Ollama API rejects it with a 404.

Closes #67435

* ollama: guard chat fetch and streamline tests

* fix: restore Ollama chat model IDs (#67457) (thanks @suboss87)

* fix: preserve Ollama default chat fallback (#67457) (thanks @suboss87)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-16 11:15:37 +05:30
Peter Steinberger
2ee39fab83 test: run Ollama stream coverage inside plugin 2026-04-09 06:13:39 +01:00