fix: batch of small robustness/correctness fixes from @kyssta-exe - #37146
Merged
Conversation
Salvages 8 distinct fixes from a batch of PRs by @kyssta-exe, reapplied onto current main (original branches were stale) with a few refinements. - cron(jobs.py): load_jobs() validates top-level JSON shape — a bare list auto-repairs into the {"jobs": [...]} dict; scalars/null raise a clear RuntimeError instead of an uncaught AttributeError that took down the whole cron subsystem (#37065, closes #36867). - web(web_server.py): close the per-action log file handle after Popen so the parent stops leaking one fd per spawned action (#36843). - web(web_server.py): DELETE /api/env returns 400 for invalid key names instead of a misleading 500, mirroring PUT /api/env (#36840). - gateway(gateway.py): read /proc/<pid>/cmdline inside a with-block so the fd is released immediately instead of relying on GC (#36804). - web-tools(web_tools.py): include "xai" in check_web_api_key() so a configured X.AI web backend reports as available (#36802). - compression(conversation_compression.py): mark the feasibility check done only after it completes, and default the gate to "not checked" if the attribute is missing (#36803). - completion(completion.py): replace `ls` with directory globbing in the generated bash/zsh/fish profile listers — handles names with spaces and skips non-directory entries (#36806). - terminal-tool(terminal_tool.py): drop a duplicate `import threading` (#36808). - claw(claw.py): the migrate recommendation now points at the real `hermes gateway stop` command instead of the non-existent `hermes stop` (#36795, #36796, closes #36771). - tests: guard against a leaked HERMES_CRON_SESSION breaking gateway approval tests — add it to the hermetic conftest unset list (root cause, protects every test) and pop it in the affected test's setup_method (#36796). Co-authored-by: kyssta-exe <kyssta-exe@users.noreply.github.com>
Contributor
🔎 Lint report:
|
This was referenced Jun 2, 2026
Closed
This was referenced Jul 28, 2026
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.
Summary
Salvages a batch of small, surgical robustness/correctness fixes from @kyssta-exe, reapplied onto current
main(the original branches were stale) with a few refinements. Each was verified to be a real, still-present issue.Fixes (8 distinct)
load_jobs()validates top-level JSON shape — bare list auto-repairs, scalars/null raise a clear error instead of an uncaughtAttributeErrorthat crashed the whole cron subsystemPopen(was leaking one fd per spawned action)DELETE /api/env→ 400 for invalid key names instead of a misleading 500 (mirrorsPUT)/proc/<pid>/cmdlinein awith-block so the fd releases immediatelyxaiincheck_web_api_key()so a configured X.AI web backend reports availablelswith directory globbing in generated bash/zsh/fish profile listers (handles spaces, skips non-dirs)import threadinghermes gateway stop, not the non-existenthermes stopHERMES_CRON_SESSIONfrom breaking gateway approval tests — added to the hermetic conftest unset list (root cause) and popped in the affected test'ssetup_methodRefinements beyond the originals
*(N/:t); all three shells now filter to directories only (the oldlsalso listed stray files).hermes stop: verified live thathermes stoperrors (invalid choice: 'stop') andhermes gateway stopis valid.HERMES_CRON_SESSIONso every test is protected, not just the one the contributor patched.Not included (verified, deliberately dropped)
main(landed via fix(dashboard): allowlist plugin assets + denylist subprocess-influencing env vars #32277). The DELETE side (fix(web): return 400 for invalid env var key in DELETE /api/env #36840) was the remaining gap and is fixed here.tail_token_budgeton session reset): verified to be a no-op —on_session_resetnever touchesthreshold_tokens, andtail_token_budgetis only ever set alongside it, so the proposed line re-derives the value already present. No bug.Validation
load_jobs()exercised against all top-level shapes (dict/list/str/int/null/garbage) — bare list auto-repairs, scalars/null raise a clean RuntimeError, no uncaughtAttributeError.HERMES_CRON_SESSIONflake reproduced and confirmed fixed both ways (with/without the conftest unset).Co-authored-by: kyssta-exe kyssta-exe@users.noreply.github.com
Infographic