Repository navigation
fix(cli,memory): persist OPENCODE_DB in v2 service, add magnolia service subcommand, and guard mcp 1.x cancel crash - #37
Merged
Conversation
…ice subcommand, and guard mcp 1.x cancel crash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes OpenCode v2 service management and MCP recovery self-contained inside the
magnoliawrapper, and preventscompchem-memoryfrom crashing on cancelled tool calls undermcp==1.26.x.1.
magnoliawrapper resilience (opencode_cc_mem/softwares/bin/magnolia)OPENCODE_DBin OpenCode v2 service config (_ensure_v2_service_db): WhenOPENCODE_DBis not yet saved in OpenCode'sservice.json,magnoliasets it automatically viaopencode service set env OPENCODE_DB <path>(never overwriting an existing custom value). Even a bareopencode service restartor reboot now stays on Magnolia's isolatedopencode-v2.db.magnolia doctor: Checks any runningopencode serve --serviceprocess and warns loudly if it is attached to a different DB thanOPENCODE_DB, pointing tomagnolia service restart.magnolia service [status|restart|start|stop]subcommand: Restarts/manages the OpenCode v2 background daemon with Magnolia'sOPENCODE_DBand~/.config/magnolia/envalready loaded — no raw binary paths or env vars needed.magnolia doctor [project]: Queriesopencode mcp listwhen the v2 service is running, catching a cachedfailedcompchem-memoryMCP server and pointing directly tomagnolia service restart.2.
compchem-memorycancellation crash guard (compchem_memory/server.py)mcp==1.26.xbug whereRequestResponder.cancel()sets_completed = TrueandRequestResponder.respond()assertsnot self._completedbefore checkingif not self.cancelled:— causing any cancelled synchronous tool call to raiseAssertionError: Request already responded to, escape the anyioTaskGroup, and kill the MCP server.mcp >= 2.0(fastmcp 4.x), while preserving theAssertionErrorfor genuine non-cancelled duplicate responses.Verification
pytest tests/test_server_cancel_guard.py tests/test_llm_providers.py -q: 82 passedinstall_and_doctor_test.sh: 21 passed, 0 failedcompchem_tools_daemon_test.sh: 17 passed, 0 failedhpc_tunnel_test.sh: 6 passed, 0 failed