diff --git a/CHANGELOG.md b/CHANGELOG.md index 36971d72..7ada93d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.13] - 2026-07-23 + +### Fixed + +- 💬 **Local model chats stop repeating themselves.** When a llama.cpp or OpenAI-compatible connection finishes an answer, Computer now stops there instead of accepting extra repeated parts that could duplicate the final text or run the same tool again. + ## [0.9.12] - 2026-07-21 ### Added diff --git a/cptr/utils/ai.py b/cptr/utils/ai.py index e461f20b..60d80a75 100644 --- a/cptr/utils/ai.py +++ b/cptr/utils/ai.py @@ -554,9 +554,14 @@ def complete_reasoning_item() -> dict | None: return item async for line in resp.aiter_lines(): - if not line.startswith("data: ") or line == "data: [DONE]": + if not line.startswith("data:"): continue - chunk = json.loads(line[6:]) + raw = line.removeprefix("data:").strip() + if raw == "[DONE]": + break + if not raw: + continue + chunk = json.loads(raw) choices = chunk.get("choices", []) delta = choices[0].get("delta", {}) if choices else {} diff --git a/pyproject.toml b/pyproject.toml index 487e0747..50d103c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cptr" -version = "0.9.12" +version = "0.9.13" description = "Your computer, from anywhere. Code, manage, and control your machine from the web." license = {file = "LICENSE"} readme = "README.md" diff --git a/uv.lock b/uv.lock index 030bf8c9..6e9a9905 100644 --- a/uv.lock +++ b/uv.lock @@ -284,7 +284,7 @@ wheels = [ [[package]] name = "cptr" -version = "0.9.12" +version = "0.9.13" source = { editable = "." } dependencies = [ { name = "aiosqlite" },