Fix chat upload image attachment paths - #2940
Closed
george-andraws wants to merge 2 commits into
Closed
george-andraws wants to merge 2 commits into
george-andraws wants to merge 2 commits into
Conversation
This was referenced May 25, 2026
Collaborator
This was referenced May 25, 2026
Merged
huoli4844
pushed a commit
to huoli4844/hermes-webui
that referenced
this pull request
May 25, 2026
huoli4844
pushed a commit
to huoli4844/hermes-webui
that referenced
this pull request
May 25, 2026
This was referenced May 25, 2026
Collaborator
|
The second commit The first commit Thanks @george-andraws! 🚢 |
Collaborator
|
Both commits from this PR are now on master (fe597c1 via stage-batch17, a7e19b7 cherry-picked into stage-batch19 as 0f388de). Closing. Thanks @george-andraws! |
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 2026
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 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.
Thinking Path
/api/uploadalready returns the absolute server-side attachment path.[Attached files: Screenshot.jpg]instead of a readable path, so tools such asvision_analyzecould not open the upload immediately.What Changed
static/messages.jssouploadedPathsuses this fallback order for every uploaded item:u.pathu.nameu.filenameuuploadedNamesunchanged so optimistic UI, inflight state, and attachment chips still display friendly names._upload_destination()inapi/upload.pyso repeated uploads with the same sanitized filename in one session get unique paths such asphoto.png,photo-1.png, instead of overwriting earlier files.Why It Matters
When a user uploads an image and asks the agent to inspect it, the agent must be able to find the file immediately. Sending only the filename breaks that handoff because uploads live under the WebUI attachment inbox, not necessarily in the selected workspace or current working directory.
The duplicate-filename fix removes a plausible intermittent case: uploading the same image, or two files with the same name, no longer mutates the previous attachment path's contents.
Verification
gh pr checks 2940 --repo nesquena/hermes-webui --watchtest (3.11)passed in 2m03stest (3.12)passed in 2m21stest (3.13)passed in 2m14s/Users/georgeandraws/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_sprint1.py::test_upload_destination_does_not_overwrite_same_filename tests/test_chat_upload_attachment_paths.py tests/test_native_image_attachments.py tests/test_issue1867_upload_size_preflight.py -q46 passed/Users/georgeandraws/.hermes/hermes-agent/venv/bin/python -m pytest -qSystematic Debugging, and older tests interpolate the name without URL encodinggit initdefaults tomainwhile two tests assumemaster/private/varvs/varon macOSRisks / Follow-ups
Low risk. The path-context change only affects the agent-facing text sent to
/api/chat/start; structured attachment metadata and UI display names remain friendly-name based.Duplicate upload filename handling is a small behavior change: the second same-name upload now returns a suffixed filename/path instead of overwriting the first file. This should be safer for chat attachment history.
Model Used
AI-assisted.
codex-cli 0.133.0, modelgpt-5.5