Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gpt_engineer/core/default/file_store.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import tempfile

from pathlib import Path
Expand All @@ -6,6 +7,8 @@
from gpt_engineer.core.files_dict import FilesDict
from gpt_engineer.core.linting import Linting

logger = logging.getLogger(__name__)


class FileStore:
"""
Expand Down Expand Up @@ -40,6 +43,12 @@ def push(self, files: FilesDict):
for name, content in files.items():
path = self.working_dir / name
path.parent.mkdir(parents=True, exist_ok=True)
if path.is_dir():
logger.warning(
f"Skipping '{name}': path exists as a directory. "
"This happens when the LLM generates a file with the same name as a directory."
)
continue
with open(path, "w") as f:
f.write(content)
return self
Expand Down
Loading