fix!: use millisecond-precision timestamps for output filenames#16
fix!: use millisecond-precision timestamps for output filenames#16RachelXiaolan wants to merge 1 commit into
Conversation
nanobanana-cli and chatgpt-image-cli use time.Now().Format("20060102-150405")
(second precision) for output filenames. Two rapid invocations within the
same second (e.g. from a script) silently overwrite the first file.
Changed to "20060102-150405-000" (millisecond precision) to reduce
collision risk. Uses hyphen separator to avoid confusion with file
extensions.
⚠️ BREAKING CHANGE: output filenames change from e.g.
20260519-143022-full.png → 20260519-143022-123-full.png
Any scripts parsing these filenames will need updating.
PR Review — 🔴 实现 bug:
|
Recognizing @RachelXiaolan for code contributions (PR #17 — Status() health check + SilenceUsage for baidu-cli/google-cli) and pull-request reviews (detailed technical review on PR #9, plus follow-up PR #16). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Both CLIs use
time.Now().Format("20060102-150405")(second precision) for output filenames. Two rapid invocations within the same second (e.g. from a script loop) silently overwrite the first file.Before:
After:
The
-000suffix adds millisecond precision (3 digits, zero-padded), reducing collision risk by ~1000x. A hyphen separator is used instead of a dot to avoid confusion with file extensions.Split out from #10 per maintainer request — see comment.
Testing