fast-completions 0.4.0 → 0.4.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/lib/fast/completions/protocol.rb +12 -2
- data/lib/fast/completions/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 826572d669198677861fb62faea347d0e74bf99ca3ba39d2e899a159161e762b
|
|
4
|
+
data.tar.gz: 4e5d12637cc2b273596a38d7cdd39b50ee5f2018a3ba0c18e2c4001a88c32e22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7dde6dc44db9e1993071f6f494a743dad1e89990c67c6b2beeef61638e28cc57aff5af2026b66a42209d4eb27ee8c4848eec559593fbcdcbab1938bf5251d8fc
|
|
7
|
+
data.tar.gz: '09c28b1d9d980d29abd13a670feba40ec60fb79f3c65246251bc3b1ac042e3ae093728cf3fd2affbadfc09799c97f1f9f4fe59657c535b2376c2eeb0523a024a'
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
Notable changes to the fast-completions gem. The format is prose-first,
|
|
4
4
|
one section per released version, newest first.
|
|
5
5
|
|
|
6
|
+
## 0.4.1 (2026-10-16)
|
|
7
|
+
|
|
8
|
+
- Fix a mid-stream crash in the tool-call live-parse (regression against
|
|
9
|
+
pi, found live on zai/glm-5.3): when a delta boundary split an escape
|
|
10
|
+
sequence, the arguments scratch buffer ended mid-string with a lone
|
|
11
|
+
trailing backslash; `repair_json` doubled it (repaired != partial) and
|
|
12
|
+
the re-parse of the still-unterminated string raised `JSON::ParserError`
|
|
13
|
+
— uncaught, because Ruby rescue clauses do not cascade (an exception
|
|
14
|
+
raised in one rescue body is not handled by the next rescue clause of
|
|
15
|
+
the same method). The repaired re-parse now gets its own rescue (the
|
|
16
|
+
same lesson `Client#parse_repaired` already had), returning `{}` as the
|
|
17
|
+
last resort — pi's `parseStreamingJson` wraps the repair path in a
|
|
18
|
+
try/catch and always returns a valid object; the port dropped that
|
|
19
|
+
outer catch.
|
|
20
|
+
- Bench harness (perf-baseline): `gems/completions/bench/` ships four
|
|
21
|
+
deterministic, network-free, stdlib-only benchmark scripts over the hot
|
|
22
|
+
paths (text-heavy SSE+protocol stream; tool-args-heavy stream through the
|
|
23
|
+
O(n²) per-delta live re-parse; Codec normalize → to_wire round-trip;
|
|
24
|
+
strict-schema rewrite) and compare_refs.rb, which measures v0.2.0 →
|
|
25
|
+
v0.3.0 → v0.4.0 → 0.4.1 through temporary read-only worktrees and writes
|
|
26
|
+
bench/BASELINE.md — per-path × ref medians, consecutive-release deltas,
|
|
27
|
+
and per-pair verdicts against frozen per-op floors. No behavior changes;
|
|
28
|
+
the capture is single-machine, and future runs compare against the
|
|
29
|
+
floors, never the cells.
|
|
30
|
+
|
|
6
31
|
## 0.4.0 (2026-10-14)
|
|
7
32
|
|
|
8
33
|
- Strict-sampling tool schemas (pi constrained-sampling, JSON-schema half):
|
|
@@ -210,14 +210,24 @@ module Fast
|
|
|
210
210
|
end
|
|
211
211
|
|
|
212
212
|
# OQ-4: control-character repair (pi utils/json-parse.ts repairJson
|
|
213
|
-
# :20-77), {} as the last resort (pi's partial-json fallback).
|
|
213
|
+
# :20-77), {} as the last resort (pi's partial-json fallback). The
|
|
214
|
+
# repaired re-parse gets its OWN method — a rescue body's exception
|
|
215
|
+
# is not caught by a later rescue clause of the same method (the
|
|
216
|
+
# 0.4.0 leak: a delta boundary splitting an escape sequence left the
|
|
217
|
+
# scratch buffer mid-string with a trailing backslash; repair "fixed"
|
|
218
|
+
# it, the re-parse raised, and the step died). pi's outer try/catch
|
|
219
|
+
# absorbs this; so do we.
|
|
214
220
|
def parse_streaming_json(partial)
|
|
215
221
|
return {} if partial.nil? || partial.strip.empty?
|
|
216
222
|
|
|
217
223
|
JSON.parse(partial)
|
|
218
224
|
rescue JSON::ParserError
|
|
219
225
|
repaired = repair_json(partial)
|
|
220
|
-
repaired == partial ? {} :
|
|
226
|
+
repaired == partial ? {} : parse_repaired_json(repaired)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def parse_repaired_json(repaired)
|
|
230
|
+
JSON.parse(repaired)
|
|
221
231
|
rescue JSON::ParserError
|
|
222
232
|
{}
|
|
223
233
|
end
|