Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.

Commit b97cdb0

Browse files
yysjasmineclaude
andcommitted
release: bump to 1.0.3 with chcp 65001 + WSL UTF-8 locale before agent exec
Fixes Chinese-input garbling when typing into hermes / openclaw gateway from the PowerShell window the Windows installer hands off to. Background: setting [Console]::OutputEncoding / InputEncoding to UTF-8 (done in wsl-common.ps1 previously) only affects the CURRENT PowerShell process. Child processes — cmd.exe, wsl.exe, and anything spawned from bash inside the distro — inherit the console's CODEPAGE, not .NET's Encoding property. On zh-CN hosts that codepage is still 936 (GBK), so keystrokes reach hermes as GBK bytes and the agent garbles them on the UTF-8 decode. Add Set-ConsoleUtf8CodePage (runs `chcp 65001` via cmd.exe) to wsl-common.ps1 and call it right before each `wsl.exe -- bash -lc ...` handoff in install-hermes.ps1 / install-openclaw.ps1. Also prepend LANG=C.UTF-8 LC_ALL=C.UTF-8 to the bash command so readline-based tools inside WSL read multibyte input correctly regardless of the distro's default locale. We don't call chcp at installer start because our own Write-Host output is already UTF-8-correct via the .NET Encoding setters; flipping the codepage that early would risk minor rendering inconsistencies during the long-running install. Version strings bumped in installer.iss, build-pkg.sh, and README tables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5ce8bcb commit b97cdb0

7 files changed

