Skip to content

Use unique temporary files for code runs#24

Closed
flaviens wants to merge 1 commit into
formulahendry:mainfrom
flaviens:codex/use-unique-temp-files
Closed

Use unique temporary files for code runs#24
flaviens wants to merge 1 commit into
formulahendry:mainfrom
flaviens:codex/use-unique-temp-files

Conversation

@flaviens

Copy link
Copy Markdown

Summary

  • Create a per-run temporary directory and source file instead of reusing one filename per language.
  • Execute the configured interpreter with execFile and an argument array.
  • Remove the temporary directory after each tool invocation completes.

Rationale

The previous implementation reused a shared temporary filename for each language. Overlapping run-code calls could interfere with each other, and temporary files were left behind after execution. This change isolates each invocation and cleans up its temporary files.

Validation

  • npm ci
  • npm run build
  • MCP in-memory smoke test with two concurrent run-code JavaScript calls returning independent alpha / beta outputs and leaving 0 new mcp-code-runner-* temp directories.

Note: npm ci reports existing dependency audit findings (2 moderate, 3 high); this PR does not change dependencies.

@flaviens

Copy link
Copy Markdown
Author

Superseded by #25 with a cleaner branch name and commit message.

@flaviens flaviens closed this Jun 13, 2026
@flaviens
flaviens deleted the codex/use-unique-temp-files branch June 13, 2026 03:00
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