Repository navigation
server: a GLM value that runs into the next pair keeps the call as text (#2801) - #2831
Conversation
|
Thanks @devopsfortunato, this is a clean fix. A value that runs into the next pair, or never closes before the envelope ends, now leaves no call in the whole reply ( One small thing: the skip you added to the property test ("GLM pairs from the cached key and value ends…") passes over every body where the reference makes a call and the new parser doesn't. Could it skip only when the body really has an unclosed value or an
|
…xt (ashhart#2801) An `<arg_value>` that leaves out its `</arg_value>`, or that runs into the next pair's `<arg_key>`, was read to the next pair's closer, so the next pair's markup landed inside the value: valid JSON with corrupt arguments. Such a call is malformed now, so its envelope stays in `content`, in whole replies and in streams; a stream that hits the slip ends with `stop` and the same text.
0fc747c to
0d80c66
Compare
|
Thank you @devopsfortunato. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
Scope and figures corrected to the PRs (#2700, #2670, #2338, #2491, #2680, #2557, #2597, #2760's load time, #2753's verify-row wait, #2681's ledger row), #2831's and #2682's lines rewritten to what the code does, #2709 given its own line above #2609's, the duplicate #2404, #2576, #2597 and #2699 entries and the copy of #2609's line under 1.2.6 removed, entries spaced one blank line apart, and the released sections restored to the v1.2.6 tag's text (#1651's 1.2.2 line and six blank lines in 1.2.5 and older).
|
Thanks @devopsfortunato! This is in TensorFold 1.2.7, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.7
|
What this changes
Before: a GLM call whose
<arg_value>leaves out its</arg_value>made the whole-reply parser read that valueall the way to the next pair's closer, so the next pair's
<arg_key>/<arg_value>markup landed inside theargumentsstring — valid JSON, corrupt call. Streams had the same slip and could end underfinish_reason: "tool_calls"with arguments that never close.After: a GLM value that runs into the next pair, or never closes before its envelope ends, is malformed, so the
envelope stays in
contentas text — the keep-as-text ruledocs/api.mdalready states. Well-formed GLM callsparse exactly as before. A stream that hits the slip ends with
finish_reason: "stop"and the same text incontent; its first pieces may already have gone out, which the issue names as the stream's one limit.atc overlap --json: reportedcomplete: false(limitationsotherPullRequestsLimit,pullFilesUnavailable,timeLimit); its only named entry was PR server: say how many tool-call envelopes a reply kept as text #2814 with no file list, so I also rangit merge-tree --write-tree HEAD <#2814's head df841f248>: merges clean (exit 0, no conflicts). This branchleaves
docs/api.mduntouched on purpose — server: say how many tool-call envelopes a reply kept as text #2814 rewrites the paragraph my first draft edited, and the wordingalready covers a malformed block.
Checks on this head
0fc747c4a245f3322ece7d6ef33f466410a9f2c6python3 tools/zig/lean_check.py, on the base and on this head: basef6d311cfc6178 files, 386 problems; this head6178 files, 386 problems— 0 new findings.zig build test-tool-parse-host --summary all→52 tests, 0 fail(both on this head and its pre-rebase base).zig build test-server-cpu --summary all→ this head:1278 pass, 5 skip, 0 fail (1283 total). The same sources passed1278 pass, 5 skip, 0 fail (1283 total)before the rebase ontof6d311cfc; that step holds the whole andstreamed chat/SSE cases, the new ones included.
zig build test: CI'szigjob runs this suite on the project's runner and passes on this head (below). Running it locally here as well takes ~50+ minutes on 4 shared cores, and this 8 GiB box already fails two steps on unmodifiedmainfb8fdf3d8:test-cuda-host(its GLM snapshot sizing asks for a ~7 GB arena) andtest-env-defaults-host(fails under load, passes alone: 6/6 steps). Both are host-capacity failures, not this change's.zig fmt --check build.zig zigprints nothing;git diff --checkprints nothing.zig,fmt,pytest,zig-windowsandzig-macos-dev-toolspass on this head0fc747c4a(release-pathsandbenchmark-clientswere still queued when this line was written; neither reaches this change).Metal/CUDA device checks and no macOS run. The issue's capture is pinned as a host test instead.
Receipt
n/a and why: the change decides how a malformed GLM envelope is reported, not how tokens are produced or summed,
and this host cannot run a GLM checkpoint at all. Its host checks are in "Checks on this head": the issue's
capture and an unclosed last value stay text in whole and streamed replies, a well-formed call and a value holding
a literal
<still parse, and the existing whole-versus-streamed agreement test still passes. On a host with aGLM checkpoint, the check to run is the issue's request shape:
tool_callsabsent, the markup incontent,finish_reason: "stop".Checklist
Note for the maintainer: your comment on #2801 said a fix was ready. ATC reported the issue free and no pull
request linked it (
atc check 2801 --json, then claimed), so this is that behaviour implemented and tested.Close it if yours lands first.
Test detail for the reviewer, since these are the cases that failed before the change:
tool_parse_test: the issue's exact capture —<arg_value>decided<arg_key>arguments</arg_key>...with themissing
</arg_value>— now parses to no call and keeps its text, as does a last value the envelope closesbefore its closer; a well-formed call to the same tool and a value holding
2 < 3still parse.tool_glm_stream_test: the same two replies through the server's chat route, whole and streamed, in bothparallel_tool_callsmodes: no calls,finish_reason: "stop", and the streamed content equals the wholereply's. The stream's already-sent first pieces are not asserted away, deliberately.