Skip to content

fix(desktop): attach hosted-web non-image files by path only (restore dropped __HERMES_WEB_CLIENT__ guard) - #91

Merged
ashneil12 merged 1 commit into
mainfrom
fix/desktop-hosted-web-attach-path-only
Jul 15, 2026
Merged

ashneil12 merged 1 commit into
mainfrom
fix/desktop-hosted-web-attach-path-only

Conversation

@ashneil12

Copy link
Copy Markdown
Owner

What

Restores the __HERMES_WEB_CLIENT__ guard in uploadComposerAttachment so the hosted web chat attaches non-image files (.md/.txt/.csv/…) by PATH only, letting the gateway file.attach read 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's readFileDataUrl only caches image previews, so for a non-image it returns ''. Without the guard, the remote branch calls readFileDataUrlForAttach(path), gets '', and throws Could 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 uploadComposerAttachment during 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 (commit 61addda147). 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)"

  • Before: Error: Could not read notes.md at index.ts:131 — RED
  • After: GREEN
  • Full test:ui suite 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-imports lint nit on line 5 of this file (transcribeAudio vs PROMPT_SUBMIT_REQUEST_TIMEOUT_MS), identical on main and untouched here — left out to keep the diff surgical.

🤖 Generated with Claude Code

… 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>
@ashneil12
ashneil12 merged commit b95d13d into main Jul 15, 2026
22 checks passed
@ashneil12
ashneil12 deleted the fix/desktop-hosted-web-attach-path-only branch July 15, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant