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

Commit 5ce8bcb

Browse files
yysjasmineclaude
andcommitted
release: bump to 1.0.2 with UTF-8 PS console + verbose verify errors
Ships v1.0.2 with two UX-level fixes plus the version-bump housekeeping: - windows/scripts/wsl-common.ps1: force console I/O to UTF-8 (cp65001) at dot-source time. Windows PowerShell 5.x defaults to GBK (936) on zh-CN hosts, which mangled the Chinese strings in install-*.ps1 logs and corrupted stdout captured from WSL commands. Applied in the shared file so every install-*.ps1 entry point inherits it via the existing `. wsl-common.ps1` line. - windows/installer.iss: the wizard's Verify button used to collapse every failure mode into "Verification failed. You can configure later." — same message for "no host Python", "401 Unauthorized", "unknown model", "DNS failure". Now capture stdout+stderr of both the host-python and WSL-python3 attempts into %TEMP%\agent-pack- verify.log and show the tail in an MsgBox so the user can actually see which one failed and why (with the full log path included for triage). Version strings bumped in installer.iss, build-pkg.sh, and the README download tables / build-from-source outputs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 798e8b9 commit 5ce8bcb

5 files changed

Lines changed: 98 additions & 24 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.1-windows-x64.exe`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.1-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.1-macos-universal.pkg`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.1-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.1-linux.sh`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.1-linux.sh) *or* the one-liner below | Download and run `chmod +x AgentPack-1.0.1-linux.sh && ./AgentPack-1.0.1-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.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` |
9595

9696
## Building from Source
9797

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

107-
Output: `dist/AgentPack-1.0.1-windows-x64.exe`
107+
Output: `dist/AgentPack-1.0.2-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.1-macos-universal.pkg`
118+
Output: `dist/AgentPack-1.0.2-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.1-windows-x64.exe`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.1-windows-x64.exe) | 双击运行向导;安装过程在 WSL2 中执行,安装完成后当前 PowerShell 窗口会被接管,直接跑起 agent |
92-
| macOS | [`AgentPack-1.0.1-macos-universal.pkg`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.1-macos-universal.pkg) | 双击后在自动打开的 Terminal 窗口中完成安装;安装结束后同一个窗口会变成 agent 的 REPL / gateway |
93-
| Linux | [`AgentPack-1.0.1-linux.sh`](https://github.com/SenseTime-FVG/agent_pack/releases/latest/download/AgentPack-1.0.1-linux.sh) 或下面的一行命令 | 下载后 `chmod +x AgentPack-1.0.1-linux.sh && ./AgentPack-1.0.1-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.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 |
9494

9595
## 从源码构建
9696

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

