Skip to content

[Bug]: 短期记忆Memory Flush 时间格式如何修改默认不是utc时间 — 2026-10-07T08:15:40.992228Z #3433

Open

Description

@501956430

短期记忆.md 时间格式

Memory Flush — 2026-10-07T08:15:40.992228Z

Image

Activity

  1. added
    bug
    on Oct 7, 2026
  2. pony-huang commented on Oct 7, 2026

    @pony-huang
    Contributor
        private void writeMemoryFiles(RuntimeContext rc, String content) {
            String today = LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE);
    
            String dailyEntry =
                    String.format(
                            "\n## Memory Flush — %s\n%s\n",
                            java.time.Instant.now().toString(), content);
    
            String dailyRelPath = WorkspaceConstants.MEMORY_DIR + "/" + today + ".md";
            workspaceManager.appendUtf8WorkspaceRelative(rc, dailyRelPath, dailyEntry);
        }

    java.time.Instant.now().toString() 这逻辑应该写死的,不支持自定义格式。
    @501956430

  3. 501956430 commented on Oct 8, 2026

    @501956430
    Author

    private void writeMemoryFiles(RuntimeContext rc, String content) {
    String today = LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE);

        String dailyEntry =
                String.format(
                        "\n## Memory Flush — %s\n%s\n",
                        java.time.Instant.now().toString(), content);
    
        String dailyRelPath = WorkspaceConstants.MEMORY_DIR + "/" + today + ".md";
        workspaceManager.appendUtf8WorkspaceRelative(rc, dailyRelPath, dailyEntry);
    }
    

    java.time.Instant.now().toString() 这逻辑应该写死的,不支持自定义格式。 @501956430

    由于时间默认间隔了8小时 ,是否会对于记忆检索有干扰?例:第二天凌晨时间:10月8日2:00 的会话,是否会被记录在10月7日的短期记忆内? @pony-huang

  4. aiyili commented on Oct 22, 2026

    @aiyili
    Contributor

    Hi, I'd like to work on this. The daily-ledger filename and timestamp currently use LocalDate.now()/system-default zone, so entries land on the wrong day for non-UTC deployments. Plan: make the clock/zone injectable (defaulting to system default to preserve behavior, configurable via MemoryConfig or a builder hook), plus tests pinning the ledger date under a non-UTC zone. PR coming shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions