Repository navigation
feat(server): optional JSON lines for request start and end - #3195
Conversation
|
Thanks @mvanhorn, Two fixes before it can land:
Optional: the
|
|
Thanks, both check out against the diff.
On the optional point, fine by me to drop the |
|
Thanks @mvanhorn for checking both points against the diff, and for settling on event names. I agree that The PR head is still
Optional, as you offered: drop the Main has moved since you opened this PR. The
|
|
Pushed 0ce512a with both fixes, on top of d7f8544, which merges main into the branch.
I also dropped the On 0ce512a with Zig 0.17.0, |
|
Thanks @mvanhorn, both fixes are in and they hold up. On
Moving the tests out keeps One small thing, no new push needed: the title and description still describe This PR is queued to land and lands after the 1.2.9 cut.
|
5f29883 to
fb75f7e
Compare
Rebased onto main af9777b. The original two commits from @mvanhorn are combined here: --log-json writes access, ended and refused lines as JSON with the reply id carried on the connection, long fields cut so each line parses. The README flag row is placed in docs/run-guide.md because main moved the serve flag table there; README.md itself is unchanged.
Answer the E120 source-length ask by removing one blank line between the backend values and native flag declarations. Parsing, capabilities, defaults and tests are unchanged.
fb75f7e to
12fa746
Compare
|
Thank you @mvanhorn. 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. |
feat(server): optional JSON lines for request start and end
What this changes
Default serve logging is unchanged:
ip "GET / HTTP/1.1" 200 -,ended <id> reason=... prompt=N tokens=N after=Xs, andrefused <id>: .... Withserve --log-json, each request start and each request end is one compact JSON object on the existing[tensorfold]line (eventstartorend, the request id when one is already assigned, HTTP status when known, andprompt/tokensonly whenlog.endedalready has them). A refused request logs without inventing token counts. API keys, Authorization headers, and request bodies stay out of the line.GET /healthis unchanged.atc overlap --json: ATC 0.9.6, runatc overlap --json --base origin/mainat 4:23 AM PT, Fri Nov 13, 2026 (America/Los_Angeles) on head2b88444. The snapshot was incomplete (complete: false; limitations:otherPullRequestsLimit,pullFilesUnavailable,pullRequestsLimit,timeLimit).changedFiles: 12.myPullRequests: none. Eighteen overlaps, allconflict: "unknown"(ATC could not run merge-tree). Most sharezig/build/cuda_server_host.zig(this change only adds atest-request-log-hoststep) orzig/src/server/http_conn.zig(this change only adds a requestidfield and clears it on reuse). Open #2885 (serve --config FILE.toml) was not in the truncated snapshot; manual review: it sharesREADME.md,zig/src/server/cli.zig,zig/src/server/main.zig, andzig/build/cuda_server_host.zig. The flag tables and README rows are in different regions and should merge cleanly. Theusage_lineinmain.zigis the same concatenated string (this change appends[--log-json]after[--dashboard]; server: serve --config FILE.toml reads flags from a file #2885 prepends[--config FILE.toml]), so a textual conflict there is possible and is resolved by keeping both flags. No overlap with #3189 (config validate).Checks on this head
2b88444ec2539a7483acf337893d4d068b7789c6python3 tools/zig/lean_check.py, on the base and on this head: 341 problems on origin/main (c34ff56), 341 on this head, 0 new. None of the new findings are in the 12 changed files (theTENSORFOLD_LOG_TIMEgetenv report onlog.zig:22is pre-existing).zig build test-request-log-host— 19 pass, 3 fail (nonzero). The three new JSON cases (start includes the id when known,end includes id and tokens; refused invents none,secrets stay out of the line) raisedSyntaxErrorparsing the still-text lines. The default-text pin passed.DEMO_OUT=/tmp/osc-bulk-1113-demos/tensorfold-health-endpoint zig build test-request-log-host— 23 pass, 0 fail, 0 skip. Re-run on this head after review: the same step succeeded (Build Summary: 3/3 steps succeeded).zig build test-server-cpu— 1354 passed, 0 failed, 6 skipped (1360 total). The demo-capture case is one of those skips whenDEMO_OUTis unset.test-cuda-host. This box has no GPU and the change only formats already-known log fields.Receipt
n/a — this change only formats already-known request start and end fields. It cannot reach inference and does not change token arithmetic.
--log-json(store_true, default off). Off keeps today's text lines. On writes one JSON object a line for request start and end. Flag-only; no new environment variable.2b88444ec2539a7483acf337893d4d068b7789c6, no GPU, no checkpointzig build test-request-log-hostandzig build test-server-cpu. Metaltensorfoldand the CUDA product binary were not built here.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: n/a (cannot reach inference)tools/bench_openai.py: n/a (cannot reach inference)Checklist
Demo
Animated replay of real captured command output, not a live UI recording.