Repository navigation
Conversation
daily ledger 文件名与 flush 时间戳用 LocalDate.now()(JVM 默认时区): 宿主时区与用户思考时区不一致时(如 UTC 容器服务中国用户),记忆被 归档到错误的日期。 - MemoryFlushManager 新增 ledgerZone 字段与 4 参构造器,默认 systemDefault 保持既有行为;flushMemories 与 writeMemoryFiles 的 账本日期改用 LocalDate.now(ledgerZone) - flush 时间戳从 Instant.toString()(恒 UTC,无时区上下文)改为 atZone(ledgerZone) 呈现,与账本日期一致
This branch has not been deployed
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.
Fixes #3433
Problem
The daily memory ledger filename and flush timestamps use
LocalDate.now()(JVM default zone). When the host zone differs from the zone users think in — e.g. an agent deployed in a UTC container serving users in UTC+8 — memories are filed under the wrong day, and the flush timestamp renders in a zone-less UTC string that doesn't match the ledger date.Fix
MemoryFlushManagergains aledgerZonefield and a 4-arg constructor; default remainsZoneId.systemDefault()(no behavior change for existing callers).flushMemoriesandwriteMemoryFilesderive the ledger date viaLocalDate.now(ledgerZone).Instant.now().atZone(ledgerZone)so it carries the same zone context as the ledger date it sits under.Note: this intentionally does NOT switch the default to UTC — the ledger date is user-facing, so the right default is the deployment's chosen zone, made explicit and configurable rather than ambient. An end-to-end zone test requires a clock seam in
MemoryFlushManager; that seam is small and can land as a follow-up if maintainers want deterministic date-boundary coverage.