Skip to content

feat(mcp): transactional per-source hot reload without service restart - #31

Open
AKzar1el wants to merge 62 commits into
devnoname120:mainfrom
AKzar1el:feat/per-mcp-hot-reload-20261119
Open

AKzar1el wants to merge 62 commits into
devnoname120:mainfrom
AKzar1el:feat/per-mcp-hot-reload-20261119

Conversation

@AKzar1el

@AKzar1el AKzar1el commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

Codexify can reload one already-configured MCP source using reload_mcp({source}), without restarting the main service, existing ChatGPT tunnel/sessions, or unrelated MCP sources. This is a transactional replacement, not an unrestricted process launcher.

Implementation

  • Accept only an existing MCP source key; no operator-supplied command, executable, URL, or credentials.
  • Connect and initialize a replacement, rediscover tools, validate and atomically swap the source view only when ready.
  • Preserve in-flight calls on their original generation; do not replay potentially mutating operations.
  • Roll back failed or canceled replacements and serialize same-source reloads while allowing independent sources to reload concurrently.
  • Update direct, gateway and catalog metadata, health accounting, and redacted diagnostics.
  • Retire old stdio processes only after their final generation handle drains.

Verification

  • Feature-code head 8c305401150f9641d4db7ffc32e1c950503f6b4b: GitHub CI success, including Rustfmt, strict Clippy, Rust suite, Chromium/WebKit, Windows/macOS service integration and security checks. Follow-up 29d4b37cb152fb84a5573c82979dc6af74a12227 is a documentation-only correction; any newer exact-head CI result should be checked separately.
  • Isolated real published GodPrompt stdio canary: god-prompt-mcp@1.0.3 -> @1.1.1, discovery 7 -> 9 tools, invalid-candidate rollback passed.
  • Windows real-process integration: multiple independent stdio MCP child processes, replacement, in-flight drain, unchanged unrelated PIDs, rollback and old-child termination.
  • Identical pinned Windows preview binary passed isolated authenticated reload_mcp E2E; operator's live installation has been separately health-checked without a new production reload. No production change is required to review this PR.

Operator live smoke test (November 21, 2026)

  • Confirmed a documentation pitfall: the normalized catalog ID god_prompt_mcp is not necessarily the configured server key. reload_mcp({"source":"god_prompt_mcp"}) failed closed with SOURCE_UNKNOWN and did not switch the connection.
  • With the resolved key god-prompt-mcp, reload_mcp({"source":"god-prompt-mcp"}) succeeded: diagnosticCode=OK, generation 2 -> 3, GodPrompt 1.4.0-checkpoint-preview.10, 23/23 unchanged tools, oldCallsDrained=true, oldCallsStillRunning=0, rollback=not_required, 2,378 ms total. A GodPrompt classify_task call succeeded afterward.
  • Independently, context7 reload succeeded in 1,508 ms. Post-checks showed 14/14 sources connected, unchanged main-service/browser process IDs, and both established listener ports intact. No service restart, installation, worker changes, or changes to the other parallel upgrade branches.
  • This is a live operator-installation smoke test, not an assertion that the installed executable is byte-identical to the latest PR head; the PR's isolated CI results are tracked separately.

Rollout / limitations

  • Docs: docs/MCP_HOT_RELOAD.md now explicitly distinguishes exact configured server keys from normalized catalog IDs. Client tool manifests may require a connector refresh/new session to expose newly discovered tools.
  • A binary/source merge is not an installation. No production service restart, credentials, or live configuration is changed by this PR.
  • Includes optional existing operator browser Send-gate config compatibility validated by the Windows preview.
  • Related contributor staging PR: AKzar1el/codexify#11.

Prepared as a single reviewable upstream contribution; happy to adjust scope or tests to the maintainer's preferences.

Copy link
Copy Markdown
Contributor Author

Follow-up operator validation (2026-11-21), incorporated into the PR description and docs:

  • The catalog-facing source ID god_prompt_mcp is not the configured MCP key god-prompt-mcp. reload_mcp({"source":"god_prompt_mcp"}) fails closed with SOURCE_UNKNOWN; the correct call is reload_mcp({"source":"god-prompt-mcp"}).
  • Correct-key live reload succeeded (diagnosticCode=OK, generation 2 -> 3, 23/23 tools unchanged, 2,378 ms, old calls drained, zero outstanding). A GodPrompt tool call worked afterward. Independent context7 reload also passed (1,508 ms). All 14 sources remained connected, and service/browser PIDs and listener ports stayed unchanged.
  • Corrected the misleading example and documented the catalog-ID/config-key distinction in docs-only commit 29d4b37. No implementation change, config change, service restart, or other-worker modifications were needed.

This is an operator's installed-service smoke test, not a claim of binary identity with this PR's current head. Prior feature-code CI was green; the latest docs-only head should be independently checked by CI before merge.

This branch has not been deployed

No deployments
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