Skip to content

feat(4.7): Extract MCPToolHandlers into openspace/mcp/tool_handlers.py#36

Merged
Deepfreezechill merged 1 commit into
mainfrom
epic/4.7-mcp-tool-handlers
Apr 3, 2026
Merged

feat(4.7): Extract MCPToolHandlers into openspace/mcp/tool_handlers.py#36
Deepfreezechill merged 1 commit into
mainfrom
epic/4.7-mcp-tool-handlers

Conversation

@Deepfreezechill

Copy link
Copy Markdown
Owner

Epic 4.7: Extract MCPToolHandlers

Changes

  • New: \openspace/mcp/tool_handlers.py\ (799 lines) — all 4 MCP tool handlers + 12 helpers
  • New: \openspace/mcp/init.py\ — package marker
  • New: \ ests/test_mcp_tool_handlers.py\ — 20 tests (registration, formatting, metadata, gating)
  • Modified: \mcp_server.py\ slimmed from 992 → 220 lines (bootstrap + server entry only)
  • Modified: 3 test files updated import paths

Extraction Summary

Component Lines
tool_handlers.py 799
mcp_server.py 220
Total 1,019 (was 992 monolith)

Review Results (/8eyes + /collab)

Reviewer Model Verdict
8eyes-impl Sonnet ✅ PASS (2 LOW: shared logger, no idempotency guard)
8eyes-sec Sonnet ✅ PASS (0 new, 2 pre-existing)
/collab GPT-5.4 ✅ APPROVE
/collab Opus 4.6 ✅ APPROVE WITH FINDINGS (F1: no async handler tests — tracked)

All 1,376 tests pass, 117 skipped.

Extract all 4 MCP tool handlers (execute_task, search_skills, fix_skill,
upload_skill) and their 12 helper functions from mcp_server.py into a new
openspace/mcp/tool_handlers.py module.

Changes:
- Create openspace/mcp/ package with __init__.py
- Create openspace/mcp/tool_handlers.py (799 lines) with:
  - 4 tool handlers + register_handlers(mcp) wiring function
  - All lifecycle helpers (_get_openspace, _get_store, etc.)
  - Upload metadata helpers (_write/_read_upload_meta)
  - Cloud import helpers (_cloud_search_and_import, _do_import_cloud_skill)
  - Result formatting (_format_task_result, _json_ok, _json_error)
- Slim mcp_server.py to 220 lines (was 992): bootstrap, FastMCP, server entry
- Update test imports: test_auto_import_disabled, test_integration,
  test_traceback_safety now reference openspace.mcp.tool_handlers
- Add 20 new tests in test_mcp_tool_handlers.py

All 1,376 tests pass, 117 skipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Deepfreezechill Deepfreezechill merged commit ded8183 into main Apr 3, 2026
0 of 5 checks passed
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

🔒 Phase Gate Enforcement — 🚫 FAIL

Check Result Detail
Issue linkage No linked issues found. PR must contain "Closes #N", "Fixes #N", or "Resolves #N".

Verdict: FAIL
Timestamp: 2026-04-03T20:58:50.501Z
Run: View workflow run


How to fix: Ensure all prerequisite phases are complete, or add emergency:bypass label with a ## Bypass Reason section in the PR body.

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