Skip to content

fix(windows): use UTF-8 at file and subprocess boundaries - #4

Open
scwf wants to merge 1 commit into
mainfrom
fix/windows-utf8-boundaries
Open

fix(windows): use UTF-8 at file and subprocess boundaries#4
scwf wants to merge 1 commit into
mainfrom
fix/windows-utf8-boundaries

Conversation

@scwf

@scwf scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Read agent YAML, instruction files, skill metadata, MCP configs, and harness JSON as UTF-8 so Windows locale encodings cannot reject valid project content.

Decode harness status output explicitly as UTF-8 and skip the POSIX orphan reaper when child-wait primitives are unavailable on Windows.

Add regression coverage for UTF-8 artifacts, CLI status output, and Windows host cleanup.


Note

Low Risk
Localized I/O encoding and platform guards with regression tests; no auth or data-model changes.

Overview
Windows host and encoding fixes so locale defaults (e.g. GBK/CP936) cannot break valid UTF-8 agent content or harness status checks.

All agent-related file reads now use encoding="utf-8" — omnigent YAML, bundle config.yaml, instruction/context files, SKILL.md, MCP configs, JSON skill sources, and compat-layer omnigent detection. parse documents that Path.read_text() without encoding fails on Windows for prompts containing characters like em dashes (U+2014). Omnigent YAML helpers also treat UnicodeDecodeError as a failed/invalid file with a clear message.

Harness login probing decodes CLI status output as UTF-8 with errors="replace" instead of text=True (locale-dependent).

Host orphan reaper is gated on _orphan_reaping_supported() (waitpid / WNOHANG); the reaper loop is not started on Windows, and _reap_orphans_once returns immediately without calling POSIX wait APIs.

Regression tests cover UTF-8 YAML loading, harness status decoding, and no-op orphan reaping when POSIX primitives are absent.

Reviewed by Cursor Bugbot for commit d1d2b45. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added the size/M Pull request size: M label Jul 24, 2026
@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@cursor review this pr

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

https://github.com/cursor review

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d1d2b45. Configure here.

@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review this pr

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: d1d2b450bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@scwf
scwf force-pushed the fix/windows-utf8-boundaries branch from d1d2b45 to 56788d7 Compare July 24, 2026 09:46
@github-actions github-actions Bot added size/L Pull request size: L and removed size/M Pull request size: M labels Jul 24, 2026
Read agent configs, instruction files, skills, MCP configs, plugin settings, and CLI bundle inputs explicitly as UTF-8 so Windows locale encodings cannot reject valid Unicode content.

Decode harness status subprocess output as UTF-8 with replacement to prevent locale-dependent reader failures. Skip orphan reaping when POSIX wait primitives are unavailable so Windows host startup and cleanup do not crash.

Add regression coverage for UTF-8 parsing, bundle preprocessing, skill resources, CLI status output, and Windows host cleanup.

Signed-off-by: scwf <wangfei_hello@126.com>
@scwf
scwf force-pushed the fix/windows-utf8-boundaries branch from 56788d7 to f1e09df Compare July 24, 2026 10:03
@scwf

scwf commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: f1e09df20b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Pull request size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant