fix(daemon): restore claim slow-log payload observability without gzip#4322
Open
Hzzzzzx wants to merge 1 commit into
Open
fix(daemon): restore claim slow-log payload observability without gzip#4322Hzzzzzx wants to merge 1 commit into
Hzzzzzx wants to merge 1 commit into
Conversation
multica-ai#4307 reverted "gzip daemon claim responses" (multica-ai#4259) and, as collateral, removed the claim slow-log observability fields, leaving the claim response-size signal blind. Restore only the observability half: - re-add writeMeasuredJSON (measures uncompressed JSON length; unrelated to transport compression) - re-add payload_bytes / agent_skill_count / builtin_skill_count / skill_payload_bytes to logClaimEndpointSlow and capture them in ClaimTaskByRuntime The gzip middleware (daemonJSONCompressor in router.go) — the part the revert actually targeted — is intentionally NOT restored. No router, middleware, or wire-behavior change. Tests: - new table-driven TestWriteMeasuredJSONByteIdenticalToWriteJSON asserts writeMeasuredJSON and writeJSON emit byte-identical responses across many inputs (HTML-escapable, unicode, nested, large claim+skills), locking the "no wire-behavior change" invariant - restore TestLogClaimEndpointSlowIncludesPayloadFields Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
|
@HzZzZzZzZz is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
#4307reverted "gzip daemon claim responses" (#4259). That revert was the right call for the gzip middleware, but it also removed — as collateral — the claim slow-log observability fields, leaving the/api/daemon/tasks/claimresponse-size signal blind in prod.This PR restores only the observability half, with the gzip middleware deliberately left out.
Changes
handler.go— re-addwriteMeasuredJSON: same output aswriteJSONbut returns the encoded body size. It measures the uncompressed JSON length and is unrelated to transport compression.daemon.go(ClaimTaskByRuntime/logClaimEndpointSlow) — restorepayload_bytes,agent_skill_count,builtin_skill_count,skill_payload_byteson the slow-claim log, captured at the response-build sites.Explicitly NOT included
daemonJSONCompressor/chimw.Compressgzip middleware — the part#4307actually targeted.router.go, no middleware, no route wiring.So this is a pure logging/diagnostics restore with no wire-behavior change.
Tests
TestWriteMeasuredJSONByteIdenticalToWriteJSON— table-driven, assertswriteMeasuredJSONandwriteJSONemit byte-identical response bodies (and matching length / status / Content-Type) across many inputs: HTML-escapable chars, unicode, nested structures, and a large claim payload with skills. This locks the "no wire change" invariant so it is provable and regression-guarded.TestLogClaimEndpointSlowIncludesPayloadFields— asserts the four fields reach the log line.Verification
gofmt -l— cleango vet ./internal/handler/— cleango test ./internal/handler/— ok (full package, ~7s)go build ./...— ok🤖 Generated with Claude Code