3 Commits

Author SHA1 Message Date
VAN
b5443bf334 fix: force headless matplotlib backend in exec sandbox
The exec sandbox has no GUI session, so Figure.show() can block until the
tool timeout. schemdraw's Drawing defaults to show=True and calls show() on
context exit even after save(), which makes a successfully saved plot look
like a timed-out execution. Pin MPLBACKEND=Agg for model-authored programs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-11 21:24:47 +08:00
wumajiehechuan-lab
a4c85477b5 fix: request UTF-8 mode for model-authored exec code
`prepare_workspace_execution_env()` sets LANG / PYTHONUNBUFFERED /
PYTHONDONTWRITEBYTECODE but never PYTHONUTF8, and the restricted subprocess
backend deliberately inherits only a fixed subset of host variables. On a
Windows host whose ANSI code page is not UTF-8 (cp936, cp1252, …) the model's
Python therefore ran with `locale.getpreferredencoding() == 'cp936'`.

Two symptoms follow, and they hit any skill or tool script that touches
non-ASCII text:

* a bare `Path.read_text()` / `open()` on a UTF-8 file raises
  `UnicodeDecodeError: 'gbk' codec can't decode byte 0x8d in position 146`
  (or silently mojibakes the content);
* `print()` of a non-ASCII value reaches the caller as GBK bytes, which the
  turn reads back as garbage.

Reproduced end to end with a workspace skill whose build script reads a UTF-8
HTML template: under the exec environment it failed on every invocation, while
the same script succeeded in an ordinary shell on the same host — the classic
environment-dependent failure that is hardest for a user to diagnose. Measured
in the exec environment (same interpreter): `PYTHONUTF8` unset →
`stdout=gbk files=cp936`; set → `stdout=utf-8 files=utf-8`.

One variable fixes both halves, because UTF-8 mode covers file I/O and stdio
together. It is a no-op where UTF-8 is already the locale default, so Linux and
macOS containers behave exactly as before.
2026-09-26 01:44:26 -07:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00