2 Commits
Author SHA1 Message Date
XiaoChen 282d88dd83 fix(experts): read skill frontmatter with the shared parser
`collect_skill_context()` is the only caller that feeds the expert-manifest
generator prompt, and it parsed frontmatter with a private copy instead of
`octop.infra.utils.frontmatter.parse_frontmatter`. The private copy only
accepted a literal `---\n` first line and split each line on `:`.

Two shapes the shared parser handles therefore reached the prompt as a skill
with no description:

* `description: >-` folded blocks collapsed to the literal `'>-'` — the style
  the bundled expert skills already use;
* a frontmatter fence behind an HTML comment was not recognised at all, and the
  raw `---` fence stayed inside the excerpt.

6 of the 34 SKILL.md files in this tree parse differently between the two
parsers. The value is part of the generator prompt whose output is written back
into the cached expert manifest.json, so it is not cosmetic.
2026-09-22 11:56:00 +08:00
XiaoChen afd1857154 fix(cli): force utf-8 stdio so octop init does not crash on GBK consoles (#348)
Chinese Windows (GBK/cp936) encode piped/redirected CLI stdout with the
ANSI code page, so the checkmark success message in `octop init` raised
UnicodeEncodeError after the DB and admin user were already created.
Re-encode stdout/stderr to utf-8 at the CLI entry to cover the whole bug
class (init, stub, QR art, future emoji).

Add 3 unit tests (tests/unit/cli/test_main_encoding.py): two for the
guard helper and an end-to-end `octop init` run under
PYTHONIOENCODING=gbk. pytest -m "not live" passes locally; the 12
failures are pre-existing Windows/db-migration environment issues,
unchanged by this patch.
2026-08-20 16:30:54 +08:00