106-
产物:`dist/AgentPack-1.0.1-windows-x64.exe`
106+
产物:`dist/AgentPack-1.0.2-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.1-macos-universal.pkg`
117+
产物:`dist/AgentPack-1.0.2-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.1"
11+
VERSION="1.0.2"
1212
SCRIPTS_DIR="$BUILD_DIR/scripts"
1313

1414
rm -rf "$BUILD_DIR"

windows/installer.iss

Lines changed: 72 additions & 13 deletions
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.1"
5+
#define MyAppVersion "1.0.2"
66
#define MyAppPublisher "Agent Pack"
77
#define MyAppURL "https://github.com/SenseTime-FVG/agent_pack"
88

@@ -271,15 +271,53 @@ begin
271271
Result := Args;
272272
end;
273273
274-
// Try to run verify-llm.py through the host's Python. Returns True iff the
275-
// process launched AND exited 0. Any other combination (Python not found,
276-
// API failure, etc.) returns False so the caller can fall through to WSL.
277-
function TryVerifyViaHostPython(const ScriptPath, Args: String): Boolean;
274+
// Read up to MaxBytes of LogPath; return a trimmed string. Used to grab the
275+
// stdout+stderr of the verify step so we can show the user the actual error
276+
// (Python not found, 401, unknown model, ...) instead of a blanket "failed".
277+
function ReadLogTail(const LogPath: String; MaxBytes: Integer): String;
278+
var
279+
Lines: TArrayOfString;
280+
i, StartIdx: Integer;
281+
Body: String;
282+
begin
283+
Result := '';
284+
if not FileExists(LogPath) then begin
285+
Exit;
286+
end;
287+
if not LoadStringsFromFile(LogPath, Lines) then begin
288+
Exit;
289+
end;
290+
// Show the last ~20 lines — enough for a python traceback + the
291+
// "ERROR: <urllib.error ...>" line that verify-llm.py emits.
292+
StartIdx := GetArrayLength(Lines) - 20;
293+
if StartIdx < 0 then StartIdx := 0;
294+
Body := '';
295+
for i := StartIdx to GetArrayLength(Lines) - 1 do begin
296+
Body := Body + Lines[i] + #13#10;
297+
end;
298+
if Length(Body) > MaxBytes then begin
299+
Body := Copy(Body, Length(Body) - MaxBytes + 1, MaxBytes);
300+
end;
301+
Result := Trim(Body);
302+
end;
303+
304+
// Try to run verify-llm.py through the host's Python. Captures combined
305+
// stdout+stderr into LogPath (caller-provided) so we can report the actual
306+
// error back to the user on failure. Returns True iff the process launched
307+
// AND exited 0. Any other combination (Python not found, API failure, etc.)
308+
// returns False so the caller can fall through to WSL.
309+
function TryVerifyViaHostPython(const ScriptPath, Args, LogPath: String): Boolean;
278310
var
279311
ResultCode: Integer;
280312
FullCmd: String;
281313
begin
282-
FullCmd := '/c python "' + ScriptPath + '"' + Args;
314+
// Prepend a marker line so the user can see which backend the message
315+
// came from when the log bubbles up in the error dialog.
316+
SaveStringToFile(LogPath, '=== host python ===' + #13#10, False);
317+
// `>> ... 2>&1` appends both streams; the marker line above becomes
318+
// the first entry of the log for this backend.
319+
FullCmd := '/c python "' + ScriptPath + '"' + Args
320+
+ ' >> "' + LogPath + '" 2>&1';
283321
Result := Exec('cmd.exe', FullCmd, '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
284322
and (ResultCode = 0);
285323
end;
@@ -306,12 +344,14 @@ end;
306344
// Fallback: run verify-llm.py through WSL's python3. Every Windows install
307345
// target already has WSL2 + a distro set up (Agent Pack requires it), so
308346
// python3 is reliably available there even when the user hasn't installed
309-
// Python on the Windows host. Returns True iff wsl.exe ran AND exited 0.
310-
function TryVerifyViaWsl(const ScriptPath, Args: String): Boolean;
347+
// Python on the Windows host. Captures combined stdout+stderr into LogPath.
348+
// Returns True iff wsl.exe ran AND exited 0.
349+
function TryVerifyViaWsl(const ScriptPath, Args, LogPath: String): Boolean;
311350
var
312351
ResultCode: Integer;
313352
WslPath, BashCmd, Cmd: String;
314353
begin
354+
SaveStringToFile(LogPath, #13#10 + '=== WSL python3 ===' + #13#10, True);
315355
// wslpath -a converts C:\foo\bar.py → /mnt/c/foo/bar.py; easier to shell
316356
// the conversion out than to translate path separators ourselves.
317357
// We wrap the full bash program in single quotes and escape any ' inside
@@ -320,19 +360,23 @@ begin
320360
WslPath := ExpandConstant('{app}') + '\shared\verify-llm.py';
321361
BashCmd := 'python3 "$(wslpath -a "' + WslPath + '")"'
322362
+ BashSingleQuoteEscape(Args);
323-
Cmd := '/c wsl.exe -- bash -lc ''' + BashCmd + '''';
363+
Cmd := '/c wsl.exe -- bash -lc ''' + BashCmd + ''' >> "' + LogPath + '" 2>&1';
324364
Result := Exec('cmd.exe', Cmd, '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
325365
and (ResultCode = 0);
326366
end;
327367
328368
procedure OnVerifyClick(Sender: TObject);
329369
var
330-
ScriptPath, Args, Provider: String;
370+
ScriptPath, Args, Provider, LogPath, LogTail, Dialog: String;
331371
Ok: Boolean;
332372
begin
333373
Provider := GetProviderName(GetSelectedProviderIndex);
334374
ScriptPath := ExpandConstant('{app}') + '\shared\verify-llm.py';
335375
Args := BuildVerifyArgs(Provider);
376+
// Redirect both attempts' stdout+stderr to one log so we can replay the
377+
// full story in the error dialog. Lives in %TEMP% so it doesn't leak
378+
// the API key beyond this session (deleted on logoff with the rest).
379+
LogPath := ExpandConstant('{tmp}') + '\agent-pack-verify.log';
336380
337381
VerifyLabel.Caption := 'Verifying...';
338382
VerifyLabel.Font.Color := clBlue;
@@ -341,17 +385,32 @@ begin
341385
// ANY reason — missing python.exe, network error, bad key, wrong model —
342386
// fall through to WSL. That way a teammate without Windows Python still
343387
// gets a real verification against the API rather than a false "failed".
344-
Ok := TryVerifyViaHostPython(ScriptPath, Args);
388+
Ok := TryVerifyViaHostPython(ScriptPath, Args, LogPath);
345389
if not Ok then begin
346-
Ok := TryVerifyViaWsl(ScriptPath, Args);
390+
Ok := TryVerifyViaWsl(ScriptPath, Args, LogPath);
347391
end;
348392
349393
if Ok then begin
350394
VerifyLabel.Caption := 'Connection verified!';
351395
VerifyLabel.Font.Color := clGreen;
352396
end else begin
353-
VerifyLabel.Caption := 'Verification failed. You can configure later.';
397+
VerifyLabel.Caption := 'Verification failed. Click Verify for details.';
354398
VerifyLabel.Font.Color := clRed;
399+
// Show the actual error in a dialog. Common cases:
400+
// - "'python' is not recognized..." → no host Python (fell through
401+
// to WSL, which also failed — usually because WSL isn't set up yet)
402+
// - "ERROR: HTTP Error 401: Unauthorized" → wrong API key
403+
// - "ERROR: Unknown model ..." → typo in model id
404+
// - "ERROR: <urlopen error ...>" → no network / DNS
405+
LogTail := ReadLogTail(LogPath, 3000);
406+
if LogTail = '' then begin
407+
LogTail := '(no output captured — the verify command probably could not be launched)';
408+
end;
409+
Dialog := 'Verification failed.' + #13#10#13#10
410+
+ 'Details:' + #13#10 + LogTail + #13#10#13#10
411+
+ 'Full log: ' + LogPath + #13#10#13#10
412+
+ 'You can continue the install and fix the config later.';
413+
MsgBox(Dialog, mbError, MB_OK);
355414
end;
356415
end;
357416

windows/scripts/wsl-common.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
Set-StrictMode -Version Latest
2+
3+
# Force UTF-8 for console I/O. Windows PowerShell 5.x defaults to GBK (936)
4+
# on zh-CN hosts, which mangles the Chinese strings in our install-*.ps1
5+
# messages and also corrupts stdout captured from WSL commands that emit
6+
# UTF-8. Setting both Input and OutputEncoding to 65001 applies to every
7+
# script that dot-sources this file (all four install-*.ps1 do). This is a
8+
# no-op on PowerShell 7+, which already defaults to UTF-8.
9+
try {
10+
[System.Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding(65001)
11+
[System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding(65001)
12+
} catch {
13+
# Some hosts (e.g. Inno Setup's hidden console) can't mutate encoding —
14+
# ignore the failure rather than aborting the install.
15+
}
16+
217
$script:RegionChecked = $false
318
$script:IsChinaRegion = $false
419

0 commit comments

Comments
 (0)