Repository navigation
feat(mcp): targeted transactional upstream hot reload without global restart - #11
Conversation
…, repeated reload and collisions
…on isolated fixtures
|
Field reproduction relevant to targeted hot reload (2026-11-20; no shared restart performed): Codexify v2.4.0 service PID 21824 started 2026-11-19 23:12:51 UTC. Its startup log at 23:15:40 UTC explicitly says: The enabled Standalone smoke tests using the exact configured Node executable, entrypoint, and opt-in environment successfully yielded MCP server version Requested non-disruptive recovery regression for this PR: start one source with an intentional startup timeout; verify it is absent/FAILED while all other MCPs stay healthy; correct its config; call |
|
Field recovery follow-up (2026-11-20, actual connected Codexify v2.4.0): GodPrompt Preview 10 is now live. A new Windows |
|
Small, separate retention follow-up (not a request to expand this PR): As of 2026-11-20, the existing Codexify project |
Targeted per-MCP hot reload — staged, not deployed
Isolation: This is a feature-only branch against original
AKzar1el/codexifymain. No shared Codexify service, GodPrompt instance, existing browser, tunnel, Windows scheduled task, or other worker's branch/worktree has been stopped or modified. Separate Windows orphan-process fix remains untouched.Implemented
reload_mcp({source})accepts only an existing configured MCP key. No executable, command, URL, or credentials can be supplied in a tool call.kill_on_dropfor candidate cleanup. Generated gateway metadata shares one conversion path.docs/MCP_HOT_RELOAD.md.Verification work
New local HTTP MCP test fixtures exercise successful replacement, multi-source isolation, old-call pinning/no replay, initial outage reconnect, canceled and invalid replacements, same-source contention, concurrent independent reloads, catalog/gateway metadata changes, repeated cycles, sanitized-name collision safety and old-process generation release, including during unrelated in-flight direct calls.
CI and real-process verification (updated November 20, 2026): Prior commit
c85264fpassed the complete GitHub Actions run 44636938266: Rust formatting, Clippy, full Rust suite, Chromium/WebKit, Windows/macOS service integration and security jobs. This success predates additional OS-process proof. We addedscripts/fixtures/hot-reload-stdio-mcp.mjsandservice_isolated_real_stdio_process_reload_preserves_unrelated_sourcesto launch three independent OS-level stdio MCP processes and validate selected-source process replacement/version/catalog, in-flight call draining, old-generation pinning, unchanged unrelated PIDs, rollback after failed spawn, and repeat reload. The fixture passed local Node syntax and JSON-RPC smoke checks. On commit133b0e2, both Windows and macOScargo test --all-targets servicesteps passed, running the new OS-process test. Follow-up commit17b0d31applies the exact Rustfmt suggestions and adds a stronger OS-level PID-liveness check asserting that the old child actually exits after its last generation handle is dropped. Exact-head CI run 44642153048 completed successfully on November 20: main Rust suite, strict Clippy, formatting, browser tests, Windows and macOS service integration, and security reports all passed, including the retired child-process termination assertion.Isolated Windows host proof: On November 20, the user ran the one-click staging package against the pinned head. After an explicit binding to its existing, already-staged source directory (without cloning or modifying other checkouts), the
RESULT.jsonand local Cargo test log were read through the live Codexify God v5 connector. The report recordedPASSand the log confirmed1 passed; 0 failedforservice_isolated_real_stdio_process_reload_preserves_unrelated_sources; the test includes process replacement, in-flight call handling, rollback, and retired-child termination. A PowerShellNativeCommandErrorin the log came from Cargo writing normal compilation progress to stderr; it did not change the successful test exit code. The production Codexify and GodPrompt installation/configuration were untouched by this validation, and production hot reload is not activated. The original Windows service health probe returnedstatus=okand both ports were listening. Additional testing still outside this PR's CI scope: repeat-cycle Windows process soak beyond existing tests, workload p50/p95/p99 latency / memory profiling, and candidate GodPrompt upgrade on the live Windows host. The actual isolated GodPrompt v1.0.3 to v1.1.1 upgrade/rollback has now passed on Linux CI (see below). An additional local-only real GodPrompt 1.0.3 → 1.1.1 test was prepared in the staging copy (not committed). Its Windows Rust test compilation was intentionally stopped when available physical memory fell below 1 GB (later measured ~0.26 GB) to protect the running service and parallel agent. The resulting canary runnerFAILEDreceipt reflects deliberate compiler termination, not an observed runtime assertion failure; full details in the stagedGODPROMPT_CANARY_STATUS.txt. Do not restart or redeploy based on this incomplete canary. Do not use shared production service as a substitute. The unrelated Windows supervisor-orphan branch is not integrated by this PR.Real GodPrompt CI acceptance (new): Branch commits
4df4f73/39c2189add an opt-in Rust canary insrc/bridge/hot_reload_tests.rsplus an explicit Linux CI gate that installs the published, pinnedgod-prompt-mcp@1.0.3and@1.1.1packages into isolated temporary directories. It exercises actual stdio process upgrade, ping, tool discovery, unaffected beta/gamma MCP peers, and invalid-replacement rollback without invoking GodPrompt tool methods, touching operator config, or restarting production. Local test parameters are supplied only viaCODEXIFY_CANARY_OLD_GODPROMPTandCODEXIFY_CANARY_NEW_GODPROMPT; when both are absent in other test jobs, it is dormant. The first CI pass found only a blank-line Rustfmt discrepancy, then Clippy'slen_zerolint; both were corrected by commit91cd90b. The exact-head CI run 44667621824 passed the strict Rustfmt, Clippy, full Rust suite and real GodPrompt acceptance step. The verified CI log records actual isolated stdio upgrade1.0.3 -> 1.1.1, discovery7 -> 9 tools,116 msmeasured total reload, and successful invalid-replacement rollback; no production source was touched. Entire exact-head CI run passed: Rust formatting, strict Clippy, complete Rust tests, real GodPrompt reload/rollback, Chromium/WebKit browser layout, Windows and macOS service integration, and security checks. No failed jobs.CI merge gate satisfied: exact-head
cargo fmt --check, strict Clippy, full Rust and browser suites, Windows/macOS integration and isolated real-process GodPrompt validation all passed in run 44667621824. This PR is ready for review/merge. Production activation remains separate: do not change the installed Codexify binary, restart the service, redeploy, or interfere with the parallel Windows supervisor/orphan-process work without a coordinated rollout.Windows production-config compatibility (2026-11-20): During a local experimental preview activation, the preview binary passed isolated MCP hot-reload and rollback but failed to start using the current operator config. The exact service-log error was an unrecognized
agentChat.automation.providerSendGatePathfield; Windows supervisor restarted the preview repeatedly with exit code 1. The installed original was successfully restored and is healthy. Instead of stripping the operator's Send-gate config, the feature branch now includes compatibility commitsce590c5and29650c5: parse/validate the optional absolute gate path and forward it to the browser companion asCODEXIFY_BROWSER_SEND_GATE_PATH, matching the existing local Codexify behavior. Test coverage includes JSON roundtrip and invalid relative-path rejection. The new preview Windows build and exact-head CI have been triggered on85a6608. No claim of green status or production installation until these finish and the new binary validates the unchanged operator config.