Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(memory): avoid Bun Windows EEXIST on startup memory dir mkdir#243

Draft
virattt wants to merge 1 commit intomainvirattt/dexter:mainfrom
cursor/fix-memory-mkdir-windows-e23cvirattt/dexter:cursor/fix-memory-mkdir-windows-e23cCopy head branch name to clipboard
Draft

fix(memory): avoid Bun Windows EEXIST on startup memory dir mkdir#243
virattt wants to merge 1 commit intomainvirattt/dexter:mainfrom
cursor/fix-memory-mkdir-windows-e23cvirattt/dexter:cursor/fix-memory-mkdir-windows-e23cCopy head branch name to clipboard

Conversation

@virattt
Copy link
Copy Markdown
Owner

@virattt virattt commented May 3, 2026

Summary

  • add a shared ensureDirectory() helper that safely handles Bun-on-Windows mkdir(..., { recursive: true }) throwing EEXIST for already-existing directories
  • use this helper in memory initialization/write paths:
    • MemoryStore.ensureDirectoryExists()
    • MemoryStore.writeMemoryFile() parent directory creation
    • MemoryDatabase.create() parent directory creation
  • add regression tests for ensureDirectory() behavior when target already exists, is missing, and is a file

Why

Issue #242 reports:

  • Error: EEXIST: file already exists, mkdir '.dexter\\memory'

Dexter currently calls recursive mkdir on startup for .dexter/memory. On affected Bun/Windows versions, this can throw EEXIST even when the directory already exists, causing memory initialization to fail before the existing fallback handling.

Validation

  • static review of affected call sites completed
  • unable to execute bun run typecheck / bun test in this cloud environment because bun is not installed (bun: command not found)

Risk

Low. Changes are limited to directory creation behavior and preserve existing failure semantics for non-directory collisions.

Open in Web Open in Cursor 

Co-authored-by: Virat Singh <virattt@users.noreply.github.com>
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.