Repository navigation
fix(cron,skills): tolerate non-UTF-8 cron archives and org markers - #118331
Open
beardthelion wants to merge 1 commit into
Open
beardthelion wants to merge 1 commit into
beardthelion wants to merge 1 commit into
Conversation
read_text(encoding="utf-8") raises UnicodeDecodeError - a ValueError,
not an OSError - so readers guarded only by except OSError crash instead
of degrading:
- _inject_context_from: one corrupt .md in a source job's output dir
crashed _build_job_prompt (which runs outside run_job's try), so the
downstream job failed on every fire while the file remained. The read
now skips the file like a silent/blank archive, so an older usable
archive still gets used instead of masking the whole source.
- read_active_org_id: a non-UTF-8 .active_org marker escaped its
fail-safe contract ("None = no org skills load") into
_build_skills_manifest during system-prompt assembly - every turn.
Now returns None as documented.
The sibling arm in skill_bundles._load_bundle_file is already covered
by open PR NousResearch#112180, which adds the same UnicodeError branch there.
beardthelion
force-pushed
the
fix/nonutf8-failsafe-readers
branch
from
September 21, 2026 16:26
2f9a65c to
2d88dbc
Compare
SummaryFixes a real crash class: What changed
Strengths
Findings
VerdictLooks good to merge. Reviewed using Hermes-Agent |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #118330.
read_text(encoding="utf-8")raisesUnicodeDecodeError(aValueError, not anOSError), so readers whoseexceptnames onlyOSErrorcrash on undecodable files instead of degrading as their own contracts promise. Two live sites:cron/scheduler_prompt.py_inject_context_from: a corrupt.mdin acontext_fromsource dir escaped the(OSError, PermissionError)guard and crashed_build_job_prompt- which runs outsiderun_job's try - on every fire. The fix adds a per-file guard so a corrupt archive is skipped like a silent/blank one and iteration falls through to the next older archive, instead of skipping the whole source job.agent/skill_utils.pyread_active_org_id: a non-UTF-8.active_orgmarker escaped intoprompt_builder._build_skills_manifest, failing system-prompt assembly on every turn. Now returnsNoneas the docstring promises.Sibling arm
agent/skill_bundles._load_bundle_fileis already covered by open PR #112180 (sameUnicodeErrorgap) and is intentionally not duplicated here.Test plan
UnicodeDecodeErrorescapes), GREEN post: corrupt-newest archive falls through to older, corrupt-only source skipped,_build_job_prompte2e survives corrupt archive, undecodable.active_orgmarker returns None anditer_skill_index_filessurvivestests/cron/+ skill suites: 1606 pass; only the 4 pre-existing host-umasktest_file_permissionsfailures (identical on unmodified source)ruff checkclean on all touched files