zames_pro 2.82.2 → 2.82.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.82.4] - 2026-10-22
11
+
12
+ ### Fixed
13
+
14
+ - **telemetry:** a non-finite blockMs does not poison the /limits average
15
+
16
+ ## [2.82.3] - 2026-10-22
17
+
18
+ ### Fixed
19
+
20
+ - **answer-parse:** a line-boundary cut never keeps a lone surrogate
21
+
10
22
  ## [2.82.2] - 2026-10-22
11
23
 
12
24
  ### Fixed
@@ -23,12 +23,23 @@ export function truncateToolResult(text, limit) {
23
23
  const nl = text.lastIndexOf(NL, limit);
24
24
  // Cut AFTER the newline (include it) so the kept part is a whole number of
25
25
  // lines — a cut that EXCLUDED the newline left a half line before the marker.
26
- if (nl >= searchFrom)
26
+ if (nl >= searchFrom) {
27
27
  cut = nl + 1;
28
- // Never split a surrogate PAIR (an emoji / astral CJK char): the high half
29
- // alone is a lone surrogate — a broken code point some channels replace with
30
- // '?' or truncate at. Step back one unit so the pair is dropped WHOLE.
28
+ // The char that would end the kept text is the one BEFORE the newline.
29
+ // Stepping back here drops only the dangling newline, so the high
30
+ // surrogate is never the last unit the model sees.
31
+ const beforeNl = text.charCodeAt(cut - 2);
32
+ if (beforeNl >= 0xd800 && beforeNl <= 0xdbff) {
33
+ cut--;
34
+ const hi = text.charCodeAt(cut - 1);
35
+ if (hi >= 0xd800 && hi <= 0xdbff)
36
+ cut--;
37
+ }
38
+ }
31
39
  else {
40
+ // Never split a surrogate PAIR (an emoji / astral CJK char): the high half
41
+ // alone is a lone surrogate — a broken code point some channels replace
42
+ // with '?' or truncate at. Step back one unit so the pair is dropped WHOLE.
32
43
  const c = text.charCodeAt(cut - 1);
33
44
  if (c >= 0xd800 && c <= 0xdbff)
34
45
  cut--;
@@ -46,7 +46,10 @@ export function summarizeSends(events, now = Date.now()) {
46
46
  return Number.isFinite(t) && now - t <= ms;
47
47
  }).length;
48
48
  const blocks = events
49
- .filter((e) => e.outcome === 'rate_limit' && typeof e.blockMs === 'number')
49
+ .filter((e) => e.outcome === 'rate_limit' &&
50
+ typeof e.blockMs === 'number' &&
51
+ Number.isFinite(e.blockMs) &&
52
+ e.blockMs >= 0)
50
53
  .map((e) => e.blockMs);
51
54
  const avgBlockMs = blocks.length
52
55
  ? Math.round(blocks.reduce((a, b) => a + b, 0) / blocks.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.2",
3
+ "version": "2.82.4",
4
4
  "description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen and other web LLMs — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
5
5
  "type": "module",
6
6
  "bin": {