From 485be236cedac782d6dc79c9a054c5b8593688e8 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Fri, 3 Jul 2026 11:12:02 +0800 Subject: [PATCH] log stamps in local time so tool and agent-written lines agree (dogfood finding) Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 5922a5c..89b6fb2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -240,8 +240,12 @@ function result(text: string, isError = false) { return { content: [{ type: "text" as const, text }], details: {}, isError }; } +/** Local time, not UTC: agents freehand-stamp their manual ## Log lines from the local clock they + * see, so a UTC tool stamp made the trail read as two different afternoons (dogfood finding). */ function stamp(): string { - return new Date().toISOString().slice(0, 16).replace("T", " "); + const d = new Date(); + const p = (n: number) => String(n).padStart(2, "0"); + return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`; } function oneLine(s: string): string {