fix(web_server): handle dangling symlinks in managed files and catch Z.ai image rejections - #97785
Open
ziuus wants to merge 1 commit into
Open
fix(web_server): handle dangling symlinks in managed files and catch Z.ai image rejections#97785ziuus wants to merge 1 commit into
ziuus wants to merge 1 commit into
Conversation
Collaborator
…Z.ai image rejections - Return lstat info and prevent HTTP 500 when encountering dangling symlinks in list_managed_files - Add Z.ai / Zhipu GLM error phrases to _IMAGE_REJECTION_PHRASES so text-only fallback triggers cleanly when image content is rejected - Map speculative Copilot model alias gpt-5-mini to active endpoint gpt-4o-mini - Add regression tests for dangling symlink listing and Z.ai image rejection phrase isolation
ziuus
force-pushed
the
fix/web-files-symlink-and-image-rejection
branch
from
August 29, 2026 08:51
2f086a8 to
ef9aa27
Compare
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
Fixes issues in the file browser and provider error-handling loop:
Managed Files Dangling Symlink 500 Error (
hermes_cli/web_server.py):list_managed_filescrashed with HTTP 500 (Could not stat path: [Errno 2] No such file or directory) when encountering dangling/broken symlinks (such as Steam's standardlinux32/steamlink)._managed_file_entryto fall back totarget.lstat()whentarget.resolve().stat()fails due toOSError.Z.ai / Zhipu GLM Multimodal Image Rejection (
agent/message_sanitization.py):HTTP 400: messages.content.type is invalid, allowed values: ['text']._IMAGE_REJECTION_PHRASESso Hermes recognizes the image rejection, strips images, and safely transitions to text-only mode for the session instead of cascading into unhandled provider retries.Copilot Fallback Model Alias (
hermes_cli/models.py):gpt-5-minialias togpt-4o-minito prevent Copilot endpoint 400model_not_supportederrors during fallback execution.Test Plan
tests/hermes_cli/test_web_server_files.py: Addedtest_dangling_symlink_does_not_crash_file_listingto verify dangling symlinks return 200 OK with lstat metadata.tests/run_agent/test_image_rejection_fallback.py: Addedtest_zai_image_rejection_matchesto verify Z.ai 400 rejection body triggers text-only fallback.pytest tests/hermes_cli/test_web_server_files.py tests/run_agent/test_image_rejection_fallback.py tests/hermes_cli/test_copilot_*.py(81/81 passed).