Conversation
- Add encoding='utf-8' to file operations in model_metadata.py - Add encoding='utf-8' to config.yaml and lock file operations in scheduler.py - Add encoding='utf-8' to config.yaml read/write operations in telegram.py - Add encoding='utf-8' to rate limit state file read in nous_rate_guard.py This fixes encoding issues on Windows where the default encoding is cp1252, which can cause failures when processing Chinese characters or other non-ASCII content. Fixes Windows support for Chinese users.
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
The bug was that when there were multiple consecutive whitespace characters, the original code would increment the normalized index after each space, but the fix correctly maps all consecutive whitespace to a single space and only increments the normalized index once after all consecutive whitespace have been processed. This improves the fuzzy matching capabilities for code with inconsistent whitespace formatting.
1. Add missing reset_cache() function to hermes_time.py 2. Update handle_function_call documentation in model_tools.py to include all parameters
PR Analysis UpdateActual Changes (Corrected)After reviewing the full diff, this PR contains: Code change (1 file):
Documentation (130 files):
Code Fix AssessmentThe # Before
with open(path) as f:
# After
with open(path, encoding="utf-8") as f:On Windows, the default encoding is Issues to Address1. PR scope mismatch
2. Missing encoding fixes # These may still need encoding="utf-8":
# agent/model_metadata.py
# cron/scheduler.py
# gateway/platforms/telegram.py3. CI status RecommendationThe code fix is valid and should be merged. To improve reviewability:
The documentation translations are a valuable contribution for Chinese-speaking users. |
…and fix tool_calls handling
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
PR Analysis CompleteCode Fixes AppliedAll 5 encoding issues identified in the PR description have been fixed and pushed to the fork:
Root CauseOn Windows, Python's default file encoding is Adding PR Status
Additional Python Improvements (from upstream merge)The PR also includes quality-of-life fixes merged from upstream:
CI StatusAll CI checks pass. The |
|
This PR has been superseded by #13241, which contains a clean UTF-8 encoding fix (4 files, 6 lines) without the documentation translations. The original PR (#11990) was too broad in scope (153 files) and had merge conflicts. The replacement PR (#13241) focuses solely on the core encoding fix for Windows compatibility. Closing this in favor of the cleaner replacement. |
This fixes encoding issues on Windows where the default encoding is cp1252, which can cause failures when processing Chinese characters or other non-ASCII content.
Fixes Windows support for Chinese users.
What does this PR do?
Related Issue
Fixes #
Type of Change
Changes Made
How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs