The best way to control Claude Code, Codex and more from any computer or phone
fix(pi): support persisted sessions in RPC launch (#21511)
Co-authored-by: Julian Rustig <jruestig@posteo.de>
Julius Marminge committed
Oct 19, 2026 at 16:18 UTC
6f8d69271c4ce307ecb7d80ece46788e563a3d9a
2 files changed
+7
-1
packages/provider-pi/src/server/mcpInjection.test.ts
+1
@@ -121,6 +121,7 @@ describe("pi T3 MCP injection", () => {
121
environment: {},
122
mcpSession,
123
extensionPath: "/tmp/cache/pi-t3-mcp-extension.ts",
124
+ sessionPath: "/fake/persisted.jsonl",
125
ephemeral: true,
126
disableExtensions: true,
127
disableTools: true,
packages/provider-pi/src/server/mcpInjection.ts
+6
-1
@@ -245,6 +245,7 @@ export function buildPiRpcLaunch(input: {
245
readonly environment: NodeJS.ProcessEnv;
246
readonly mcpSession: McpProviderSessionConfig | undefined;
247
readonly extensionPath: string | undefined;
248
+ readonly sessionPath?: string | undefined;
249
readonly ephemeral?: boolean;
250
readonly disableExtensions?: boolean;
251
readonly disableTools?: boolean;
@@ -265,7 +266,11 @@ export function buildPiRpcLaunch(input: {
266
const args = [
267
"--mode",
268
"rpc",
268
- ...(input.ephemeral === true ? ["--no-session"] : []),
269
+ ...(input.ephemeral === true
270
+ ? ["--no-session"]
271
+ : input.sessionPath !== undefined
272
+ ? ["--session", input.sessionPath]
273
+ : []),
274
...launchArgs,
275
// Restrictions follow user launch args so a configured --tools or
276
// --extension cannot silently re-enable unattended text-generation code.