Repository navigation
[PR] fix: read logger attribution tags in cache usage - #6742
Merged
ranxianglei merged 1 commit intoNov 14, 2026
Merged
ranxianglei merged 1 commit into
ranxianglei merged 1 commit into
Conversation
This was referenced Nov 14, 2026
Merged
Merged
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.
Closes #6740
Problem
Current
logger.log()writes[v=<version>], preceded by[sess=<request-scope>]when the request has a bound context.parseUsageLog()still expects the explicit usage session immediately after the log level. As a result, current loop, relay and plugin usage lines contribute no samples tobili acp-cache diff.This is observable through the real writer, without a fabricated logger format:
The parser returns an empty map. A real dump pair plus real scoped log output consequently loses its usage and calls a stable-prefix cache miss
pure-append.Change
Parse the bracketed prefix, remove the known current logger attribution prefix, then require the explicit usage session and optional plugin producer tag. Parsing these separately prevents an optional-prefix regex from backtracking and treating the version tag as a session when the actual session is absent.
The usage record's explicit session remains authoritative even when its request scope differs. Legacy untagged lines, local/UTC/offset timestamps, sanitized session IDs, sample ordering and numeric fields retain their behavior. A session literally named
pluginremains valid. No logger output, wire behavior, cache policy, configuration or dependency changes.Verification
configureLogger→log→ awaitedcloseLogger→parseUsageLog, covering scoped/unscoped and loop/plugin variants.runDiff, both default log discovery and explicit--log, and assert the correct session, usage values andprefix-stable-missclassification.pluginsession and malformed/noise lines are covered.npm run typecheck,npm run buildandgit diff --checkpass. An initial typecheck attempt stopped while writing generated kernel declarations because the shared workspace ran out of disk space; after space was restored, both complete commands passed.Validation used Node 24.22.1, TZ=UTC and isolated temporary files. Full-suite results are left to hosted CI on the pushed head.
History check
Reviewed the complete indexed Afloat16 issue history and relevant actual PR patches. #6496 changes UTF-8 offset attribution; #6722 changes ordered sample-to-request alignment. Neither handles log prefixes. The actual #5487 patch streams retained logs while preserving this old regex; #4535 and its implementation only expand timestamp syntax. Focused all-state searches found no existing equivalent attribution-prefix correction.
Base: master
a8bbb8d23108ba9148d09512927041364625d910(0.1.214).