Commit Graph

1236 Commits

Author SHA1 Message Date
AJV20 83cc12b0bf feat: add optional gateway-backed WebUI chat (#3021)
Squash-merged pr-3021 into stage-batch34. Default-off bridge to Hermes Gateway API server via HERMES_WEBUI_CHAT_BACKEND=gateway.
2026-05-28 03:27:07 +00:00
Florian Krause 8408a3dd22 fix: reattach SSE on session-switch return + close leaked stream connections (#2925)
Squash-merged pr-2925 into stage-batch33. Closes #2924.
2026-05-28 02:48:17 +00:00
ai-ag2026 ad564f2cde fix: keep generated titles in conversation language (#2984)
Squash-merged pr-2984 into stage-batch33.
2026-05-28 02:47:40 +00:00
nesquena-hermes 424a55036f Merge pull request #3017 2026-05-28 02:16:34 +00:00
nesquena-hermes c1942a1cd8 fix(sessions): widen #3023 to all 5 session-id validators via shared is_safe_session_id helper
PR #3023 only updated Session.load() and Session.load_metadata_only(), leaving
three sibling validators (Session-internal _repair_stale_pending and the
/api/session/worktree/remove + /api/session/delete route handlers) still
gated on the old lowercase-only character set.  That would have shipped a
confusing UX where api-* and reachy-voice-* sessions could be loaded into
the sidebar but rejected with HTTP 400 on delete or worktree removal.

This commit factors the validation into a single is_safe_session_id helper
in api.models and updates all five call sites to use it.  Adds regression
coverage in tests/test_issue3023_safe_session_id_validators.py for both
the helper itself and a repo-wide guarantee that no narrow lowercase-only
magic string survives.

Closes the follow-up flagged by the parallel reviewer agent on #3023.
2026-05-28 02:09:05 +00:00
nesquena-hermes d76e23a9f2 Merge pull request #3009
# Conflicts:
#	CHANGELOG.md
2026-05-28 02:06:21 +00:00
nesquena-hermes 3cb2bd08fb Merge pull request #3023 2026-05-28 01:58:34 +00:00
nesquena-hermes 7006bb5c7a Merge pull request #3008 2026-05-28 01:43:22 +00:00
AJV20 25f8e100ec Merge origin/master into prefill context fix 2026-05-27 21:30:22 -04:00
nesquena-hermes 64c83e4932 Merge pull request #3029 2026-05-28 01:02:58 +00:00
nesquena-hermes d75bbfc90d Merge pull request #3028 2026-05-28 01:02:58 +00:00
nesquena-hermes 3560f37c8d Merge pull request #3027 2026-05-28 01:02:58 +00:00
nesquena-hermes 0c492e4eb1 Merge pull request #3003 2026-05-28 01:02:58 +00:00
ai-ag2026 0af58f2b82 feat: add session discoverability audit 2026-05-28 00:51:32 +02:00
ai-ag2026 9650b387fd fix: keep webui mirrored sessions out of cli filter 2026-05-28 00:51:12 +02:00
ai-ag2026 38905f335c fix: preserve messageful sidebar discoverability 2026-05-27 23:42:24 +02:00
AJV20 fb6dd28ac3 fix: cap custom models endpoint probes 2026-05-27 12:19:42 -04:00
ai-ag2026 3b93345487 fix(sessions): allow hyphenated session ids 2026-05-27 16:18:41 +02:00
BonyFish dc1e369f89 fix: remove webui-side writer to avoid conflict with agent
The .usage.json file is owned by hermes-agent (tools/skill_usage.py).
This change removes the webui-side increment logic to avoid:

1. File ownership conflict - both writing to same file
2. Schema mismatch - agent uses ISO strings, webui used floats
3. Concurrency issues - agent uses fcntl locks, webui had no locking
4. Double-counting - agent already increments counters server-side

Changes:
- api/skill_usage.py: keep only read_skill_usage(), remove increment functions
- api/streaming.py: remove skill usage counter hook
- api/routes.py: adapt response to pass through agent's format as-is,
  with defensive coercion for None values and metadata preservation
- tests/test_skill_usage.py: remove increment tests (17→7 cases)
2026-05-27 20:57:32 +08:00
Hermes Agent 74fe79ddc6 fix(reasoning): use agent metadata for effort support 2026-05-27 03:54:45 -06:00
AJV20 2a96b2acc2 fix: wrap WebUI script prefill text as user context 2026-05-27 03:09:01 -04:00
BonyFish 3a676b704a feat: add skill usage counter to insights page
- Add api/skill_usage.py for .usage.json read/write with atomic updates
- Track skill_view (view_count), skill_manage (use_count), skill_patch
  (patch_count) invocations per SSE stream completion
- Add GET /api/skills/usage endpoint returning per-skill usage stats
- Render Skill Usage card in Insights panel after LLM Wiki card
- Add i18n keys for en, zh, zh-Hant, ja, it locales
- Add 17 tests covering read/increment logic, API route, and streaming hook
2026-05-27 14:44:28 +08:00
george-andraws 541c064a72 fix(session): route messaging metadata loads through display merge
Use _merged_session_messages_for_display for is_messaging_session even in the
metadata-only (messages=0) path. This ensures message_count and last_message_at
match the full load path for Telegram / external messaging sessions that have
stitched or duplicate rows in state.db + sidecar.

Prevents spurious refresh loops, scroll resets, and open panel closures when
resuming cross-surface sessions in the WebUI.

No impact on CLI, non-messaging, or full-message paths. All 580 session tests pass.

Fixes the root cause identified in the SessionDB / render interaction changes.
2026-05-26 22:05:58 -07:00
nesquena-hermes 744c5d60c4 Merge pull request #2880 2026-05-27 04:40:11 +00:00
nesquena-hermes 7f66f72514 Merge pull request #2993
# Conflicts:
#	CHANGELOG.md
2026-05-27 03:25:04 +00:00
nesquena-hermes c208b710a4 Merge pull request #2996 2026-05-27 03:24:43 +00:00
nesquena-hermes 75cb7662d7 Merge pull request #2995 2026-05-27 03:24:43 +00:00
BonyFish ea3d4ec0b3 feat(cron): dynamic delivery options from API instead of hardcoded select
Replace the hardcoded 4-option deliver dropdown (local/discord/telegram/slack)
with a dynamic select populated from a new GET /api/crons/delivery-options
endpoint that reads _KNOWN_DELIVERY_PLATFORMS from hermes-agent.

Key changes:
- Add GET /api/crons/delivery-options endpoint returning all known platforms
- Frontend loads options asynchronously on first cron form open, with caching
- Enable deliver editing for existing jobs (was previously disabled)
- Include deliver in update payload when editing cron jobs
- Fallback to local-only if API unavailable
- Custom deliver values (e.g. feishu:oc_xxx) shown with * suffix
- Add cron_deliver_custom i18n key to all 12 locales
- Add 5 integration tests for the new endpoint
2026-05-27 10:58:49 +08:00
Frank Song 3a9948d6cf Fix streaming SessionDB profile path 2026-05-27 10:29:31 +08:00
Isla-Liu 20f49e7bda docs(config): address PR #2964 review nits
* Comment alongside _AUTH_FINGERPRINT_VOLATILE_KEYS notes client_secret
  is treated as rotation-only on purpose, not a model-cache
  differentiator (maintainer §Concerns 3).
* _write_auth docstring at tests/test_issue_t16551f61_auth_token_churn_
  fingerprint.py:108 now describes actual behavior (writes + monkeypatch,
  no sleep+restat) — Copilot r3302471228.

Refs #2242. PR #2964 review.
2026-05-27 09:51:32 +08:00
george-andraws f1b04be8f7 Fix WebUI fallback provider chain merging 2026-05-26 17:51:49 -07:00
nesquena-hermes aa6cd48318 Merge pull request #2888
# Conflicts:
#	CHANGELOG.md
#	tests/test_webui_prefill_context.py
2026-05-27 00:38:24 +00:00
nesquena-hermes e0dfa0c586 Merge pull request #2792 2026-05-27 00:37:48 +00:00
nesquena-hermes 244258aa89 Merge pull request #2986 2026-05-27 00:19:00 +00:00
nesquena-hermes 2db584969c Merge pull request #2964 2026-05-27 00:19:00 +00:00
nesquena-hermes 80a9b0fa68 Merge pull request #2985
# Conflicts:
#	CHANGELOG.md
2026-05-27 00:03:02 +00:00
nesquena-hermes f3fbb49ce4 Merge pull request #2983
# Conflicts:
#	CHANGELOG.md
2026-05-27 00:02:47 +00:00
nesquena-hermes f061733c91 Merge pull request #2969
# Conflicts:
#	CHANGELOG.md
2026-05-27 00:02:32 +00:00
ai-ag2026 815df9de76 fix: vendor math and yaml assets for CSP 2026-05-26 23:49:02 +02:00
ai-ag2026 fceb255252 fix(session): anchor message windows on renderable tail rows 2026-05-26 23:37:08 +02:00
george-andraws 65cae8f1a5 Improve sidebar chat search highlighting 2026-05-26 14:17:59 -07:00
dobby-d-elf b74df67726 Make session index pruning explicit 2026-05-26 07:43:16 -06:00
Frank Song 2ff73c9954 Document truncation watermark metadata intent 2026-05-26 20:13:01 +08:00
Frank Song 9db0d6869a fix: keep session switch metadata non-blocking 2026-05-26 16:40:35 +08:00
Isla-Liu ecfa580660 fix(config): exclude credential-rotation fields from models-cache auth.json fingerprint
auth.json is rewritten by credential-pool/OAuth token refresh roughly every
14 minutes. _models_cache_source_fingerprint() hashed it via mtime/size
(#1699 _models_cache_file_fingerprint), so every token refresh churned the
fingerprint and the 24h /api/models cache was effectively dead -- the hot
GET /api/session?resolve_model=1 path paid a cold ~11.5s rebuild every few
minutes (RCA t_d127953d residual #2, t_16551f61).

Add _auth_store_semantic_fingerprint(): content-hash auth.json with a
DENY-list of known credential-rotation-only keys (access/refresh token,
expiry, per-credential status/telemetry, request_count, save updated_at)
stripped. Deny-list (not allow-list) is deliberate -- any unknown field, or
a real provider/endpoint/model-set change (active_provider, a new
credential_pool entry, base_url, source, label, auth_type, the providers{}
block, ...) stays in the fingerprint and still correctly busts the cache.
Conservative fallbacks: missing file -> marked; unreadable/corrupt ->
stat-based fallback (never less safe than pre-fix). config.yaml keeps the
cheap stat fingerprint (deliberate edits, no timer churn).

Bidirectional invariant regression test (non-tautological -- the
end-to-end churn test flips RED when the auth_json axis is reverted to
stat-based): token-only churn keeps fingerprint byte-identical AND keeps a
valid disk cache loadable; active_provider change / new credential_pool
entry / changed base_url each flip the fingerprint AND reject the stale
disk cache. Measured: 5/5 cold rebuilds per 5 refresh cycles -> 0/5.

Tests: 9 new pass; 28 adjacent (#1699/#1633/display-resolver) pass;
54 models_cache/fingerprint suite pass.
2026-05-26 12:46:59 +08:00
dobby-d-elf ca9e821b5e Reduce session index churn on chat start 2026-05-25 16:25:23 -06:00
george-andraws 0f388de09c fix duplicate chat upload filenames 2026-05-25 17:48:19 +00:00
nesquena-hermes 0c6af12723 Merge pull request #2933
# Conflicts:
#	CHANGELOG.md
2026-05-25 17:48:05 +00:00
nesquena-hermes c6869806f0 Merge pull request #2923
# Conflicts:
#	CHANGELOG.md
2026-05-25 17:47:23 +00:00
nesquena-hermes c2fc390723 Merge pull request #2915 2026-05-25 17:46:56 +00:00