Repository navigation
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
|
Keep --log-json next to the new --config usage entry, and keep the request id on the connection alongside the new skip_request_log field.
…ess, ended, refused A request line over 8 KiB, or a refusal of mostly control bytes, filled the log buffer before the closing quote and brace. Each JSON string now stops before an escape or character that would not fit, the request line at 4,096 bytes and the refusal message at the room left in its buffer. The events are named for what writes them: access when the response starts, ended only when the client left or the reply failed, refused for an error reply, logged before its access line. README and RUNBOOK say the same. The tests move to log_test.zig, with a request line over 8 KiB and a control-byte refusal that both parse, and the DEMO_OUT capture test is gone.
|
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, |
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.