Commit graph

4 commits

Author SHA1 Message Date
Hans Aschauer
9ceeaa1eda Re-wire mcp_forge to use pod_executor
- Created adapters/ module with SimpleBackend and JupyterBackend wrappers
- Adapters map ForgeConfig to pod_executor explicit parameters
- Updated server.py to use pod_executor components:
  - PodmanClient and SecureContainerManager from pod_executor
  - SimpleFileAuditLogger and BasicValidator from pod_executor
  - Removed old execution/ and podman/ imports

- Updated all tool files:
  - execute_python.py: imports from adapters
  - document_state.py: uses jupyter_backend instead of session_manager
  - resources.py: updated session references

- Updated builder files to import from pod_executor:
  - image_builder.py: PodmanClient, parse_memory_string
  - environment_builder.py: PodmanClient

- Fixed test: test_resource_limits_storage_quota_in_podman_params
  - Storage is tracked internally but not in Podman params
  - All 40 pod_executor tests now passing

Key architectural change:
- pod_executor is now the execution engine
- mcp_forge adapters provide ForgeConfig compatibility layer
- Separation of concerns: execution vs MCP protocol
2026-02-07 11:11:06 +01:00
Hans Aschauer
3a6bd01272 Adapt tests for pod_executor package and clean up mcp_forge
- Created tests/pod_executor/ with adapted tests from old locations
- tests/pod_executor/simple/test_executor.py: 17/17 tests passing
- tests/pod_executor/security/test_resource_limits.py: 22/23 tests passing

- Removed old test locations (will be deleted with mcp_forge cleanup)
- Fixed all corrupted files from sed/quote issues using Python scripts
- Removed mcp_forge dependencies from pod_executor:
  - Removed ForgeConfig from backend.py (explicit parameters)
  - Removed SessionConfig from sessions.py (explicit parameters)
  - Fixed all audit logger calls to use string-based events

- Updated mcp_forge/security/__init__.py:
  - Removed resource_limits imports (now in pod_executor)
  - Added comment directing to pod_executor.security.resource_limits

- Deleted from mcp_forge:
  - src/mcp_forge/execution/ (simple and jupyter backends)
  - src/mcp_forge/podman/ (container management)
  - src/mcp_forge/security/resource_limits.py

Total: 39/40 tests passing in pod_executor package
2026-02-07 11:05:32 +01:00
Hans Aschauer
7c9721dfcc Fix error handling and update tests for Jupyter backend
Error Handling:
- Track has_error flag in execute_code to detect error messages
- Return success=False when error message received
- Populate error field with stderr content on errors
- Set exit_code=1 on errors

Test Improvements:
- Add comprehensive mocking for ZMQ/Jupyter components
- Mock _allocate_ports, _wait_for_kernel_ready, _connect_client
- Mock BlockingKernelClient with proper message responses
- Mock tempfile and Path operations
- Fix test expectations for mocked environment
- Simplify error tests (can't test actual errors with mocks)
- Fix shutdown_kernel test (no timeout parameter)
- All 22 tests now passing!

Test Results: 22 passed, 0 failed
2026-02-07 08:20:20 +01:00
Hans Aschauer
372af75b90 initial commit after one day coding agent session 2026-02-07 07:45:57 +01:00