Repository navigation
feat!: require Pi's built-in MCP and remove the extension's own client - #36
Merged
Merged
Conversation
The extension now registers `gortex mcp` with Pi's built-in MCP and leaves the tool channel to Pi. Its own stdio client, tool registration and the `native_mcp` setting are gone, and the remaining identifiers drop the `native` prefix (`src/native.ts` -> `src/mcp.ts`). When no MCP connector is loaded, the binary does not resolve or Pi refuses the registration, the first turn tells the model graph tools are unavailable, and read discipline stays off until graph tools appear. BREAKING CHANGE: Pi 1.0 or later with its MCP extension loaded is required. `native_mcp: false` and `GORTEX_NATIVE_MCP` no longer select a fallback. Both Pi peer dependencies are now `>=1.0.0`. Closes #33
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
The extension now registers
gortex mcpwith Pi's built-in MCP (pi.registerMcpServer) and leaves the tool channel entirely to Pi. Its own stdio MCP client (src/mcp-client.ts), tool registration (src/tools.ts), shared state (src/state.ts) and thenative_mcpsetting are removed. The remainingnative*identifiers are renamed (src/native.ts->src/mcp.ts,isNativeGortexTool->isGortexTool, and so on).Behaviour without a tool channel:
--no-mcp), the binary does not resolve, or Pi refuses the registration, nothing is registered (or the refusal is recorded) and the first turn tells the model graph tools are unavailable and why.gortexserver, so the first turn still waits for its tools and reports the refusal only if none appear.Each session builds a fresh extension instance, so each registers once; the re-register and withdraw logic and the
session_shutdownhandler are gone.Closes #33
Breaking change: Pi 1.0+ with its MCP extension loaded is required.
native_mcp: false/GORTEX_NATIVE_MCPno longer select a fallback channel. Both Pi peer dependencies (pi-coding-agent,pi-tui) are now>=1.0.0.Related issues:
gortex mcpchild its own session object and a lifecycle state machine #22 becomes obsolete: it is entirely about the removedMCPStdioClient.gortex_readalias reaching the hook), with its alias bullet and regression test, becomes obsolete. The rest of Run the hook bridge asynchronously, with piped stdio and per-call guidance #24 still applies.Deferred, unchanged by this PR:
gortex hookstderr can reach the TUI (Run the hook bridge asynchronously, with piped stdio and per-call guidance #24 item 1)..cmdshims pass the binary check (On Windows, a .cmd or .bat gortex shim passes the binary check but the hook cannot run it #37).Testing
npm run checkpasses (typecheck + 136 tests)ExtensionRunner(seedocs/tests.md)pi -e /path/to/checkout), if user-visibleManual runs on Pi 1.3.0 with gortex v0.64.8 (
pi -ne -e builtin:mcp -e <checkout> --mode json -p ...):mcp__gortex__*tools registered, Pi'sreadblocked and redirected to the graph tools.--no-mcp: the model is told MCP support is not loaded; Pi'sreadis allowed.GORTEX_BIN=/nope/gortex: the model is told the binary is missing; Pi'sreadis allowed.gortexfirst): the turn waits for the tools and no false unavailable message appears.Mutation checks confirmed the suites fail when the enforcement gate, the tools-from-elsewhere check, the settled gate, the refusal wait or the late
session_startfix is reverted, and when a handler throws.Checklist
docs/architecture.mdupdated briefly, only if a design decision changed