Skip to content

Preserve Unicode session log names (#988)#998

Merged
binaricat merged 2 commits into
mainfrom
codex/fix-988-chinese-log-names
May 18, 2026
Merged

Preserve Unicode session log names (#988)#998
binaricat merged 2 commits into
mainfrom
codex/fix-988-chinese-log-names

Conversation

@binaricat
Copy link
Copy Markdown
Owner

Summary

  • Preserve valid Chinese and Unicode host labels in session log file and folder names.
  • Replace path-unsafe characters, invisible control characters, and protected names safely.
  • Use the same name handling across manual export, auto-save, and live log streams.

Fixes #988

Verification

  • npm test

Copy link
Copy Markdown

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

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: 1acc90635f

ℹ️ 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 thread electron/bridges/sessionLogsBridge.cjs Outdated
return fallback;
}

if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i.test(safe)) {
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 Reject COM¹/LPT¹-style reserved names on Windows

safePathSegment only guards com[1-9]/lpt[1-9], but Windows also reserves superscript variants (e.g. COM¹, LPT²). Because this change now preserves Unicode characters, those labels pass through unchanged and later mkdir/file writes in startStream/autoSaveSessionLog can fail on Windows, dropping session logs for affected hosts.

Useful? React with 👍 / 👎.

safe = `${safe}_`;
}

return safe;
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 Normalize trailing periods in sanitized path segments

The sanitizer now allows . within host directory names and does not strip trailing periods, so labels like prod. are returned as-is. Windows normalizes trailing periods on create/open, so prod and prod. can collapse to the same directory and mix logs, which is a regression from the previous ASCII-only replacement behavior.

Useful? React with 👍 / 👎.

@binaricat
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ 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".

@binaricat binaricat merged commit 5a94b4c into main May 18, 2026
9 checks passed
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.

Bug: 日志功能模块中如果导出的主机名称包含中文时名称会被替换为下划线

1 participant