Commit Graph

541 Commits

Author SHA1 Message Date
Hermes Agent
ce4e01ea92 chore: bump version to v0.50.51, update CHANGELOG 2026-04-15 19:06:54 +00:00
Hermes Agent
4f7db62c58 fix: strip orphaned tool messages before API calls (fixes #534) — PR #542 2026-04-15 19:06:02 +00:00
nesquena-hermes
3033fb65e3 fix(themes): swap Prism syntax-highlighting theme on light/dark switch (#505) — v0.50.50
fix(themes): swap Prism syntax-highlighting theme on light/dark switch (#505) — PR #530
2026-04-15 12:05:12 -07:00
Hermes Agent
03df7132d0 chore: bump version to v0.50.50, update CHANGELOG 2026-04-15 19:02:43 +00:00
armorbreak001
50d7d1cf88 fix(themes): swap Prism syntax-highlighting theme on light/dark switch
The Prism CSS was hardcoded to prism-tomorrow (dark-only), so code
blocks stayed dark even when switching to Light or other non-dark themes.

- Add id='prism-theme' to the <link> element for runtime lookup
- In _applyTheme(), swap href between prism-tomorrow (dark) and
  prism (light) based on resolved theme
- Skips DOM write when the target href is already active

Fixes #505
2026-04-15 19:01:52 +00:00
nesquena-hermes
e4688425ab fix: respect IME composition in all Enter submit flows (#531) — v0.50.49
fix: respect IME composition in all Enter submit flows (#531) — PR #537
2026-04-15 11:58:31 -07:00
Hermes Agent
9220a876bc fix: strip orphaned tool messages before sending history to API (fixes #534)
Extends _sanitize_messages_for_api() with a two-pass approach:
1. Collect all tool_call_ids declared in assistant messages (handles
   both OpenAI 'id' and Anthropic 'call_id' field names).
2. Drop any tool-role messages whose tool_call_id was not declared
   by a preceding assistant message.

Strictly-conformant providers (Mercury-2/Inception, newer OpenAI
models) reject histories with orphaned tool results with a 400 error:
'Message has tool role, but there was no previous assistant message
with a tool call.' This can happen when histories are edited, when
switching between providers, or when partial messages are stored.

Adds 13 regression tests covering: valid roundtrip preservation,
multiple tool calls, partial orphan filtering, Anthropic call_id,
edge cases (None tool_calls, missing tool_call_id, non-dict entries).
2026-04-15 16:57:31 +00:00
Hermes Agent
e077d110c3 chore: bump version to v0.50.49, update CHANGELOG 2026-04-15 16:46:53 +00:00
Hermes Agent
8f7bee7b34 fix: respect IME composition in all Enter submit flows — PR #537
Adds isComposing guards to every Enter keydown handler so CJK/IME
users are never sent mid-composition (fixes issue #531):
- boot.js: chat composer + command dropdown Enter handler
- sessions.js: session rename, project create/rename Enter handlers
- ui.js: app dialog, message edit Enter-to-save, workspace rename

Ships 3 new regression tests (test_ime_composition.py).

Co-authored-by: vansour <vansour@users.noreply.github.com>
2026-04-15 16:45:52 +00:00
vansour
dc43a30af7 test: loosen IME guard regression assertions 2026-04-15 23:21:56 +08:00
vansour
74dee6b665 fix: respect IME composition in Enter submit flows 2026-04-15 23:12:47 +08:00
nesquena-hermes
96c4102aa7 fix: toast when model switched during active session (#419) — PR #529 2026-04-15 08:05:19 +00:00
Hermes Agent
d3251fdbfd chore: bump version to v0.50.48, update CHANGELOG 2026-04-15 08:04:24 +00:00
Hermes Agent
31196d42af fix: show toast when model is switched during active session (#419)
When a user switches the model via the model picker while a session has
existing messages, a toast now informs them: 'Model change takes effect
in your next conversation'. This prevents confusion when the model
dropdown updates visually but the running conversation continues with
the original model.

Implementation: 4-line addition in modelSelect.onchange in boot.js,
after the existing provider-mismatch warning. Checks S.messages.length
(the reliable in-memory array) and guards showToast with typeof.

Synthesized from PRs #516 (armorbreak001), #517 and #518 (cloudyun888).
Placement follows #518's correct boot.js approach. Reference corrected
from S.session.messages to S.messages (always initialized by loadSession).

4 new tests in test_provider_mismatch.py::TestModelSwitchToast.

Co-authored-by: armorbreak001 <armorbreak001@users.noreply.github.com>
Co-authored-by: cloudyun888 <cloudyun888@users.noreply.github.com>
2026-04-15 08:04:03 +00:00
nesquena-hermes
1050c673e6 fix/feat: batch fixes v0.50.47 — root workspace, custom providers, cron cache, system theme (PR #523) 2026-04-15 07:54:26 +00:00
Hermes Agent
178251a5c0 chore: bump version to v0.50.47, update CHANGELOG 2026-04-15 07:52:23 +00:00
Hermes Agent
21a7564afd test: add 22 tests covering batch fixes v0.50.47 (#506-#521) 2026-04-15 07:47:18 +00:00
Hermes Agent
44a544362f feat: add System (auto) theme following OS prefers-color-scheme (#504)
Synthesized from PRs #506, #509, #514 (all by armorbreak001 and cloudyun888).

Implementation:
- static/index.html: flicker-prevention head script resolves 'system' to
  'dark'/'light' via matchMedia before first paint. Adds 'System (auto)'
  as first option in theme picker. onchange calls _applyTheme().
- static/boot.js: new _applyTheme(name) helper — resolves 'system' via
  matchMedia, sets data-theme, registers a MQ change listener so the UI
  tracks OS switches live. loadSettings() now calls _applyTheme() instead
  of direct data-theme assignment.
- static/commands.js: adds 'system' to valid /theme command names,
  delegates apply to _applyTheme().
- static/panels.js: _settingsThemeOnOpen reads from localStorage (preserves
  'system' string, not the resolved 'dark'/'light'). _revertSettingsPreview
  calls _applyTheme() so reverting to 'system' correctly re-enables OS tracking.
- static/i18n.js: cmd_theme description now lists 'system' first in all 5
  locales (en, es, de, zh-Hans, zh-Hant).

Design choices vs submitted PRs:
- No separate system-theme.js file (unnecessary indirection).
- matchMedia listener does NOT POST to /api/settings (OS can change rapidly;
  persisting on every OS switch would hammer the server).

Co-authored-by: armorbreak001 <armorbreak001@users.noreply.github.com>
Co-authored-by: cloudyun888 <cloudyun888@users.noreply.github.com>
2026-04-15 07:45:20 +00:00
Hermes Agent
36830e3cd1 fix: invalidate cron skill picker cache on form open and after skill save (#502)
Two complementary cache-busting strategies for the stale cron skill picker:

1. On cron form open (toggleCronForm): always null _cronSkillsCache before
   fetching, so freshly created skills are immediately visible without a
   page reload. Previously the cache was only populated once and never
   invalidated.

2. On skill save (submitSkillSave): null _cronSkillsCache after a successful
   write so the next cron form open is forced to re-fetch. Mirrors the
   existing _skillsData=null pattern one line above.

Fixes: #502
Co-authored-by: armorbreak001 <armorbreak001@users.noreply.github.com>
2026-04-15 07:43:00 +00:00
Hermes Agent
7ea7331f26 fix: show custom_providers models regardless of active provider (#515 #519)
When a user has custom_providers configured in config.yaml, their custom
models should appear in the model picker even if active_provider is set
to a different provider (e.g. openrouter). Previously, the custom provider
was always discarded from detected_providers when active_provider != 'custom',
making custom models invisible.

Fix: only discard 'custom' if there are no custom_providers entries.

Co-authored-by: cloudyun888 <cloudyun888@users.noreply.github.com>
Co-authored-by: shruggr <shruggr@users.noreply.github.com>
2026-04-15 07:42:12 +00:00
Hermes Agent
eb760a2158 fix: allow /root workspace path; guard against split on missing [Attached files]
Removes /root from _BLOCKED_SYSTEM_ROOTS in api/workspace.py, allowing
Hermes running as root (e.g. Docker, VPS) to use /root as a workspace
without a 'system directory' rejection.

Fixes a fragile string split in api/streaming.py: base_text extraction
now guards against msg_text that contains no '[Attached files:' marker,
preventing the split from producing empty-string on those messages.

Fixes: #510, partial fix from #521 (workspace + split guard only).
Co-authored-by: ccqqlo <ccqqlo@users.noreply.github.com>
2026-04-15 07:41:36 +00:00
Hermes Agent
0b96f08b3e chore: bump version to v0.50.46, update CHANGELOG 2026-04-15 07:35:25 +00:00
nesquena-hermes
4f1623520d feat: clarify dialog flow and refresh recovery (#520) - merge PR #522 2026-04-15 07:27:57 +00:00
Hermes Agent
505bfc6a9a feat: clarify dialog flow and refresh recovery (#520)
Implements and stabilizes the clarify dialog UX in Hermes WebUI.

New clarify state module (api/clarify.py):
  - Per-session pending queue with threading.Event unblocking
  - Gateway notify registration/unregistration
  - Duplicate clarify deduplication while unresolved
  - resolve/clear helpers

New clarify HTTP endpoints (api/routes.py):
  - GET /api/clarify/pending
  - POST /api/clarify/respond
  - GET /api/clarify/inject_test (loopback-only, for tests)

Streaming integration (api/streaming.py):
  - clarify_callback wired to AIAgent.run_conversation()
  - SSE 'clarify' event emitted to WebUI
  - Blocks tool flow until response/timeout/cancel
  - 409 guard: session already has an active stream returns active_stream_id
  - MCP lazy discovery on first stream start

Frontend (static/messages.js, ui.js, sessions.js, index.html, style.css, i18n.js):
  - Clarify card with numbered choices + Other + free-text input
  - Composer lock while clarify is active
  - DOM self-healing if card node is removed during rerender
  - SSE 'clarify' event listener + fallback polling (1.5s interval)
  - Session switch / reconnect stops/starts clarify polling
  - 409 conflict: reattaches to active stream and queues user input
  - CLARIFY_MIN_VISIBLE_MS = 30000 timer dedup (mirrors approval card pattern)
  - i18n keys in en/es/de/zh-Hans/zh-Hant locales

Tests:
  - tests/test_clarify_unblock.py: 14 new tests (queue, callbacks, HTTP endpoints)
  - tests/test_sprint30.py: 31 new clarify tests (HTML, CSS, i18n, JS, streaming)
  - tests/test_sprint36.py: expand search window (stopClarifyPolling pushes setBusy further)

Total tests: 1246 (was 1209)

Co-authored-by: franksong2702 <138988108+franksong2702@users.noreply.github.com>
2026-04-15 07:25:52 +00:00
Hermes Agent
1bd0341243 fix: expand test_sprint36 search window for setBusy after stopClarifyPolling additions 2026-04-15 07:24:53 +00:00
Frank Song
ccba2f5c01 feat: harden clarify dialog flow and refresh recovery 2026-04-15 13:10:50 +08:00
nesquena-hermes
45d3dc0f68 fix: suppress N/A source_tag in session list sidebar (fixes #429)
fix: suppress N/A source_tag in session list sidebar (fixes #429)
2026-04-14 15:15:05 -07:00
nesquena-hermes
69cd0832de fix: suppress N/A source_tag in session list sidebar (fixes #429)
fix(renderer): extend _al_stash to include <img> tags — fixes broken image rendering
2026-04-14 15:14:57 -07:00
Hermes Agent
7b9f08c774 fix: suppress N/A source_tag in session list sidebar (#429)
- sessions.js _formatSourceTag(): return null for unrecognised tags
  instead of raw string — prevents legacy 'N/A' values from surfacing
- sessions.js metaBits push: guarded with _stLabel null check so only
  known platform labels appear in the session metadata line
- sessions.js [SYSTEM:] title fallback: drop raw s.source_tag middle
  term, fall back directly to 'Gateway' for unknown sources

7 new tests in test_issue429.py.
1 updated test in test_sprint40_ui_polish.py (new guarded push pattern).

Closes #429
2026-04-14 22:14:31 +00:00
Hermes Agent
2810233af4 fix(renderer): extend _al_stash to include <img> tags, preventing autolink from mangling src= URLs
Bug: the autolink pass stashed <a> tags (via _al_stash) before running,
but did not stash <img> tags. When ![alt](url) was converted to an <img>
tag by the image pass, the subsequent autolink regex matched the URL
inside src="..." and wrapped it in <a href="...">url</a>, producing
src="<a href="...">url</a>" — a completely broken image source.

Fix: extend the _al_stash regex from:
  (<a\b[^>]*>[\s\S]*?<\/a>)
to:
  (<a\b[^>]*>[\s\S]*?<\/a>|<img\b[^>]*>)

This stashes both <a> and self-closing <img> tags before autolink runs,
then restores them after, so the URL inside src= is never touched.

Adds 7 regression tests in tests/test_issue487b.py.
2026-04-14 22:09:36 +00:00
nesquena-hermes
642f4536f0 docs: update TESTING.md and ROADMAP.md to v0.50.44 / 1195 tests
docs: update TESTING.md and ROADMAP.md to v0.50.44 / 1195 tests
2026-04-14 15:06:29 -07:00
Hermes Agent
f0d49b5b59 docs: update TESTING.md and ROADMAP.md to v0.50.44 / 1195 tests 2026-04-14 22:06:11 +00:00
nesquena-hermes
e6447ebad2 fix: code-in-table CSS sizing + markdown image rendering (fixes #486, #487)
fix: code-in-table CSS sizing + markdown image rendering (fixes #486, #487)
2026-04-14 14:52:59 -07:00
Hermes Agent
887893ecd1 fix: code-in-table CSS sizing + markdown image rendering (#486, #487)
- static/style.css: add td code / th code rules (font-size 0.85em,
  padding 1px 4px, vertical-align baseline) for both .msg-body and
  .preview-md to fix cramped inline code in table cells (#486)

- static/ui.js inlineMd(): add image pass (![alt](url) → <img
  class=msg-media-img>) running while _code_stash is active (protects
  image syntax inside backticks), add _img_stash (\x00G) to shield
  rendered <img> src= from autolink, add img to SAFE_INLINE (#487)

- static/ui.js renderMd() outer: add image pass before outer link pass
  for images in plain paragraphs, add img to SAFE_TAGS allowlist (#487)

- tests/test_issue486_487.py: 45 new tests covering CSS source checks,
  JS source structure, rendering behaviour, and combination edge cases
  (code + image + link in same table cell, image inside code span, etc.)

Closes #486, closes #487
2026-04-14 21:52:34 +00:00
nesquena-hermes
75de03c99f Merge pull request #478 from nesquena/release/v0.50.43
release: v0.50.43 — markdown rendering fixes + KaTeX CSP
2026-04-14 14:23:38 -07:00
Hermes Agent
d8ab326b73 fix(renderer): fix two remaining renderMd issues found during browser QA
1. ** inside  was corrupted** — the outer bold/italic pass at line 480 ran
   after the outer backtick→<code> pass at line 457, causing esc() to corrupt <code> tags
   into &lt;code&gt; inside <strong>. Fix: add _ob_stash to protect <code> tags from
   the outer bold/italic pass.

2. **Table cells with [label](url) produced double <a> tags** — the outer [label](url) pass
   ran BEFORE the table regex, converting links to <a> tags in the raw table source.
   Then inlineMd() processed those <a> tags again and autolink re-linked the URL inside
   href="...". Fix: moved the outer link pass to AFTER the table pass so table cells
   get their links from inlineMd() only, which has its own _link_stash protection.
2026-04-14 21:22:20 +00:00
Hermes Agent
7753e954e5 docs: correct v0.50.43 test count to 1150 2026-04-14 21:15:46 +00:00
Hermes Agent
2343dc1d85 docs: v0.50.43 CHANGELOG + version bump (test count TBD) 2026-04-14 21:15:02 +00:00
Hermes Agent
85f1017514 fix(csp): allow cdn.jsdelivr.net for font-src so KaTeX fonts load (fixes #477) 2026-04-14 21:14:33 +00:00
Hermes Agent
eb7ec5bac3 fix(renderer): backtick code spans inside bold/italic no longer get esc'd 2026-04-14 21:14:00 +00:00
Hermes Agent
b673006b7f fix(renderer): address review feedback on PR #475 2026-04-14 21:13:53 +00:00
Nathan Esquenazi
5a79dd0dc9 fix: remove double semicolon in inlineMd link stash restore 2026-04-14 21:13:34 +00:00
Hermes Agent
0a570ada87 fix(renderer): prevent double-linking and esc() corruption in renderMd() 2026-04-14 21:13:33 +00:00
nesquena-hermes
53acc8e0e1 Merge pull request #476 from nesquena/release/v0.50.42
release: v0.50.42 — session display fixes + model UX polish (sprint 42)
2026-04-14 14:08:46 -07:00
Hermes Agent
34b98285a1 fix(ui): add custom option to <select> when model ID not in curated list (enables custom model IDs) 2026-04-14 21:06:23 +00:00
Hermes Agent
e228b1414f fix(tests): shared helpers in test_sprint42.py; correct test count to 1130 2026-04-14 21:04:37 +00:00
Hermes Agent
bb445ffe9a docs: v0.50.42 CHANGELOG, version bump (test count TBD) 2026-04-14 20:58:30 +00:00
Hermes Agent
2eb0679104 fix(tests): consolidate sprint-42 test_sprint42.py — all 20 tests in one file 2026-04-14 20:58:01 +00:00
Hermes Agent
12949a2771 feat(ui): add custom model ID input to model picker dropdown (fixes #444) 2026-04-14 20:56:56 +00:00
Nathan Esquenazi
7b0fb246ee fix: merge duplicate const lastAsst declarations into single lookup 2026-04-14 20:56:54 +00:00