Commit 9cd2e78
committed
feat(script-engines): implement complete Python engine for Issue #253
- Add PythonEngine with subprocess execution and timeout handling
- Implement context injection with JSON serialization and Python syntax conversion
- Add comprehensive error handling for syntax, runtime, import, and timeout errors
- Integrate memory tracking and performance monitoring capabilities
- Support script precompilation (source storage) and execution
- Add structured stderr log parsing for debugging capabilities
- Add 13 comprehensive tests covering all functionality:
* Engine creation and configuration
* Simple script execution and context injection
* Error handling (syntax, runtime, import errors)
* Timeout enforcement and memory tracking
* MCP validation script support
* Performance requirements validation (<1000ms for concurrent execution)
* Concurrent execution support
- All tests passing with proper error handling and resource management
Design document: docs/design/issue-253-python-engine-implementation.md
Tests: 13 tests, all passing (coverage: comprehensive)
Dependencies: Add 'which' crate for Python interpreter detection
closes #2531 parent 09a6701 commit 9cd2e78
5 files changed
Lines changed: 2038 additions & 4 deletions
File tree
- crates/mandrel-mcp-th
- src/script_engines
- docs/design
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
0 commit comments