# Changelog

## v0.4.0 - 2026-06-01

### Fixed
- Deferred the plan-approval implementation kickoff until after Pi finishes settling the planning `agent_end` event, so choosing "Start implementation" automatically starts work again on current Pi releases.
- Persisted the accepted implementation plan as a branch-local custom session entry and re-injected it on every implementing turn, so compaction no longer has to preserve the exact plan text verbatim.
- Queued autonomous implementation kickoff/continuation messages through Pi's follow-up path while runs are still active, reducing `Cannot continue from message role: assistant` failures after compaction/retry.
- Auto-continued capped `stopReason=length` implementation runs so long responses do not silently stall until the user nudges Pi.
- Added a max-output rescue ladder for implementation mode so `response.incomplete reason=max_output_tokens` can automatically retry with lower reasoning effort before falling back to a rung bump.

### Changed
- Updated Pi extension imports and documentation references for the `@earendil-works` package/repository namespace.
- Updated the gitignored local `pi-mono/` reference clone to track `git@github.com:earendil-works/pi.git`.
- Added context-aware rung fallback so the extension can step forward to a later ladder rung with enough registered context headroom before sending the next provider request.
- Updated `models.example.json` to match the default ladder, use current `$ENV_VAR` config syntax, and advertise a conservative 375k context window for the larger-context fallback rungs.
- Documented the accepted-plan persistence/injection path in the README so compaction behavior and restore semantics are clear.
- Documented the new max-output rescue path and the proxy error-text requirement for `response.incomplete reason=max_output_tokens` detection.

### Added
- Added interactive plan-clarification questions for interactive/RPC plan mode via an extension-managed tool that can collect structured answers before the final plan.
- Kept the plan-clarification tool out of headless/no-UI sessions so CLI planning falls back to plain-text clarification or conservative assumptions.
- Added an entrypoint smoke test so package-scope/import regressions fail under `npm test`.

## v0.3.2 - 2026-05-13

### Changed
- README install docs now lead with the published npm package (`pi install npm:pi-model-staging`) instead of GitHub tag installs.
- Added package management guidance for `pi list`, `pi update`, `pi remove`, and `pi config`.
- Added migration guidance for users switching from older git/local installs to the npm package to avoid duplicate commands.
- Kept GitHub tag installs and local clone/symlink workflows documented as alternatives for source-based usage and development.

## v0.3.1 - 2026-05-13

### Changed
- `/stepdown` now shows the resolved provider/config ladder and current cursor even when idle.
- `/stepdown` now reports the currently loaded session config, including tool lists, prompt-cache settings, web-search settings, and missing provider-registry models.
- README command/docs updated to describe the always-available `/stepdown` behavior and the `/reload`/restart requirement after config edits.

## v0.3.0 - 2026-05-13

### Added
- Opt-in headless auto-approval: `--plan-auto-approve` starts in plan mode and automatically transitions to implementation after planning.
- Per-user and per-project stepdown configuration via JSON:
  - `~/.pi/agent/plan-stepdown.json` (global)
  - `.pi/plan-stepdown.json` (project override)
  - `--stepdown-config <path>` (one-off override)
- Config parsing/merge tests.

### Changed
- Default provider is now `openai` with a built-in ladder: `gpt-5.5` → `gpt-5.4` (xhigh/high/medium) → `gpt-5.4-mini`.
- Documentation updated to prefer JSON configuration over editing the extension source.

## v0.2.0 - 2026-05-04

### Added
- One-shot reasoning bumps in implementation mode after failed tools, failed bash commands, or package-manager commands (`npm`, `pnpm`, `yarn`, `bun`).
- OpenAI Responses native `web_search` injection with per-rung `search_context_size`, opt-outs, and approximate country/timezone location bias.
- OpenAI prompt-cache hints: stable `prompt_cache_key` derived from local username + cwd and optional `prompt_cache_retention: "24h"`.
- More complete unit coverage, including prompt cache, web search, reasoning bumps, and end-to-end lifecycle simulations.

### Changed
- Renamed the user-facing phase language from “execute” to “implement”.
- Expanded the default ladder to six rungs and documented the defaults used by the extension.
- Improved plan/implementation prompts and README install guidance with pinned git refs.

### Notes
- All rungs still must live on the same provider; model changes are applied via provider payload rewriting.
- If you customized the previous `EXEC_*` constants, migrate those local edits to `IMPL_TOOLS` and `IMPL_FIRST_PROMPT`.

## v0.1.0 - 2026-05-04

- Initial release of `pi-model-staging` with `/plan`, `/stepdown`, `/stepdown-off`, single-provider model ladder stepping, and payload-level model/reasoning rewriting.
