Skip to content

fix(chat): correct tempfile.mkstemp argument order (#1051) - #1065

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
fix/1051-chat-atomic-write-path
Feb 21, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
fix/1051-chat-atomic-write-path

Conversation

@mrveiss

@mrveiss mrveiss commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed tempfile.mkstemp positional argument order in _atomic_write() — dir_path was passed as suffix and ".json" as dir, producing invalid temp paths like .json/.tmp_chat_tz4734d9data/chats
  • Corrected to mkstemp(suffix=".json", prefix=".tmp_chat_", dir=dir_path)

Test Plan

  • Verified correct temp path generation with Python test
  • Linting passes (ruff check)
  • All pre-commit hooks pass

Closes #1051

🤖 Generated with Claude Code

…1051)

The positional args to mkstemp were (dir, prefix, suffix) but the
signature is (suffix, prefix, dir). This caused the target directory
path to be used as the suffix and ".json" as the directory, producing
invalid temp paths like `.json/.tmp_chat_tz4734d9data/chats`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mrveiss
mrveiss merged commit 1a186ab into Dev_new_gui Feb 21, 2026
0 of 2 checks passed
@mrveiss
mrveiss deleted the fix/1051-chat-atomic-write-path branch February 21, 2026 14:14
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