feat(pi): add T3 MCP, native children, and Extra High advertise - #34
Merged
StiensWout merged 3 commits intoAug 17, 2026
Merged
Conversation
Pi core has no MCP client. V2 already minted a scoped t3-code bearer before openSession. This writes a T3-owned extension into the server cache and spawns pi --mode rpc --extension <that file> with T3_MCP_URL and T3_MCP_BEARER_TOKEN. Each MCP tool is registered under its original name. User launchArgs are preserved. The first turn receives the shared orchestration instructions.
Official subagent uses --no-session, so T3 could project cards but could not open the child. Inject a T3-owned override that persists --session, reports sessionFile, and binds each result as a child thread. Follow-up sends allocate a new RPC and resume with switch_session. Duplicate subagent registrations abort Pi, so spawn disables extension discovery and drops the official tool from launchArgs.
Pi discovery used one High-capped picker for every reasoning model. get_available_thinking_levels is session-scoped, so catalog discovery now reads each get_available_models thinkingLevelMap instead. Extra High and Max appear only when the map has a non-null entry.
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.
What Changed
Stacked follow-up to pingdotgg#7211 pi-provider. Three commits, one concern each:
--extension(T3_MCP_URL,T3_MCP_BEARER_TOKEN,mcp-protocol-version: 2025-06-18).delegate_taskandt3_thread_*register under their original names.subagent(--no-session) with a T3 override that persists--session, reportssessionFile, and binds each task as a resumeable child thread. Follow-up sends open a new RPC andswitch_session. Duplicatesubagentregistrations abort Pi, so spawn uses--no-extensionsand strips the official tool.get_available_models.thinkingLevelMap. Extra High (xhigh) and Max appear only when the map has a non-null entry.get_available_thinking_levelsis session-scoped; hoppingset_modelduring catalog discovery is the wrong path.Why
pingdotgg#7211 pi-provider can drive Pi and project official subagent cards, but it cannot give Pi the T3 orchestration tools, cannot open those cards as child threads, and caps every reasoning model at High. Claude, Codex, and Grok already have those three pieces.
UI Changes
Thinking picker for Pi models that opt into Extra High / Max. No other visual change.
Problem and Fix
t3-codebearer, but Pi core has no MCP client.pi --mode rpc --extensionwith the bearer env.subagentuses--no-session, so T3 could project cards but not open the child.--session, reportsessionFile, bindchildThreadId, resume on a new RPC.xhigh.thinkingLevelMap.Validation
piT3McpInjection.test.ts, Pi adapter spawn/capability tests,piThinkingCapabilities.test.ts(7 tests)pi-t3-mcpPASS (20260816-175131);pi-subagentPASS (20260816-210210) with a bound child andPI_CHILD_FOLLOWUP_OKxai/grok-4.6after reload; picker persist ofthinking: xhighconfirmed on later turnsRemaining work to do
Priority order. None of this blocks merging these three commits.
delegate_task/t3_thread_*. Childpi --mode jsonstill does not get--extensionorT3_MCP_*, so a native child cannot nest T3 tools the way Codex, Claude, and Grok children can.--no-extensions. Still strip official.../extensions/subagent/index.ts. Today plan-mode and similar user extensions disappear unless they are already inlaunchArgs. Discover via Effect FileSystem; rawnode:fsfailed the Effect gate.400at 520785 / 500000 tokens. Pi compacted 513444 -> ~3413 and the turn finished (commit, typecheck, review). T3 still terminalized the run asprovider_errorbecausemessage_endstopReason: errorsetturn.failureand nothing cleared it after a successful compaction.#7211already clears that flag onauto_retry_endsuccess; compaction recovery needs the same treatment. The red banner above a later user bubble is this leftover failed item, not a failure of that later send.sessionFilestaychildThreadId: null.canWaitForSubagents/canCloseSubagentsonly after a real path exists.pi --forkexists; adapter and CommandPolicy refuse today).Checklist