Skip to content

fix(tirith): cache OSError spawn failure to suppress repeated WARNING spam#23880

Closed
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/tirith-oserror-cache
Closed

fix(tirith): cache OSError spawn failure to suppress repeated WARNING spam#23880
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/tirith-oserror-cache

Conversation

@ms-alan

@ms-alan ms-alan commented May 11, 2026

Copy link
Copy Markdown
Contributor

Closes #23845

Summary

When tirith is not installed on Windows but 'tirith' appears in PATH (e.g. from MSYS/Git Bash), returns a MSYS-style path () that exists on disk but cannot be executed by Windows subprocess. The was raised on every command without caching the failure, causing the same to fire 20+ times per session.

Fix

In OSError handler, set so subsequent calls short-circuit to 'path unavailable' (fires once) instead of retrying the same broken path and re-logging the same WARNING.

Testing

  • passes
  • The fix is purely defensive — no behavioral change when tirith is available or when the failure is transient

… spam

When tirith is not installed on Windows but 'tirith' appears in PATH
(e.g. from MSYS/Git Bash), shutil.which() returns a MSYS-style path
(/mingw64/bin/tirith) that exists on disk but cannot be executed by
Windows subprocess.  The OSError was raised on every command without
caching the failure, causing the same WARNING to fire 20+ times per
session.

Fix: mark _resolved_path = _INSTALL_FAILED in the OSError handler so
subsequent check_command_security() calls short-circuit to 'path
unavailable' (one WARNING) instead of retrying the same broken path.

Closes NousResearch#23845
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tools Tool registry, model_tools, toolsets tool/terminal Terminal execution and process management duplicate This issue or pull request already exists labels May 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #23855 — both fix #23845 (tirith WARNING spam on Windows when binary absent). Same code change: cache OSError spawn failure by setting _resolved_path = _INSTALL_FAILED in the except handler. #23855 was filed earlier.

@teknium1

Copy link
Copy Markdown
Contributor

This looks resolved on current main by the merged tirith warning-spam fixes. This is an automated hermes-sweeper review.

Evidence:

Thanks for the focused fix. The exact internal mechanism on main differs slightly from this PR, but the reported repeated WARNING spam is covered now.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tirith: repeated WARNING spam on every terminal command when binary is not installed (Windows)

3 participants