# Pi v0.82.0: constrained tool sampling, OpenRouter and Kimi Code OAuth sign-in, session-aware bash

> Pi adds constrained sampling for tools with strict JSON Schema, OpenAI Lark, and regex grammar support across OpenAI, Anthropic, Bedrock, Gemini, and Mistral providers. OpenRouter and Kimi Code subscriptions can now be authorized via `/login` without manual API key configuration. Bash tools receive session metadata (PI_SESSION_ID, PI_PROVIDER, PI_MODEL, etc.), and RPC bash commands stream real-time execution events.

| | |
|---|---|
| **Tool** | Pi |
| **Version** | v0.82.0 |
| **Kind** | release |
| **Published** | 2026-07-24 |
| **Observed** | 2026-08-21 |
| **Significance** | 4/5 |
| **Breaking** | no |
| **Categories** | feature, capability, model-support |

## What changed


- **Constrained tool sampling**: `Tool.constrainedSampling` supports `prefer`/`require` strict JSON Schema, OpenAI Lark, and regex grammars. Model capability metadata (`supportsGrammarTools`, `supportsStrictTools`) gates unsupported requests.
- **OpenRouter OAuth PKCE login**: `/login` mints a user-controlled API key
- **Kimi Code OAuth login**: device authorization flow for the Kimi For Coding provider with automatic token refresh
- **Session-aware bash**: `PI_SESSION_ID`, `PI_SESSION_FILE`, `PI_PROVIDER`, `PI_MODEL`, `PI_REASONING_LEVEL` exposed to bash tool commands
- **Streaming bash events**: `bash_execution_update` events for RPC bash, correlated with request IDs
- **Model catalog**: only provider-verified reasoning effort levels from models.dev are exposed
- **Fixes**: DNS failures trigger automatic retries; OpenRouter Anthropic cache breakpoints advance through tool results; Codex WebSocket retries after `previous_response_not_found`; TUI debug logs respect custom agent directories; Ctrl+G external-editor startup slow with many temp dir entries fixed; startup resource display preserves relative sibling paths; compaction/branch-summary use fresh routing session IDs; llama.cpp models use loaded context window as output limit (no 16K cap); fresh installs prefer remote catalogs over bundled; editor scroll indicators don't overflow narrow terminals


## Sources

- [github_release](https://github.com/earendil-works/pi/releases/tag/v0.82.0) — retrieved 2026-08-21


## Community

_No curated reactions recorded. Facts and community takes are kept in separate layers
and never blended._

---
Canonical: https://changelogs.info/pi/v0-82-0
Entity: https://changelogs.info/pi
Event ID: `evt_2026-07-24_pi_v0-82-0`
Licence: event synthesis © changelogs.info, CC BY 4.0. Linked sources belong to their vendors.
