AI News
All stories
Official

Pi 1.7.0 lets compatible terminals reopen sessions after a restart

Pi 1.7.0 adds terminal session resume, so compatible terminals can reopen the current session with its original profile, tool restrictions and instructions.

Products · · 2 min read

Pi 1.7.0 lets terminals that support the Program Resume Protocol reopen the current pi session after a restart, restoring its original profile, tool restrictions and instructions. The feature uses OSC 7577, a terminal escape sequence. When a terminal sets an OSC7577_TOKEN environment variable, pi's interactive mode reports a command in the form pi --session <id> for the running session, and the terminal can run that command later to bring the session back. Pi removes the token from the environment of every process it starts.

The risk lies in what the reported command carries. A bare session ID would reopen the conversation but not the way it was configured. According to the release notes, the resume command now repeats the restriction and resource flags pi was started with, including --tools, --no-extensions, -e, --skill and --system-prompt, exactly as they were typed. Without this, a terminal could resume a session with different tools or instructions, and possibly more access, than the original run had. The printed command on exit is unchanged, so the repeated flags appear only in the OSC 7577 report. The notes also say a terminal must trust each flag combination, as described under Terminal setup.

A second addition, --agent-dir, fixes a gap in the same path. The configuration directory can be set with the PI_CODING_AGENT_DIR environment variable. The notes say a session started that way came back with the default directory's settings and auth, because the terminal runs the resume command without the environment pi was started in. The new flag is the command-line form of that variable, and the resume command includes it whenever the config directory is not ~/.pi/agent. The notes describe the intended use as setups that keep a separate pi profile per project, such as a shell function that sets PI_CODING_AGENT_DIR for one directory tree. They also say terminals that resume programs, naming Rex as an example, need a rule that trusts the longer command.

Other changes concern model providers and fixes, and the notes list them without tying them to the resume feature. Cloudflare Workers AI's default model moves to @cf/zai-org/glm-5.3 because Cloudflare deprecated Kimi K2.6 and K2.7 Code, and the ant-ling default changes from Ring-2.6-1T to Ling-3.1-flash. Codemode gains image generation with Radius, and OpenRouter image models can now take an aspect ratio and size. The notes say codemode image generation previously reported success for failed OpenRouter responses, and that this is now fixed. Pi 1.7.0 also removes telemetry reporting for new installs and updates, including the /api/report-install call, the enableInstallTelemetry setting and PI_TELEMETRY. The notes list that removal under Breaking Changes.

What changed

Pi 1.7.0 lets compatible terminals reopen the current pi session after a restart, and the resume command now repeats the --tools, --no-extensions, -e, --skill and --system-prompt flags the session was started with.

Type: New capability · Applies to: Pi 1.7.0, OSC 7577, --agent-dir

Why it matters

Teams that run agents in terminals must set trust rules for each resume command, because a resumed session can carry different tools or instructions.

What you can do

Review terminal trust rules before enabling session resume for agent sessions that have elevated tool access.

Original source

Where we saw it

1 source

Pi releases

AI wrote this summary from the sources listed, and nobody reviewed it individually before publication. Check the original source before you rely on it. How it works