fix: use timestamped default filename for session debug exports - #1788
Conversation
Both engine implementations defaulted the export ZIP path to <sessionId>.zip, so running /export-debug-zip or kimi export twice for the same session silently overwrote the first archive. The default filename is now kimi-debug-<shortId>-<timestamp>.zip (UTC, second precision), matching the /export-md naming convention. Explicit -o/outputPath behavior is unchanged.
🦋 Changeset detectedLatest commit: a26d5b8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a26d5b8e2e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const timestamp = now.toISOString().replaceAll(/[-:]/g, '').replace(/T/, '-').slice(0, 15); | ||
| return `kimi-debug-${shortId}-${timestamp}.zip`; |
There was a problem hiding this comment.
Make default debug-zip names unique within one second
When two default exports for the same session start within the same UTC second, this timestamp string is identical, so both engines still resolve to the same kimi-debug-<shortId>-<timestamp>.zip; the v2 writer later renames over an existing destination and the legacy writer opens with the default truncating flags, so the second export can still replace the first. This is easy to hit with kimi export <session> twice on a small session, and the new regression test avoids the case by sleeping past the second boundary instead of proving same-second safety.
Useful? React with 👍 / 👎.
commit: |
…shotAI#1788) Both engine implementations defaulted the export ZIP path to <sessionId>.zip, so running /export-debug-zip or kimi export twice for the same session silently overwrote the first archive. The default filename is now kimi-debug-<shortId>-<timestamp>.zip (UTC, second precision), matching the /export-md naming convention. Explicit -o/outputPath behavior is unchanged.
…shotAI#1788) Both engine implementations defaulted the export ZIP path to <sessionId>.zip, so running /export-debug-zip or kimi export twice for the same session silently overwrote the first archive. The default filename is now kimi-debug-<shortId>-<timestamp>.zip (UTC, second precision), matching the /export-md naming convention. Explicit -o/outputPath behavior is unchanged.
Related Issue
N/A — the problem is explained in the next section.
Problem
Running
/export-debug-zip(orkimi exportwithout-o) twice for the same session silently overwrote the first ZIP archive. Both engine implementations defaulted the output path to<sessionId>.zip, which never changes within a session, so the second export replaced the first — users collecting multiple debug archives (e.g. before/after a repro) lost the earlier one.What changed
kimi-debug-<shortId>-<timestamp>.zip(UTC, second precision), mirroring the existing/export-mdnaming convention. Applied symmetrically in both engine implementations (v1 and v2) so the TUI slash command and thekimi exportCLI behave identically.-o/outputPathbehavior is unchanged.exportedAtshare a single clock reading, so they never straddle a second boundary.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.