Skip to content

fix: use timestamped default filename for session debug exports - #1788

Merged
RealKai42 merged 1 commit into
mainfrom
fix/export-debug-zip-unique-filename
Jul 16, 2026
Merged

fix: use timestamped default filename for session debug exports#1788
RealKai42 merged 1 commit into
mainfrom
fix/export-debug-zip-unique-filename

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

Related Issue

N/A — the problem is explained in the next section.

Problem

Running /export-debug-zip (or kimi export without -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

  • The default export filename is now kimi-debug-<shortId>-<timestamp>.zip (UTC, second precision), mirroring the existing /export-md naming convention. Applied symmetrically in both engine implementations (v1 and v2) so the TUI slash command and the kimi export CLI behave identically.
  • Explicit -o / outputPath behavior is unchanged.
  • The filename timestamp and the manifest's exportedAt share a single clock reading, so they never straddle a second boundary.
  • Added regression tests in both engines: default-name format, plus a repeated-export test proving the second run no longer overwrites the first.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

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-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a26d5b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +258 to +259
const timestamp = now.toISOString().replaceAll(/[-:]/g, '').replace(/T/, '-').slice(0, 15);
return `kimi-debug-${shortId}-${timestamp}.zip`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@a26d5b8
npx https://pkg.pr.new/@moonshot-ai/kimi-code@a26d5b8

commit: a26d5b8

@RealKai42
RealKai42 merged commit 365ba00 into main Jul 16, 2026
18 checks passed
@RealKai42
RealKai42 deleted the fix/export-debug-zip-unique-filename branch July 16, 2026 11:32
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Jul 17, 2026
…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.
ywh114 pushed a commit to ywh114/kimi-code that referenced this pull request Jul 19, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant