Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.1.39 - 2026-08-26

MendCode v0.1.39 makes interruption reliable across folders and recovers legacy installs without disrupting active sessions.

### Changed

- Route session controls through the owning workspace or directory instead of the currently selected project.
- Keep the global `Esc` interrupt available when the editor, transcript, or another TUI widget owns focus.
- Preserve explicit backend and provider retry state while their live heartbeat is still fresh.

### Fixed

- Fall back from a stale targeted cancellation to a bounded `session.abort` without leaving large or old sessions running indefinitely.
- Prevent cancellation outbox entries captured under an old route from replaying into another backend.
- Update Windows installations through the native PowerShell path instead of assuming WSL `/bin/bash` exists.
- Reconcile legacy SQLite migration journals transactionally when the existing schema is already present.

### Tests

- Run focused session-control, prompt, runner, installation, database-migration, workspace-routing, build, and startup smoke checks.

## 0.1.38 - 2026-08-25

MendCode v0.1.38 hardens Smart Approval and keeps long-running sessions truthful during retries, reconnects, and large TUI turns.
Expand Down
2 changes: 1 addition & 1 deletion docs/mermaid-ascii-rendering.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mermaid ASCII Rendering

MendCode renders Mermaid fences as local, terminal-native ASCII diagrams in Markdown and rich chat presentation modes. The renderer keeps diagram semantics visible without requiring a browser, SVG canvas, or network request. This page reflects the current v0.1.38 behavior; it is documentation-only and does not require a version bump.
MendCode renders Mermaid fences as local, terminal-native ASCII diagrams in Markdown and rich chat presentation modes. The renderer keeps diagram semantics visible without requiring a browser, SVG canvas, or network request. This page reflects the current v0.1.39 behavior.

## Chat Canvas Behavior

Expand Down
17 changes: 17 additions & 0 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ Windows users who cannot run PowerShell can use `src/mendcode/install.cmd`.
It uses the Windows-provided `curl.exe` and `tar.exe` tools and installs the
baseline x64 asset (or the ARM64 asset) without requiring a PowerShell command.

On Windows, the supported installer and in-app updater use native PowerShell;
they never invoke the WSL `bash.exe` launcher. This matters on machines where
WSL is installed incompletely or has no Linux distribution. To recover an old
installation whose updater still reports `WSL ... execvpe(/bin/bash)`, run the
native installer once from PowerShell:

```powershell
$script = Join-Path $env:TEMP "mendcode-install.ps1"
Invoke-WebRequest "https://raw.githubusercontent.com/MendCode/MendCode/main/src/mendcode/install.ps1" -OutFile $script
powershell.exe -NoProfile -ExecutionPolicy Bypass -File $script -SkipSetup
```

The installer updates only `~\.mendcode\bin\mendcode.exe`; it does not delete
the MendCode/OpenCode data directory or existing sessions. Newer binaries
schedule the replacement after the running process exits, avoiding Windows
executable file locks.

The release must include these assets:

