Gitea operations must prefer native MCP and fail closed on unsafe shell/API fallbacks #270

Closed
opened 2026-07-06 12:49:35 -05:00 by jcwalker3 · 1 comment
Owner

LLM sessions sometimes use shell scripts, direct API calls, manual encoding, or browser/helper fallbacks when native MCP tools exist. This bypasses capability gates and creates inconsistent auth behavior.

Required behavior:
Gitea mutations must use native MCP tools first. Fallbacks require explicit proof that MCP is unavailable and that the fallback is allowed for the current role/task.

Acceptance criteria:

  1. Add a native-MCP preference gate for Gitea operations.
  2. Block shell/API/helper fallback for issue comments, claims, labels, PR creation, review, merge, branch mutation, and close unless explicitly authorized.
  3. If MCP transport is broken, the session must produce a terminal report instead of improvising unsafe recovery.
  4. Add a shell health circuit breaker:
    • after a small fixed number of spawn/EOF failures, stop retrying
    • do not loop shell recovery attempts
  5. Block reviewer attempts to touch/restart/kill MCP server files or processes.
  6. Tests cover MCP-available fallback blocked, MCP-unavailable terminal report, shell retry limit, CLI auth divergence, and unsafe helper fallback denial.
LLM sessions sometimes use shell scripts, direct API calls, manual encoding, or browser/helper fallbacks when native MCP tools exist. This bypasses capability gates and creates inconsistent auth behavior. Required behavior: Gitea mutations must use native MCP tools first. Fallbacks require explicit proof that MCP is unavailable and that the fallback is allowed for the current role/task. Acceptance criteria: 1. Add a native-MCP preference gate for Gitea operations. 2. Block shell/API/helper fallback for issue comments, claims, labels, PR creation, review, merge, branch mutation, and close unless explicitly authorized. 3. If MCP transport is broken, the session must produce a terminal report instead of improvising unsafe recovery. 4. Add a shell health circuit breaker: - after a small fixed number of spawn/EOF failures, stop retrying - do not loop shell recovery attempts 5. Block reviewer attempts to touch/restart/kill MCP server files or processes. 6. Tests cover MCP-available fallback blocked, MCP-unavailable terminal report, shell retry limit, CLI auth divergence, and unsafe helper fallback denial.
jcwalker3 added the status:in-progress label 2026-07-07 08:09:28 -05:00
Author
Owner

Progress update

PR opened: #377feat/issue-270-native-mcp-preferencemaster

  • Commit: 6743cc1 — native MCP preference gate + shell circuit breaker
  • Tests: tests/test_native_mcp_preference.py (10 passed)
  • PR mergeable: yes

Ready for review.

**Progress update** PR opened: **#377** — `feat/issue-270-native-mcp-preference` → `master` - Commit: `6743cc1` — native MCP preference gate + shell circuit breaker - Tests: `tests/test_native_mcp_preference.py` (10 passed) - PR mergeable: yes Ready for review.
sysadmin removed the status:in-progress label 2026-07-07 08:54:05 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#270