Commit Graph
3656 Commits
Author SHA1 Message Date
nesquena-hermes bf3ff69c5e feat(plugins): add WebUI dashboard plugin system with iframe isolation (#2622, @pix0127) 2026-06-02 02:48:11 +00:00
nesquena-hermes 3cafec3004 Merge pull request #3372 from nesquena/hotfix/upload-hardening
Release GB — v0.51.208 (workspace upload hardening hotfix)
2026-06-01 19:38:37 -07:00
nesquena-hermes 2ab0b56078 refine(hotfix): Opus SHOULD-FIX — drop redundant equality clause + tighten symlink test
- The is_relative_to() check already covers the workspace==target equality case
  (is_relative_to(A,A) is True), so the '!= workspace' prefix was redundant.
- Symlink test now asserts a hard 403 (proves the guard fires, not just that
  nothing leaked) and cleans up the out-of-workspace escape dir in a finally.
2026-06-02 02:28:44 +00:00
nesquena-hermes f112d8aa9a fix: keep parse_multipart self-contained (local MAX_UPLOAD_BYTES import)
test_sprint1's parse_multipart tests exec() the function's source in an isolated
namespace with only re/email.parser imported; referencing the MAX_UPLOAD_BYTES
module global there NameErrored. Import it locally inside the function (with a
defensive fallback) so the function is self-contained and the isolated-exec
tests pass.
2026-06-02 02:27:21 +00:00
nesquena-hermes 1702a7604c lint: raise ... from None for the Content-Length parse guard (B904) 2026-06-02 02:20:43 +00:00
nesquena-hermes fbcae5f71e fix: harden workspace upload surface (#3104 follow-up hotfix)
Codex regression-gate findings on the shipped #3104 upload code, each verified
with a repro and fixed:

1. Negative Content-Length bypassed the size cap → unbounded rfile.read(-1).
   The per-handler 'content_length > MAX_UPLOAD_BYTES' check is False for a
   negative value, so the guard is now centralized in parse_multipart()
   (validates [0, MAX_UPLOAD_BYTES]) — protects all four upload handlers.
2. .tar/.tbz2/.txz uploads silently skipped extraction (is_archive suffix set
   was narrower than extract_archive's) → now matches.
3. Rejected archives (zip-slip/zip-bomb/corrupt/too-many-members) showed a
   misleading 'Uploaded' success toast → workspace.js now surfaces extract_error.
4. An in-workspace symlink subpath let mkdir/writes escape the workspace root →
   target_dir is now required to be is_relative_to(workspace) before mkdir.

Regression tests added (negative+oversize CL, .tar extraction, symlink target).
2026-06-02 02:20:05 +00:00
nesquena-hermes 36faa02364 Merge pull request #3369 from nesquena/review/pr-2931
Release GA — v0.51.207 (#2931 Edge TTS as an alternative speech engine)
2026-06-01 19:15:12 -07:00
nesquena-hermes 08f8aba89d release: stamp v0.51.207 (Release GA — Edge TTS speech engine) 2026-06-02 02:10:43 +00:00
nesquena-hermes 8164c42f94 fix(#2931): restore dropped console.error in top-level boot catch (Codex SILENT finding)
The PR silently removed 'console.error([hermes] boot failed, e)' from the
top-level boot .catch() that exists on master, so caught boot-path failures
(session restore / inflight recovery / gateway startup) would no longer surface
in the console or the browser-smoke gate. Restored to match master.
2026-06-02 02:05:56 +00:00
nesquena-hermes a1a142f4f7 test(#2931): pin auth OFF in the endpoint tests for suite-order determinism
The 2 endpoint tests passed in isolation but flaked in the full suite: a prior
test can leave is_auth_enabled() True globally, so the no-cookie requests got a
401 before reaching the method/length/voice/rate-limit guards under test. The
autouse fixture now monkeypatches api.auth.is_auth_enabled -> False (the handler
imports it at call time) so the validation-path assertions are deterministic.
2026-06-02 02:04:56 +00:00
nesquena-hermes 08fe4f51f0 fix(#2931): Edge TTS playback path (GET->POST), stoppable hands-free audio, test isolation
Both advisors (Opus MUST-FIX + Codex SHIP-ONLY-WITH-FIXES) caught that the Edge
TTS playback was broken despite the settings selector working:

1. ui.js _playEdgeTts used new Audio('/api/tts?text=...') — a GET — but /api/tts
   is POST-only (405) and registered only in handle_post. The per-message speaker
   button + auto-read silently failed in edge mode, and the GET leaked message
   text into the query string/access log. Rewritten to POST JSON + blob object
   URL (mirrors the working boot.js path), and now surfaces server errors
   (503 not-installed, 429 rate-limit) via toast instead of silent dead air.
2. boot.js hands-free Edge audio was a local var never assigned to the shared
   _playingEdgeAudio handle, so stopTTS() (from _deactivate) couldn't stop it.
   Now registered + cleared on end/error.
3. Test isolation: the _tts_limiter function-attribute singleton persisted across
   the whole suite, flaking 2 of my endpoint tests in the full run. Converted the
   reset to an autouse fixture (before+after each) + unique per-test client IPs.
2026-06-02 01:58:13 +00:00
nesquena-hermes 6801272f51 review(#2931): make edge-tts an optional dependency + add endpoint test coverage
Maintainer review changes on the Edge TTS PR:
- edge-tts was added as a HARD base requirement, but the /api/tts handler is
  designed optional (ImportError returns 503). Moved it out of requirements.txt
  with an OPTIONAL comment + install hint; updated the 503 message from the
  nonexistent 'see docs' to the actual install command. Keeps minimal base deps.
- PR shipped NO tests for a new auth+rate-limited+allowlisted network endpoint.
  Added tests/test_issue2931_edge_tts_endpoint.py covering method (405), missing
  text (400), over-length (400), voice allowlist (400), per-client rate limit
  (429) — all in-process, no real synthesis/network.
2026-06-02 01:28:35 +00:00
nesquena-hermes 1c29d6ac9c feat: add Edge TTS as alternative speech engine (#2931, @liuqiangweb-svg) 2026-06-02 01:21:39 +00:00
nesquena-hermes f0c3668d97 Merge pull request #3367 from nesquena/review/pr-3104
Release FZ — v0.51.206 (#3104 workspace file upload + drag-and-drop with archive extraction)
2026-06-01 18:18:50 -07:00
nesquena-hermes bb9b8054b1 release: stamp v0.51.206 (Release FZ — workspace file upload) 2026-06-02 01:15:43 +00:00
nesquena-hermes 6bb8d570e8 i18n(#3104): add uploading/uploaded translations to all covered locales
The English-only addition broke the locale-parity tests (es/zh/ja/ru/tr/ko all
enforce full key coverage vs English). Added translated uploading/uploaded to
it/ja/ru/es/de/zh/zh-Hant/pt/ko/fr/tr so every locale covers the new keys.
2026-06-02 01:11:01 +00:00
nesquena-hermes df69de92f1 fix(#3104): add missing 'uploading'/'uploaded' i18n keys to English locale
The PR referenced t('uploading') and t('uploaded') in static/workspace.js with
JS fallbacks but never defined the keys, so test_static_literal_i18n_keys_exist_in_english_locale
(the i18n-key existence gate, also run in CI) went red. Added both to the English
locale (and the Korean block's English-placeholder upload keys for consistency).
2026-06-02 00:58:45 +00:00
nesquena-hermes 9690725f8e harden(#3104): archive member-count cap + bounded extraction-dir dedup (Opus SHOULD-FIX)
Opus review SHOULD-FIX on the upload surface:
- Add _MAX_ARCHIVE_MEMBERS=10000 cap in extract_archive (both zip + tar loops):
  a tiny archive with millions of members slips under the byte cap but can
  exhaust inodes/fds. Trips before extraction, cleaned up via the existing
  rmtree-on-exception. Regression test added.
- Bound the extraction-dir collision-suffix loop (was while-True) to 1000 tries.
Other Opus SHOULD-FIX items (member-count #1 done; #2 done) filed as follow-up
or N/A: same-field multi-file collapse doesn't apply (frontend sends one request
per file); .tar.gz stem cosmetic.
2026-06-02 00:52:50 +00:00
nesquena-hermes d0917f2b24 fix(#3104): correct dedup filename reporting + make zip-bomb cap testable
Two issues caught by the PR's own tests against the out-of-process test server:
1. Dedup reporting bug: after a filename collision the file was correctly
   written to e.g. report-1.pdf, but the JSON response reported the ORIGINAL
   name (safe_name) — now reports dest.name. (Real user-facing bug.)
2. Zip-bomb cap was untestable: the test monkeypatched _MAX_EXTRACTED_BYTES in
   the pytest process, which has no effect on the separate server process where
   extraction runs. Made the cap env-configurable (HERMES_WEBUI_MAX_EXTRACTED_MB,
   read at call time via _max_extracted_bytes(); defaults to 10x upload cap),
   set it to 5MB in the conftest server env, and rewrote the test to upload a
   compressible archive that genuinely extracts past the cap. Also asserts no
   partial extraction dir is left behind.

Plus lint: unused field_name loop var -> _field_name, unused os import in test.
2026-06-02 00:41:11 +00:00
nesquena-hermes ff81591e8e feat(workspace): add file upload + drag-drop with archive extraction (#3104, @antoniocarlos97ss) 2026-06-02 00:26:53 +00:00
nesquena-hermes 383e0501db Merge pull request #3363 from nesquena/release/stage-hi1
Release FY — v0.51.205 (stage-hi1: workspace syntax highlighting + generated-image rendering + manual title regeneration)
2026-06-01 17:20:49 -07:00
nesquena-hermes 7f37fdb724 release: stamp v0.51.205 (Release FY — stage-hi1) 2026-06-02 00:16:13 +00:00
nesquena-hermes 07a50ebf3b polish(#3220): clarify download button on dark images (border + backdrop blur)
Nathan feedback: the download icon read as 'oddly placed' on dark generated
images. Geometry was already correct (8px inset on the image corner) — the
issue was low contrast: a flat rgba(0,0,0,.55) button blends into a dark image.
Add a subtle 1px white border, soft shadow, and 3px backdrop-blur so the button
reads as a clear chip-on-image regardless of the underlying pixels (the standard
treatment for on-image controls). CSS-only.
2026-06-02 00:09:32 +00:00
nesquena-hermes a66a008ad3 fix(#3220): shrink-wrap artifact-image wrapper so download button overlays the image
The .msg-artifact-image span was stretching wider than the image (inline-block
in a block context filled the line), so the absolutely-positioned download
button (right:8px of the wrapper) floated ~240px to the right of the image.
Add width:fit-content + max-width so the wrapper hugs the image; the button now
correctly overlays the image's top-right corner. line-height:0 removes inline
descender gap.
2026-06-01 23:49:10 +00:00
nesquena-hermes e5ddb2ae1f iterate(stage-hi1 v2): #3220 larger generated images, #3223 compact icon+label menu
Nathan feedback round 2:
- #3220: generated images were rendering at the 120x90 upload-thumbnail size
  (too small for the subject of the message). Now render at natural aspect
  ratio up to 360px (max-height 360, responsive max-width), lightbox preserved.
- #3223: drop the per-item subtitle/description lines from the session action
  menu — show only icon + label (VS Code / browser / ChatGPT pattern). The
  description is preserved as a hover tooltip (title=). Makes the menu ~40%
  shorter, less crowded, and structurally less prone to viewport clipping.
2026-06-01 23:44:31 +00:00
nesquena-hermes 031a3ce2e9 polish(#3220): esc() download label + scrub orphaned media_open i18n keys
Opus iter2 SHOULD-FIX (both non-blocking, applied for cleanliness):
- esc() the media_download title/aria-label so a future translator's quote
  can't break out of the attribute (defense-in-depth).
- Remove the now-dead media_open key from all 11 locales + the ui.js fallback
  dict (the Open button was dropped in the clean-image redesign).
2026-06-01 23:03:48 +00:00
nesquena-hermes 8ce02caf11 iterate(stage-hi1): Nathan UX feedback — #3220 clean image+hover-download, #3337 uniform code bg, #3223 menu clip fix
#3220: redesign generated-image rendering from a permanent bordered card
(filename + Open/Download buttons) to a clean inline image with click-to-zoom
lightbox + a hover/focus-revealed Download overlay, matching ChatGPT/Claude/
Gemini. Drops redundant Open (lightbox already covers it). Tests updated.

#3337: fix two-tone code background — Prism's prism-tomorrow theme styled the
parent <pre> gray while the <code> was navy var(--code-bg), so dark theme showed
a gray frame around navy code. Override BOTH .preview-code[class*=language-] and
its <code> to var(--code-bg) (mirrors the chat code-block fix at .msg-body pre).

#3223: fix action-menu clipping — the new Regenerate-title row made the 9-item
menu tall enough to overflow the viewport bottom when opened on a top-anchored
row at short viewports (e.g. 1280x720). _positionSessionActionMenu now clamps
the menu within both viewport edges and caps max-height with scroll when the
menu is taller than the viewport.
2026-06-01 22:48:01 +00:00
nesquena-hermes c1156b4c67 fix(#3337): prevent Prism highlight leaking across workspace files
Maintainer fix on stage (browser-test catch): Prism.highlightElement()
propagates the language-* class onto the parent <pre>, so previewing a
.css file then a .txt file rendered the plain text with CSS grammar.
Strip any stale language-* from #previewCode before each render and only
call highlightElement when a language was assigned. Adds regression test
(tests/test_issue3337_workspace_preview_highlight.py) and bumps the
_openSessionActionMenu scan window in test_1466 to cover the new
Regenerate-title action lines (#3223).
2026-06-01 21:56:26 +00:00
nesquena-hermes 546afe8374 feat: add manual session title regeneration (#3223, @AJV20)
Closes #3106. Adds /api/session/title/regenerate endpoint + session-action
menu item. Preserves chronology (touch_updated_at=False), guards read-only
and imported sessions, syncs to state.db when Insights sync enabled.

Maintainer refinement (Opus SHOULD-FIX): scope the is_imported guard to the
regenerate action only instead of broadening the shared _isReadOnlySession()
helper, which also gates rename/pin/archive/move/fork. Matches the backend
403 guard. Test updated to assert the scoped shape.
2026-06-01 21:39:51 +00:00
nesquena-hermes 949dc7aac8 feat: render generated media artifact cards (#3220, @AJV20)
- CHANGELOG entry moved to ### Added (feature, not fix)
- zh-Hant locale: use Traditional 開啟/下載 instead of simplified forms
2026-06-01 21:21:32 +00:00
nesquena-hermes 2d1b4642e2 feat: syntax highlighting in workspace file preview (#3337, @mysoul12138) 2026-06-01 21:20:42 +00:00
nesquena-hermes b718cf436f Merge pull request #3361 from nesquena/release/stage-batch17
v0.51.204: project/session operations honor the session's own profile (#3331)
2026-06-01 14:12:01 -07:00
nesquena-hermes c5d4806a64 fix(#3331): gate findings — empty-session profile retag, root-alias project filter, create-profile validation
Codex+Opus gate findings on the profile-scoping PR:
1. panels.js: retag S.session.profile on ANY profile switch (was inside the
   if(data.default_model) block, so model-less profile switches left a stale chip).
2. sessions.js: project-picker filter now mirrors the server's root-alias
   tolerance (default <-> renamed-root) so a server-approved 'default' project
   isn't hidden for a renamed-root session.
3. routes.py /api/projects/create: validate the optional client-supplied profile
   via _PROFILE_ID_RE before stamping (was trusting raw client input -> could
   create hidden cross-profile rows). Updated the PR's string-assertion test.
2026-06-01 21:05:32 +00:00
nesquena-hermesandPINKIIILQWQ 3cf4d15dc6 fix: align project/session operations with session profile instead of global active profile (#3331)
Co-authored-by: PINKIIILQWQ <PINKIIILQWQ@users.noreply.github.com>
2026-06-01 20:57:40 +00:00
nesquena-hermes 99b3745b01 Merge pull request #3359 from nesquena/release/stage-batch15
v0.51.203: sticky manual unpin for streaming chat scroll (#3343)
2026-06-01 13:44:57 -07:00
nesquena-hermesandpamnard d09f2e4efb feat: sticky manual unpin for streaming chat scroll (#3343)
Supersedes the v0.51.199 proximity-re-pin (#3330) and the #3250 upward-intent
timeout with a sticky-unpin model (ChatGPT/Claude/Codex behavior): scroll up =
stay put until you return to the bottom or click the scroll-to-bottom control.
Reconciled against the shipped #3330 code: removed the now-dead
_recentMessageUpwardIntent reference from the #3319 rAF retry, kept the
load-time -Infinity intent-init fix, kept the pinned-only >500 catch-up.

Co-authored-by: pamnard <pamnard@users.noreply.github.com>
2026-06-01 20:34:06 +00:00
nesquena-hermes 720695a0c2 Merge pull request #3358 from nesquena/release/stage-batch14
v0.51.202: filter interrupted-recovery control text from visible transcript (#3321)
2026-06-01 13:23:59 -07:00
nesquena-hermes d40c2e38d0 test: drop unused 're' import in test_live_stream_ux (ruff F401) 2026-06-01 20:21:40 +00:00
nesquena-hermes 7d2be7f52c fix(#3321): drop provider_details_label recovery-control heuristic (over-filtered genuine interruptions)
Codex+Opus regression-gate finding: _isRecoveryControlMessage /
_streamRecoveryControlMessage fell back to matching
provider_details_label==='interruption details'. But a GENUINE 'Response
interrupted' card (Stop button, real provider crash) carries that exact label,
so the filter would drop a real user-facing interruption from the transcript on
the next render/restore — the inverse of the #3300 data-loss class. Require the
explicit server-set recovery_control marker; keep only the two fully-anchored
synthetic-text matches for pre-marker backward-compat. Adds a node-driven
regression test (revert-verified) asserting a label-only interruption card and a
real user turn stay visible while marker + strict text are filtered.
2026-06-01 20:14:29 +00:00
nesquena-hermes 5db97e1985 docs: v0.51.202 release header (stage-batch14 — #3321) 2026-06-01 20:07:46 +00:00
nesquena-hermesandfranksong2702 f50b4fc2fa fix: filter interrupted recovery control text from visible transcript (#3321)
Co-authored-by: franksong2702 <franksong2702@users.noreply.github.com>
2026-06-01 20:07:16 +00:00
nesquena-hermes fa374f61d8 Merge pull request #3356 from nesquena/release/stage-batch13
v0.51.201: colored diff lines in tool-card snippets (#3336)
2026-06-01 13:04:00 -07:00
nesquena-hermes 94ad2a6b8d docs: v0.51.201 release header + fix #3336 tool-card diff test extraction list 2026-06-01 19:54:45 +00:00
nesquena-hermesandmysoul12138 0b7f32f5d9 feat: color diff lines in tool card snippets (#3336)
Co-authored-by: mysoul12138 <mysoul12138@users.noreply.github.com>
2026-06-01 19:53:40 +00:00
nesquena-hermes 1c6e34b7b6 Merge pull request #3354 from nesquena/release/stage-batch12
v0.51.200: remote-gateway health probe + ephemeral-turn-field preservation
2026-06-01 12:52:18 -07:00
nesquena-hermes 042294e2a1 test: update sessions.js string-assertions for #3313 carry-forward rename
#3313 applies the ephemeral-field carry-forward at all 5 wholesale S.messages
replace sites (loadSession/_ensureMessagesLoaded/_loadOlderMessages/
_ensureAllMessagesLoaded/startGatewaySSE), renaming the replace RHS from
msgs/next to _msgsToAssign/_nextToAssign. These pre-existing tests pinned the
old literals; updated to match the new RHS (or made LHS-agnostic) while
preserving the invariants they protect (bump-before-replace, session-switch
guard, shorter-transcript guard).
2026-06-01 19:46:36 +00:00
nesquena-hermes c0cfc1b975 docs: v0.51.200 release header (stage-batch12 — #3312 #3313) 2026-06-01 19:38:30 +00:00
nesquena-hermesandSanjays2402 0cae7c644c fix: preserve ephemeral turn fields when loadSession force-reloads (#3313)
Co-authored-by: Sanjays2402 <Sanjays2402@users.noreply.github.com>
2026-06-01 19:38:00 +00:00
nesquena-hermesandSanjays2402 329aae6979 fix: probe remote gateway via HERMES_API_URL before local fallback (#3312)
Rebased onto master + removed an unused 'io' import flagged by the ruff gate.

Co-authored-by: Sanjays2402 <Sanjays2402@users.noreply.github.com>
2026-06-01 19:38:00 +00:00
nesquena-hermes b6e4899887 Merge pull request #3353 from nesquena/release/stage-batch11
v0.51.199: pinned-scroll recovery + inline-math currency false-positive
2026-06-01 12:25:17 -07:00