fix(desktop): attach hosted-web non-image files by path only (restore dropped __HERMES_WEB_CLIENT__ guard) - #91
Merged
Conversation
… dropped __HERMES_WEB_CLIENT__ guard) The hosted web SPA has no local filesystem — its picked files already live on the gateway box (~/.hermes/uploads/...). When window.__HERMES_WEB_CLIENT__ is set we must attach by PATH and let gateway file.attach read the bytes, never client-read them. The web-shim's readFileDataUrl only caches image previews, so for a .md/.txt it returns '' and the remote branch then threw "Could not read <name>" even though the upload had already succeeded — breaking every non-image attachment from the hosted web chat on webfree boxes. This guard shipped as prod #60 (June 2026) but was dropped from uploadComposerAttachment during a fork reconcile. Canary re-applied it in the 2026-07-15 upstream sync (PR NousResearch#166, commit 61addda147); this ports that exact fix to the prod fork. Guarded by use-prompt-actions/index.test.tsx "hosted web client attaches a non-image file by path only" — verified red→green (21→20 pre-existing failures, zero regressions). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Restores the
__HERMES_WEB_CLIENT__guard inuploadComposerAttachmentso the hosted web chat attaches non-image files (.md/.txt/.csv/…) by PATH only, letting the gatewayfile.attachread the bytes — never client-reading them.Why (runtime bug)
The hosted web SPA has no local filesystem — its picked files already live on the gateway box (
~/.hermes/uploads/…). The web-shim'sreadFileDataUrlonly caches image previews, so for a non-image it returns''. Without the guard, theremotebranch callsreadFileDataUrlForAttach(path), gets'', and throwsCould not read <name>— even though the upload already succeeded. Net effect on a live webfree box: attaching any.md/.txt/etc. from the web chat fails.History
This guard shipped as prod #60 (June 2026) but was dropped from
uploadComposerAttachmentduring a fork reconcile. The seam test survived, so canary CI caught it on the 2026-07-15 upstream sync and Aeon re-applied the guard in canary PR NousResearch#166 (commit61addda147). Prod fork main was still missing it. This PR ports that exact fix (byte-identical hunk) to prod.Verification (vitest, jsdom)
use-prompt-actions/index.test.tsx→ "hosted web client attaches a non-image file by path only (no client read, no data_url)"Error: Could not read notes.mdatindex.ts:131— REDtest:uisuite delta: 21 → 20 failing (the flipped test is exactly this one; zero new failures). The remaining 20 are pre-existing/environmental failures unrelated to this change and do not gate CI.Note
There is a pre-existing
perfectionist/sort-named-importslint nit on line 5 of this file (transcribeAudiovsPROMPT_SUBMIT_REQUEST_TIMEOUT_MS), identical onmainand untouched here — left out to keep the diff surgical.🤖 Generated with Claude Code