@ai-sdk/harness-pi 1.0.170 Refactors Session and Sandbox Handling
The latest release of @ai-sdk/harness-pi changes how session state and sandbox paths are managed, improving performance and functionality. Developers using previous session state formats will need to migrate to prevent loss of conversation history.
What changed?
@ai-sdk/harness-pi 1.0.170 introduces multiple refactors. Most notably, session start no longer pre-resolves sandbox HOME or denied roots for the fileToolPathPolicy—these are now resolved on first use. The harness no longer copies the sandbox workspace to the host, nor does it patch Node's fs module. Instead, necessary skills and denied roots are checked only when accessed by a native file tool or when writing is required.
Project context is no longer inferred from AGENTS.md, CLAUDE.md, or project skills inside the workspace. Instead, project context should be provided in the instructions. The lifecycle data format now maintains the conversation history and session state in memory and supports restoring sessions from recorded entries. The new release can store sessions in an optional external sessionStorage. The sessionFileName property has been removed.
Breaking change: Sessions persisted using the old sessionFileName property will not restore conversation history when resuming after upgrade. Those sessions resume fresh, and any pending tool batch is dropped.
Why does it matter to an everyday developer?
Session startup performance is improved because sandbox paths are resolved only when needed. Session state handling is more robust, keeping conversation history across tool set changes and enabling resumable workflows via external sessionStorage. Developers integrating AI agent skills or project context must now provide that context directly, not via files in the workspace, which simplifies and clarifies project configuration.
Developers who suspend and resume sessions across the upgrade risk losing conversation history unless they migrate to the new state format. There is no automatic migration for previous sessionFileName-based states.
What can the developer do now?
- Update to @ai-sdk/harness-pi 1.0.170 to access improved session and sandbox handling.
