fix(mcp): make capability resolver side-effect free (Closes #685) #724
Merged
sysadmin
merged 3 commits from 2026-07-17 13:05:52 -05:00
fix/issue-685-side-effect-free-resolver into master
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#724
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Closes #685.
Problem
gitea_resolve_task_capabilityis documented as read-only, but its stale-runtime path called_trigger_mcp_auto_restart(), which:mcp_config.jsonviaos.utimeos._exit(0)after 1sLive reproduction during this work:
resolve(work_issue)returnedAuto-restart has been triggered: touched mcp_config.jsonwhile master had advanced past the process boot head.Fix
_trigger_mcp_auto_restartentirely from the server._check_mcp_runtimes_diagnosticsremains report-only: still detects self-stale / missing / all-stale profiles, never mutates config or process state.blocker_kind=runtime_reconnect_requiredrestart_required=true/stop_required=truemutation_performed=falseexact_safe_next_actionpointing at IDE/client reconnect (not auto-restart)Boundaries (not this PR)
os._exitside effectsinternal_errorTests
tests/test_issue_685_side_effect_free_resolver.pytests/test_mcp_stale_runtime.pyValidation
Explicit non-goals
Next role
Independent REVIEWER — do not self-review or merge.
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #724
issue: #685
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 29232-d6793748490c
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-724-c780ded
phase: claimed
candidate_head:
c780ded653target_branch: master
target_branch_sha:
67e4a2b5e9last_activity: 2026-07-17T02:01:25Z
expires_at: 2026-07-17T04:01:25Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #724
issue: #685
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 389-83c75b551193
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-724-c780ded
phase: claimed
candidate_head:
c780ded653target_branch: master
target_branch_sha:
67e4a2b5e9last_activity: 2026-07-17T13:53:58Z
expires_at: 2026-07-17T15:53:58Z
blocker: none
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #724
issue: #685
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 60168-b4fdaed96b1a
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-724-899ef8e
phase: claimed
candidate_head:
899ef8ec7ftarget_branch: master
target_branch_sha:
58d6b5844flast_activity: 2026-07-17T18:05:14Z
expires_at: 2026-07-17T20:05:14Z
blocker: none
Canonical PR State
STATE: approved
WHO_IS_NEXT: merger
NEXT_ACTION: Merger adopts/acquires lease and merges PR #724 at pinned head
899ef8ec7fwith confirmation MERGE PR 724.NEXT_PROMPT:
WHAT_HAPPENED: Independent prgs-reviewer (sysadmin) reviewed exact head
899ef8eafter master merge conflict resolution. #685 removes resolver auto-restart (config touch / os._exit); stale path is report-only with blocker_kind=runtime_reconnect_required and mutation_performed=false. Resolve-path stale-binding assessment is auto_recover=False so capability resolve stays side-effect free while still annotating #702 guidance. #725 merger-lease and #728 PR-sync preserved. Focused 12 + related 204 tests passed.WHY: Meets #685 ACs without weakening stale detection; no hidden mutations on resolve path; master features retained.
ISSUE: #685
HEAD_SHA:
899ef8ec7fREVIEW_STATUS: approved
MERGE_READY: yes
BLOCKERS: none
VALIDATION: pytest tests/test_issue_685_side_effect_free_resolver.py tests/test_mcp_stale_runtime.py -> 12 passed; related suite 204 passed; mergeable true
NATIVE_REVIEW_PROOF: transport=native_mcp; entrypoint=mcp_server; profile=prgs-reviewer; identity=sysadmin; tool=gitea_submit_pr_review; head=899ef8ec7fde7a6e9a79d7ea7e0c9691e6b19bab; session=60168-b4fdaed96b1a
LAST_UPDATED_BY: prgs-reviewer / sysadmin
adopted_at: 2026-07-17T18:05:41Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 60168-b4fdaed96b1a
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 12147
adoption_reason: merger-handoff-approved-head
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #724
issue: #685
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 60166-1ef283925529
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr-724-899ef8e
phase: adopted
candidate_head:
899ef8ec7ftarget_branch: master
target_branch_sha:
58d6b5844flast_activity: 2026-07-17T18:05:41Z
expires_at: 2026-07-17T20:05:41Z
blocker: none