Lines changed: 51 additions & 14 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ Pre-built installers live on the [GitHub Releases page](https://github.com/Sense
8989

9090
| Platform | Download | How to Use |
9191
|----------|----------|------------|
92-
| Windows | [`AgentPack-1.0.2-windows-x64.exe`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.2-windows-x64.exe) | Double-click and follow the wizard; installation runs inside WSL2, and the PowerShell window is taken over by the installed agent when setup finishes |
93-
| macOS | [`AgentPack-1.0.2-macos-universal.pkg`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.2-macos-universal.pkg) | Double-click, then complete setup in the Terminal window that opens; the same window becomes the agent's REPL / gateway once installation finishes |
94-
| Linux | [`AgentPack-1.0.2-linux.sh`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.2-linux.sh) *or* the one-liner below | Download and run `chmod +x AgentPack-1.0.2-linux.sh && ./AgentPack-1.0.2-linux.sh`, or paste `curl -fsSL https://raw.githubusercontent.com/SenseTime-FVG/agent_pack/main/linux/install.sh \| bash` — either way the shell that ran the installer is handed over to the agent via `exec` |
92+
| Windows | [`AgentPack-1.0.3-windows-x64.exe`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.3-windows-x64.exe) | Double-click and follow the wizard; installation runs inside WSL2, and the PowerShell window is taken over by the installed agent when setup finishes |
93+
| macOS | [`AgentPack-1.0.3-macos-universal.pkg`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.3-macos-universal.pkg) | Double-click, then complete setup in the Terminal window that opens; the same window becomes the agent's REPL / gateway once installation finishes |
94+
| Linux | [`AgentPack-1.0.3-linux.sh`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.3-linux.sh) *or* the one-liner below | Download and run `chmod +x AgentPack-1.0.3-linux.sh && ./AgentPack-1.0.3-linux.sh`, or paste `curl -fsSL https://raw.githubusercontent.com/SenseTime-FVG/agent_pack/main/linux/install.sh \| bash` — either way the shell that ran the installer is handed over to the agent via `exec` |
9595

9696
## Building from Source
9797

@@ -104,7 +104,7 @@ cd windows
104104
iscc installer.iss
105105
```
106106

107-
Output: `dist/AgentPack-1.0.2-windows-x64.exe`
107+
Output: `dist/AgentPack-1.0.3-windows-x64.exe`
108108

109109
### macOS (.pkg)
110110

@@ -115,7 +115,7 @@ cd macos
115115
./build-pkg.sh
116116
```
117117

118-
Output: `dist/AgentPack-1.0.2-macos-universal.pkg`
118+
Output: `dist/AgentPack-1.0.3-macos-universal.pkg`
119119

120120
### Linux
121121

README.zh-CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Bundled skills 已经直接放进 `repos/hermes-agent/skills/` 和 `repos/opencl
8888

8989
| 平台 | 下载 | 使用方式 |
9090
|------|------|---------|
91-
| Windows | [`AgentPack-1.0.2-windows-x64.exe`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.2-windows-x64.exe) | 双击运行向导;安装过程在 WSL2 中执行,安装完成后当前 PowerShell 窗口会被接管,直接跑起 agent |
92-
| macOS | [`AgentPack-1.0.2-macos-universal.pkg`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.2-macos-universal.pkg) | 双击后在自动打开的 Terminal 窗口中完成安装;安装结束后同一个窗口会变成 agent 的 REPL / gateway |
93-
| Linux | [`AgentPack-1.0.2-linux.sh`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.2-linux.sh) 或下面的一行命令 | 下载后 `chmod +x AgentPack-1.0.2-linux.sh && ./AgentPack-1.0.2-linux.sh`,或直接粘贴 `curl -fsSL https://raw.githubusercontent.com/SenseTime-FVG/agent_pack/main/linux/install.sh \| bash` — 两种方式都会在安装结束后用 `exec` 在当前 shell 里拉起 agent |
91+
| Windows | [`AgentPack-1.0.3-windows-x64.exe`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.3-windows-x64.exe) | 双击运行向导;安装过程在 WSL2 中执行,安装完成后当前 PowerShell 窗口会被接管,直接跑起 agent |
92+
| macOS | [`AgentPack-1.0.3-macos-universal.pkg`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.3-macos-universal.pkg) | 双击后在自动打开的 Terminal 窗口中完成安装;安装结束后同一个窗口会变成 agent 的 REPL / gateway |
93+
| Linux | [`AgentPack-1.0.3-linux.sh`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.3-linux.sh) 或下面的一行命令 | 下载后 `chmod +x AgentPack-1.0.3-linux.sh && ./AgentPack-1.0.3-linux.sh`,或直接粘贴 `curl -fsSL https://raw.githubusercontent.com/SenseTime-FVG/agent_pack/main/linux/install.sh \| bash` — 两种方式都会在安装结束后用 `exec` 在当前 shell 里拉起 agent |
9494

9595
## 从源码构建
9696

@@ -103,7 +103,7 @@ cd windows
103103
iscc installer.iss
104104
```
105105

106-
产物:`dist/AgentPack-1.0.2-windows-x64.exe`
106+
产物:`dist/AgentPack-1.0.3-windows-x64.exe`
107107

108108
### macOS (.pkg)
109109

@@ -114,7 +114,7 @@ cd macos
114114
./build-pkg.sh
115115
```
116116

117-
产物:`dist/AgentPack-1.0.2-macos-universal.pkg`
117+
产物:`dist/AgentPack-1.0.3-macos-universal.pkg`
118118

119119
### Linux
120120

macos/build-pkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
99
BUILD_DIR="$SCRIPT_DIR/build"
1010
DIST_DIR="$PROJECT_ROOT/dist"
11-
VERSION="1.0.2"
11+
VERSION="1.0.3"
1212
SCRIPTS_DIR="$BUILD_DIR/scripts"
1313

1414
rm -rf "$BUILD_DIR"

windows/installer.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; Requires Inno Setup 6.x
33

44
#define MyAppName "Agent Pack"
5-
#define MyAppVersion "1.0.2"
5+
#define MyAppVersion "1.0.3"
66
#define MyAppPublisher "Agent Pack"
77
#define MyAppURL "https://github.com/SenseTime-FVG/agent_pack"
88

windows/scripts/install-hermes.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,13 @@ Set-Content -LiteralPath (Join-Path $markerDir "hermes-installed.marker") `
9393
Write-Host ""
9494
Write-Host "[OK] Hermes Agent installed. Starting hermes in this window..." -ForegroundColor Green
9595
Write-Host ""
96-
& wsl.exe -- bash -lc 'hermes'
96+
97+
# Switch the console codepage to UTF-8 before handing off, so Chinese
98+
# characters typed into the hermes REPL reach the agent as UTF-8 bytes
99+
# (not GBK) on zh-CN Windows hosts.
100+
Set-ConsoleUtf8CodePage
101+
102+
# Force a UTF-8 locale inside WSL for the hermes process. Some readline-
103+
# based REPLs misread multibyte input when LANG is unset or C, even with
104+
# the console codepage already set to 65001 on the Windows side.
105+
& wsl.exe -- bash -lc 'LANG=C.UTF-8 LC_ALL=C.UTF-8 hermes'

windows/scripts/install-openclaw.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,12 @@ Write-Host ""
118118
Write-Host "[OK] OpenClaw installed. Starting gateway in this window..." -ForegroundColor Green
119119
Write-Host "[*] Opening OpenClaw dashboard in your browser shortly..." -ForegroundColor Cyan
120120
Write-Host ""
121-
& wsl.exe -- bash -lc 'openclaw gateway --verbose'
121+
122+
# Switch the console codepage to UTF-8 before handing off, so log output
123+
# from openclaw (which emits UTF-8) renders correctly and any Chinese
124+
# typed in future `openclaw` subcommands reaches the gateway as UTF-8.
125+
Set-ConsoleUtf8CodePage
126+
127+
# Force a UTF-8 locale inside WSL so openclaw's log formatter and any
128+
# multibyte input forwarded into the gateway read as UTF-8.
129+
& wsl.exe -- bash -lc 'LANG=C.UTF-8 LC_ALL=C.UTF-8 openclaw gateway --verbose'

windows/scripts/wsl-common.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,26 @@ try {
1414
# ignore the failure rather than aborting the install.
1515
}
1616

17+
# Flip the whole console's codepage to UTF-8 (65001). Unlike the
18+
# [Console]::OutputEncoding setter above — which only affects text THIS
19+
# PowerShell process reads/writes — `chcp 65001` changes the codepage for
20+
# the console AS A WHOLE, which is what child processes (cmd.exe, wsl.exe,
21+
# and anything spawned from them) inherit. Without this, typing Chinese
22+
# into a `hermes` REPL that we exec via `wsl.exe -- bash -lc 'hermes'`
23+
# sends GBK bytes, which the agent decodes as UTF-8 and garbles.
24+
# Call this right before exec'ing the agent so our own Write-Host output
25+
# (already UTF-8) isn't affected while the installer is still speaking.
26+
function Set-ConsoleUtf8CodePage {
27+
# `chcp` is a cmd.exe builtin — shell out to cmd to avoid PowerShell
28+
# complaining that the command isn't a file. Swallow output: chcp
29+
# prints "Active code page: 65001" which is just noise for the user.
30+
try {
31+
& cmd.exe /c 'chcp 65001 >NUL 2>&1'
32+
} catch {
33+
# Ignore — at worst the user retains the system default codepage.
34+
}
35+
}
36+
1737
$script:RegionChecked = $false
1838
$script:IsChinaRegion = $false
1939

0 commit comments

Comments
 (0)