Skip to content

fix: use unique env-file path in DaytonaPtyProcess to avoid race conditions#200

Merged
xdotli merged 1 commit intomainfrom
devin/1777113660-fix-pty-env-path
Apr 25, 2026
Merged

fix: use unique env-file path in DaytonaPtyProcess to avoid race conditions#200
xdotli merged 1 commit intomainfrom
devin/1777113660-fix-pty-env-path

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 25, 2026

Summary

DaytonaPtyProcess.start() used a hardcoded /tmp/.benchflow_env path for writing env vars into the container. Concurrent DaytonaPtyProcess instances on the same host would overwrite each other's env file, silently corrupting environment variables.

This applies the same uuid.uuid4().hex[:16] suffix pattern already used in DaytonaProcess.start() (fixed in PR #198) to the PTY code path.

Also removes a redundant local import uuid since it's already imported at module level.

Flagged by Devin Review on PR #198 (flag: "DaytonaPtyProcess uses hardcoded env path").

Review & Testing Checklist for Human

  • Verify the env-file path in DaytonaPtyProcess.start() now uses a unique suffix (process.py:471-476)
  • Confirm no other hardcoded /tmp/.benchflow_env paths remain in the codebase

Notes

  • All 693 tests pass, ruff check . clean
  • The other Devin Review flag ("DinD branch env values are unquoted") was confirmed as intentional/correct for docker compose --env-file format — no change needed

Link to Devin session: https://app.devin.ai/sessions/9709f34c9a064c67a40a8dfad5640c0b
Requested by: @xdotli


Open in Devin Review

…itions

DaytonaPtyProcess.start() used a hardcoded /tmp/.benchflow_env path,
meaning concurrent instances on the same host would overwrite each
other's env file. Use uuid.uuid4().hex[:16] suffix to match the
pattern already used in DaytonaProcess.start().

Also removes redundant local 'import uuid' since it's already
imported at module level.

Flagged by Devin Review on PR #198.

Co-Authored-By: Xiangyi Li <venusli370306@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@xdotli xdotli changed the base branch from dev-0.3 to main April 25, 2026 10:58
@xdotli xdotli merged commit b7bcbe5 into main Apr 25, 2026
2 checks passed
@xdotli xdotli deleted the devin/1777113660-fix-pty-env-path branch April 25, 2026 11:05
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