Repository navigation
feat(native): run SumoCode's Pi in T3 Code via sumocode-pi-cli, on Pi 1.1.0 - #618
Conversation
install.sh links ~/.local/bin/sumocode-pi-cli, a Pi CLI entry for apps that launch pi themselves. It reports the bundled Pi version, runs bare Pi for --no-extensions helper runs, and otherwise runs `sumocode --no-sumo-tui` with SUMOCODE_APP_HOST=1. That marker selects a new app-host extension profile: no chrome, no Herdr bridge, the question/terminal/Slate tools, memory, and seven commands that work through Pi's RPC dialogs. Inside T3 Code, T3's delegate_task replaces the subagent tools and the system prompt maps each SumoCode role to a delegate_task call. The rpc-child profile and the classic profile are unchanged.
|
🔍 OpenCodeReview found 3 issue(s) in this PR.
|
|
Here's a visual recap of what changed: Open the full interactive recap |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the complete 13-file diff at dd89fab and traced each new path through its consumers.
- App-host profile dispatch (
src/app-host.ts,src/extension.ts,src/extension-core.ts):SUMOCODE_APP_HOST=1selectsinstallAppHostProfileafter the helper-subprocess guard, the duplicate-install guard, the process latch, and theSUMOCODE_RPC_CHILDcheck — so SumoCode's own child and the Herdr bridge keep the full rpc-child profile, and the marker (not T3's variables) drives selection. - T3 orchestration gate (
hasT3Orchestrationrequires bothT3_MCP_URLandT3_MCP_BEARER_TOKEN): with the bridge,subagent_*tools are replaced bybuildT3RoleGuidanceappended inbefore_agent_start; without it,installSubagentsruns unchanged. Pi'semitBeforeAgentStartchains handler results (dist/core/extensions/runner.js), so the append composes with other handlers. - Command allowlist (
installAppHostInteractions+answer/fast): I checked each of the seven handlers takes an RPC-safe path —showDivineQueryandshowMemoryEditorboth branch onctx.mode === "rpc", as does/answer, and/fast,/sumo:sync,/sumo:bootstraponly notify. - Wrapper and packaging (
src/native/sumocode-pi-cli.sh,install.sh,scripts/build-native.mjs): version fast-path, bare-Pi--no-extensionspassthrough,--termination, and symlink-to-archive resolution are consistent with the existing launcher; the installer requires, checks, and linksbin/sumocode-pi-cli, and the archive build copies it0755. - Tests and docs: unit coverage asserts the exact 7-command list, the subagent swap, no chrome on
session_start, and rpc-child precedence; native cases cover install/version/dry-run andget_commandsthrough the wrapper, including empty output under--no-extensions.
Verification at this head: tsc --noEmit clean, oxlint clean on the touched files, and vitest for src/app-host.test.ts + src/extension.test.ts + src/interaction-registry.test.ts passes 46/46. CI's typecheck + unit tests job is red before those steps run — its Dependency audit policy step reports unclassified high advisory 1240992, advisory data unrelated to this diff (no dependency files changed). The four OpenCodeReview inline notes were assessed and are non-blocking: the unbounded symlink loop mirrors bin/sumocode.sh's existing resolution, and the per-turn loadRoles read matches subagent_spawn's per-call pattern.
deepseek-flash | 𝕏
…on probe - Load roles.json once when the app-host profile installs, like the subagent tools do, and log its warnings, since no spawn step checks them under T3. - sumocode-pi-cli answers -v/--version only as the sole argument, the form apps probe with, so a -v that is another flag's value is not misread.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the incremental delta from dd89fab to 3a034a3 and re-read the full 13-file diff for context.
- Load T3 role guidance once (
src/extension-core.ts):loadRoles({ env })now runs at profile install instead of insidebefore_agent_start, matching howregisterSubagentToolsbuilds its prompt guidelines once; discarded warnings are surfaced throughlogDiagnostic("app_host_roles_warnings", …).warning.messagematchesRoleWarning, and the handler only appends the prebuilt string, so no filesystem read happens per turn. - Override regression test (
src/extension.test.ts): writes aresearchmodel override into the per-test tempPI_CODING_AGENT_DIRand asserts the T3 guidance carries- research (model deepseek/deepseek-flash): …; the file lives in the temp dirafterEachremoves. - Bare version probe (
src/native/sumocode-pi-cli.sh):--version/-vroute tosumocode-pionly as the sole argument, while--no-extensionskeeps its pre---scan, so helper runs are unchanged.
Verification at this head: pnpm exec tsc --noEmit clean and pnpm vitest run src/app-host.test.ts src/extension.test.ts 43/43 pass.
deepseek-flash | 𝕏
…ance - Each role line now lists its tools and MCP limits, and the guidance says delegate_task cannot fence them, so the task must state them. - roles.json is read on every turn: under T3 the guidance is the role config, and no spawn step re-reads it the way subagent_spawn does. - roles.json problems go into the guidance, the one channel that reaches the model and user here, as well as the diagnostics log. - The app-host activation diagnostic records whether T3 orchestration was found, so the fallback to SumoCode subagents is observable.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor rendering suggestion inline.
Reviewed changes
Reviewed the delta from 3a034a3 to 1a0c1e91 (plus the full 13-file diff for context).
- Role guidance rebuilt per turn again (
src/extension-core.ts):loadRolesmoved back insidebefore_agent_start, so roles.json edits take effect mid-session; warnings are re-read, logged each turn, and passed into the guidance. This deliberately reverses the install-time load from3a034a3and matches the author's reply on the round-2 OCR thread. - Role limits and warnings in the prompt (
src/app-host.ts): each role line now carries itstools/mcpServerslimits, and a new sentence tells the model thatdelegate_taskcannot fence a child's tools so the task must state them. roles.json warnings are appended to the guidance itself. - Fallback observability (
src/extension.ts): the app-hostextension_activate_enddiagnostic recordst3Orchestration, so subagents-vs-delegate_taskselection is visible in logs. - Tests: new cases for role limits and warnings; the roles.json override test now edits the file between turns and asserts the guidance follows, including the broken-file fallback.
Verification at this head: pnpm exec tsc --noEmit clean, pnpm lint clean, and vitest run src/app-host.test.ts src/extension.test.ts passes 45/45.
deepseek-flash | 𝕏
roles.json "tools": [] launches a SumoCode child with --no-tools, so the T3 guidance says "no tools" instead of a blank list, matching "no MCP". Per pullfrog's review on #618.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta from 1a0c1e9 to 09a0f75 (plus the full 13-file diff for context).
- Empty role tool lists render meaningfully (
src/app-host.ts):roleLimitsnow renderstools: []asno toolsinstead of a baretools:, matching the existingno MCPhandling formcpServers: []and the--no-toolslaunch SumoCode gives a child with an empty tool surface (src/subagents/task-config.ts:105). - Test coverage (
src/app-host.test.ts): the role-limits case adds atools: []role and asserts- think (inherits your model; no tools): think.
The prior review's inline suggestion is applied and its thread is resolved. Verification at this head: pnpm exec tsc --noEmit clean, pnpm lint clean (4 pre-existing scratch warnings), CI=1 vitest run src/app-host.test.ts src/extension.test.ts 45/45 pass.
deepseek-flash | 𝕏
Move the Pi peer range, dev pin, native PI_PIN, supported-matrix default, and every pin anchor from 0.99.1 to 1.1.0. Upgrade review (0.99.1 -> 1.1.0): - RPC types (rpc-types.d.ts) are byte-identical, and the compile-exhaustive contract classification typechecks unchanged. - args.js adds one boolean, --no-mcp. The launcher tables in bin/sumocode.sh and src/native/main.ts now list it, with a PTY row. - The bun/ entry files and Bedrock strip points are unchanged; the native build still excludes Bedrock and both binaries report 1.1.0. - OSC 7501 program status lives only in interactive mode, so RPC stdout stays clean JSONL for the shell and T3. - Pi 1.0 opens interactive sessions fullscreen, where the classic footer does not draw. The package-entry boot test pins --tui-mode regular, and the changelog notes the limitation.
The bare-Pi --no-extensions path loads no SumoCode extension, so the marker now applies only to the final sumocode --no-sumo-tui exec. Per OpenCodeReview on #618.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta from 09a0f75 to 5a2c780 — the Pi 0.99.1 → 1.1.0 bump with its pin updates, plus the origin/main merge that landed alongside it — against the full 27-file diff.
- Pi bumped to 1.1.0 (
package.json,pnpm-lock.yaml,scripts/build-native.mjs,scripts/smoke-pi-versions.sh,scripts/check-dependency-audit.test.mjs): peer ranges and dev pins move to~1.1.0, the nativePI_PINand the smoke matrix default follow, and the lockfile resolves the 1.1.0 dependency chain. --no-mcphandled as a boolean (bin/sumocode.sh,src/native/main.ts,test/integration/spawn-pi-pty.test.ts): both launcher option-consumption mirrors list Pi 1.1.0's only new CLI flag — the sole change to the args.js parse loop — so it can never consume the prompt; a PTY row covers the extraction.- Fullscreen default documented (
CHANGELOG.md,test/integration/rpc-host-shell.test.ts): Pi 1.x opens interactive sessions fullscreen, where the classic footer no longer draws; the changelog points at--tui-mode regular/"tuiMode": "regular"and the classic-footer boot test pins regular mode. - Version anchors refreshed (
README.md,DEV_LOOP.md, RPC contract comments, integration expectations): pin text moves to 1.1.0 with no behavioral change.
I verified the load-bearing bump claims against the published packages rather than taking them on faith: dist/modes/rpc (including rpc-types.d.ts) is byte-identical between 0.99.1 and 1.1.0, dist/bun is identical with the Bedrock patch needle still matching exactly once, args.js adds only the boolean --no-mcp, tuiMode is the correct settings key, before_agent_start still chains result.systemPrompt, and the OSC 7501 reporter is imported only by interactive-mode.js so RPC stdout stays clean. CI at this head is green across typecheck + unit tests, pi-compat (supported matrix), integration tests (node-pty), and code-review. All prior review feedback is applied and resolved.
deepseek-flash | 𝕏
sumocode-pi-cli execs bin/sumocode-pi directly for --version and --no-extensions, so the installer checks it like the other two entry points. Per OpenCodeReview on #618.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta from 5a2c780 to 4baed371 — one new commit, fix(native): set SUMOCODE_APP_HOST only for the app-host exec — against the full 27-file diff.
- App-host marker scoped to the app-host exec (
src/native/sumocode-pi-cli.sh):export SUMOCODE_APP_HOST=1moved from the top of the wrapper to immediately above thesumocode --no-sumo-tuiexec, so the bare-Pi--version/-vand--no-extensions/-nebranches no longer carry a marker that nothing in those processes reads. This addresses the OCR maintainability note from the prior round; the new inline comment states the invariant.
I re-ran the wrapper against a stub archive to confirm the routing: --version/-v and --no-extensions exec sumocode-pi with SUMOCODE_APP_HOST unset, and every other argv reaches sumocode --no-sumo-tui with SUMOCODE_APP_HOST=1. sh -n is clean, and no consumer of APP_HOST_ENV changed.
deepseek-flash | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta from 4baed371 to bcca51e8 — one commit, fix(install): require an executable bin/sumocode-pi — against the full 27-file diff.
bin/sumocode-pijoins the installer's executability check (install.sh): the loop now covers all three shipped binaries, matching the-frequired-file list, so a release wheresumocode-piexists but lost its exec bit fails at install with exit 65 instead of at the first--version/--no-extensionsrun. The earlier singlebin/sumocodecheck is already gone, and no caller depended on the two-entry loop.
deepseek-flash | 𝕏
roles.json prompts may span lines; continuation lines are now indented under their role bullet in the T3 guidance. Per OpenCodeReview on #618.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta from bcca51e8 to 9b7763d2 — one commit, fix(app-host): keep multi-line role prompts inside their bullet — against the full 27-file diff.
- Multi-line role prompts stay inside their bullet (
src/app-host.ts):buildT3RoleGuidancenow trimsrole.systemPromptand re-indents every continuation line two spaces (replace(/\r?\n/g, "\n ")), so an operator prompt authored across multiple lines no longer lets the following role bullets visually merge into the previous prompt's text. Two spaces matches the-content column, and both\nand\r\nare covered. - Test coverage (
src/app-host.test.ts): a new case feeds both line endings through one prompt and asserts the exact indented rendering, including that the bullet structure is preserved.
This addresses the OpenCodeReview maintainability note on src/app-host.ts:39; the author replied on that thread and it is resolved. CI=1 pnpm vitest run src/app-host.test.ts passes 7/7 locally, no prior pullfrog thread remains open, and the completed CI jobs at this head are green (typecheck + unit tests, pi-compat, resume p95 budget, visual-bible), with integration tests (node-pty) still running.
deepseek-flash | 𝕏