```text
Expand Down
56 changes: 55 additions & 1 deletion src/mendcode/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ param(
[string]$Version = $env:VERSION,
[switch]$NoModifyPath,
[switch]$Setup,
[switch]$SkipSetup
[switch]$SkipSetup,
[int]$WaitForExitPid = 0
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -76,6 +77,52 @@ function Write-SetupCommand {
Write-Host ('Setup later: $env:OPENCODE_ROUTE=''{"type":"setup"}''; & "' + $binary + '"') -ForegroundColor DarkGray
}

function Wait-MendCodeProcessExit {
param([int]$ProcessId)

if ($ProcessId -le 0) { return }
while (Get-Process -Id $ProcessId -ErrorAction SilentlyContinue) {
Start-Sleep -Milliseconds 250
}
}

function Start-DeferredUpdate {
if ($env:MENDCODE_UPDATE_WORKER -eq "1") { return $false }
if (-not $env:MENDCODE_UPDATE_PARENT_PID) { return $false }

[int]$parentPid = 0
if (-not [int]::TryParse($env:MENDCODE_UPDATE_PARENT_PID, [ref]$parentPid) -or $parentPid -le 0) {
throw "MendCode could not schedule the Windows updater: invalid parent process id."
}

$shell = Get-Command powershell.exe -ErrorAction SilentlyContinue
if (-not $shell) { $shell = Get-Command pwsh.exe -ErrorAction SilentlyContinue }
if (-not $shell) {
throw "MendCode could not schedule the Windows updater because PowerShell is unavailable."
}

$workerArguments = [System.Collections.Generic.List[string]]::new()
$workerArguments.Add("-NoProfile")
$workerArguments.Add("-NonInteractive")
$workerArguments.Add("-ExecutionPolicy")
$workerArguments.Add("Bypass")
$workerArguments.Add("-File")
$workerArguments.Add('"' + $PSCommandPath + '"')
if ($Version) {
$workerArguments.Add("-Version")
$workerArguments.Add($Version)
}
if ($NoModifyPath) { $workerArguments.Add("-NoModifyPath") }
$workerArguments.Add("-SkipSetup")
$workerArguments.Add("-WaitForExitPid")
$workerArguments.Add($parentPid.ToString())

$env:MENDCODE_UPDATE_WORKER = "1"
Start-Process -FilePath $shell.Source -ArgumentList $workerArguments -WindowStyle Hidden | Out-Null
Write-Host "Update scheduled; it will finish after MendCode closes." -ForegroundColor DarkGreen
return $true
}

function Maybe-LaunchSetup {
if ($SetupMode -eq "skip") {
Write-SetupCommand
Expand Down Expand Up @@ -180,6 +227,9 @@ if (-not [System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform([Syst
throw "install.ps1 is for Windows. On macOS or Linux, run: curl -fsSL https://raw.githubusercontent.com/MendCode/MendCode/main/src/mendcode/install | bash"
}

if (Start-DeferredUpdate) { exit 0 }
Wait-MendCodeProcessExit -ProcessId $WaitForExitPid

New-Item -ItemType Directory -Force $InstallDir | Out-Null

$target = Get-MendCodeTarget
Expand Down Expand Up @@ -234,3 +284,7 @@ Write-Host " $(Join-Path $InstallDir "mendcode.exe") # run now in this termina
Write-Host ""
Write-Host "Open a new terminal to use: mendcode"
Maybe-LaunchSetup

if ($env:MENDCODE_UPDATE_SCRIPT_PATH -and (Test-Path $env:MENDCODE_UPDATE_SCRIPT_PATH)) {
Remove-Item -Force $env:MENDCODE_UPDATE_SCRIPT_PATH -ErrorAction SilentlyContinue
}
12 changes: 6 additions & 6 deletions src/mendcode/packages/extensions/zed/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id = "mendcode"
name = "MendCode"
description = "The open source coding agent."
version = "0.1.38"
version = "0.1.39"
schema_version = 1
authors = ["MendCode"]
repository = "https://github.com/MendCode/MendCode"
Expand All @@ -11,26 +11,26 @@ name = "MendCode"
icon = "./icons/opencode.svg"

[agent_servers.mendcode.targets.darwin-aarch64]
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.38/mendcode-darwin-arm64.zip"
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.39/mendcode-darwin-arm64.zip"
cmd = "./mendcode"
args = ["acp"]

[agent_servers.mendcode.targets.darwin-x86_64]
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.38/mendcode-darwin-x64.zip"
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.39/mendcode-darwin-x64.zip"
cmd = "./mendcode"
args = ["acp"]

[agent_servers.mendcode.targets.linux-aarch64]
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.38/mendcode-linux-arm64.tar.gz"
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.39/mendcode-linux-arm64.tar.gz"
cmd = "./mendcode"
args = ["acp"]

[agent_servers.mendcode.targets.linux-x86_64]
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.38/mendcode-linux-x64.tar.gz"
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.39/mendcode-linux-x64.tar.gz"
cmd = "./mendcode"
args = ["acp"]

[agent_servers.mendcode.targets.windows-x86_64]
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.38/mendcode-windows-x64.zip"
archive = "https://github.com/MendCode/MendCode/releases/download/v0.1.39/mendcode-windows-x64.zip"
cmd = "./mendcode.exe"
args = ["acp"]
2 changes: 1 addition & 1 deletion src/mendcode/packages/opencode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "0.1.38",
"version": "0.1.39",
"name": "mendcode",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/mendcode/packages/opencode/script/dev-rearm-smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createServer, type IncomingMessage, type ServerResponse } from "node:ht
import { once } from "node:events"
import { probeRuntime } from "./dev-rearm"

const VERSION = "0.1.38"
const VERSION = "0.1.39"
const PROJECT = "/tmp/mendcode-dev-rearm-smoke-project"

function assert(condition: unknown, message: string): asserts condition {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ function init() {
})

const result = {
trigger(name: string) {
trigger(name: string, options?: { bypassEnabled?: boolean }) {
for (const option of entries()) {
if (option.value === name) {
if (!isEnabled(option)) return
if (!options?.bypassEnabled && !isEnabled(option)) return
option.onSelect?.(dialog)
return
}
Expand Down
Loading
Loading