MendCode v0.1.21 is a reliability, interruption-recovery, and customization release. It adds project-owned prompt context and custom tool documentation, makes prompt/runtime state consistent across execution paths, protects active sessions during cancellation and reconnects, preserves useful media through compaction, and refreshes setup and customization guidance. This release contains the cumulative TUI, runtime, memory, Loop Workflow, setup, package, installer, documentation, security, and release-automation updates accumulated since v0.1.20.
Highlights
- Project-local and package-shared prompt customization with bounded, root-safe loading and visible origin/status information.
- Safer session interruption and recovery: explicit user cancellation is distinguished from connection loss, queued work cannot restart from stale notifications, and recovered terminal state reconciles with pending questions and permissions.
- Shell execution now bounds cancellation cleanup, reports timeout or connection-loss results as unknown, preserves partial output, and gives safe retry guidance without encouraging blind repetition of destructive commands.
- More stable TUI transcript scrolling, paging, compaction boundaries, assistant continuations, prompt ownership, and compacted tool-call presentation.
- Vision-aware compaction media retention and Codex ChatGPT OAuth Responses Lite affinity rotation when effective prompt instructions change.
Added
- A project-local custom Prompt Context mode backed by .mendcode/prompts/custom.md, including optional frontmatter names, bounded loading, UTF-8 normalization, project-root safety checks, and fallback diagnostics.
- Package-shared custom prompt support through runtime packs without leaking a local project prompt into another project.
- mendcode prompt inspection, build, and mode commands, with setup/status/TUI/runtime-plan visibility for prompt origin, name, path, byte count, and fallback state.
- Public custom tool-call documentation covering project-local and package-shared tools, typed arguments, execution context, metadata, permission checks, abort handling, and package distribution.
- Regression coverage for custom prompt parsing, package resolution, prompt snapshots, interruption recovery, reconnect synchronization, compaction media, OAuth affinity, transcript ordering, and shell retry metadata.
Changed
- Prompt context is resolved from the active project root and carried as one snapshot through streaming and token estimation.
- Custom prompt metadata stays out of provider instructions while a readable project-defined label is exposed in setup and the TUI.
- Prompt-status scripts run through a Bash-compatible shell, and the public prompt route is exposed from the installed CLI.
- Session scroll positions and anchors remain stable across transcript growth, paging, compaction, route remounts, and later assistant continuations.
- Local shared-server fingerprints refresh from source metadata so TypeScript changes do not reuse stale runtime processes.
Fixed
- Manual Esc cancellation can no longer be undone by late background-task owner-wake notifications or stale prompt deliveries.
- Pending prompt deliveries are cancelled during interruption and concurrent abort requests are coalesced.
- Hidden prompt input no longer remains mounted while a question or permission prompt owns session input.
- Worker-backed terminal recovery now reconciles session state, pending questions, and permissions after system sleep or reconnect.
- Queued session work no longer restarts after explicit cancellation.
Verification
- Local TypeScript validation: bun typecheck from src/mendcode/packages/opencode.
- Focused regression validation: 155 tests passed, 0 failed across the prompt, shell, interruption, session initialization, and session prompt suites.
- CLI smoke validation: mend --version returned 0.1.21; mend --help completed successfully.
- Release dry run 30509944842 passed Linux/Windows and both native Darwin builds, the complete 12-archive asset contract, checksums, release manifest, SBOM generation, and build provenance attestations.
- Required repository checks passed, including CodeQL, dependency review, repository guards, and deep security scanners.