Summary
T3 Code, and other apps that launch
pithemselves, can now run SumoCode's bundled Pi. Pi under T3 sees T3's own tools plus the SumoCode tools that work there. The SumoCode shell and its Herdr integration are unchanged.The profile keys off the wrapper's marker, not T3's variables. T3 lists slash commands from a discovery process that has none of them, so keying on T3's env would show the composer a different command list than the chat session.
Pi 0.99.1 to 1.1.0 (
5a2c780f), in the same PR as asked:rpc-types.d.tsis byte-identical, and the compile-exhaustive RPC classification typechecks unchanged.args.jsadds the boolean--no-mcp. Both launcher tables list it, so it never consumes the prompt, and a new PTY row covers that.bun/entry files and Bedrock strip points are the same, and both binaries report 1.1.0.--tui-mode regular, and the changelog says how to keep regular mode.Evidence
pi0.87.1. Pointing it atsumocodefailed becausesumocode --versionprintssumocode 0.7.6, which T3 reads as Pi 0.7.6. With SumoCode's Pi, T3's composer listed 53 commands, including/reload,/exit,/login,/sumo:theme,/sumo:tabs, and/sumo:worktree. The prompt told the model to delegate with visiblesubagent_spawn, which fails under T3 with "visible subagents require a running terminal host".After: checked in T3 Code nightly
0.0.46-nightly.20261009, with the Pi provider pointed at this branch's archive:answer fast slate sumo:bootstrap sumo:memory sumo:ship sumo:sync.before_provider_requestprobe) has nosubagent_*tools. It hasquestion,terminal_*,slate_*, andmcp__t3-code__{orchestrator_capabilities,delegate_task,task_status}. The prompt has## SumoCode roles in T3 Codefollowed by T3's orchestration block.researchrole, Pi calledmcp__t3-code__delegate_task. T3 shows a child thread on providerpiwith modeldeepseek/deepseek-flash, the role's model fromroles.json.terminal_startwithcompletion: wakeended the turn. T3 opened run 2, "Background activity updated", and Pi repliedWOKE TERMINAL-WAKE-OK.5a2c780f, on Pi 1.1.0 (CI=1):pnpm exec tsc --noEmit✅ ·node scripts/check-tsc-budget.mjs✅ ·pnpm lint✅ ·node scripts/check-dependency-audit.mjs✅pnpm test:native: 109/109 ✅, 0 orphans.sumocode-pi --versionandsumocode-pi-cli --versionboth print1.1.0, andcodesign --verify --strictpasses on both binaries.pnpm test:integration: 45 files, 349 passed and 110 skipped ✅, 0 survivors across 175 process groups.scripts/smoke-pi-versions.sh --supported-matrix(pnpm 10.29.2, as CI):Pi compatibility contract 1.1.0: PASS,sumocode Pi compatibility 1.1.0: PASS✅pnpm test: the same 8 failing files and 29 tests asmainon this machine (git-worktree fixtures and timeouts).autoreview --mode local --engine codex --model gpt-6.1-sol --thinking xhigh --max-priority P1came back clean on every round: the feature (0.84), each review repair (0.9, 0.9, 0.99), and the Pi bump (0.87). Every OpenCodeReview and pullfrog thread is answered and resolved.Merge Danger
Door: two-way
Nothing changes unless
SUMOCODE_APP_HOST=1is set, and onlysumocode-pi-clisets it. Reverting removes the wrapper and the profile.Blast Radius: contained, plus a Pi major
sumocode,sc, the RPC host, the rpc-child profile, and the Herdr bridge take the same paths as before. The integration suite is green.install.shnow requiresbin/sumocode-pi-cli. The installer ships inside the same archive, so the two always match.subagent_*in favor ofdelegate_task. If T3's MCP bridge is off, SumoCode subagents stay.