Commit Graph

909 Commits

Author SHA1 Message Date
nesquena-hermes a4ab7d4d27 Stage 371: PR #2409 — Stuck-PR sweep: salvage RTL chat from #1721 + override quota chip from #2082 by @malulian and @ai-ag2026
Co-authored-by: malulian <malulian@users.noreply.github.com>
Co-authored-by: ai-ag2026 <ai-ag2026@users.noreply.github.com>
2026-05-16 22:04:56 +00:00
Hermes Agent b937cf3583 Stage 370: PR #2390 — Fix live progress Activity grouping by @franksong2702
# Conflicts:
#	CHANGELOG.md
2026-05-16 20:21:58 +00:00
Hermes Agent ade7401ae1 Stage 369: PR #2396 — fix(streaming): preserve session agents for credential pools by @starship-s 2026-05-16 20:03:44 +00:00
Hermes Agent 757f63ee27 Stage 369: PR #2195 — Add OpenRouter cost history backend by @Michaelyklam 2026-05-16 20:03:43 +00:00
starship-s 727e3c9c8f fix(streaming): preserve session agents for credential pools 2026-05-16 13:05:25 -06:00
Hermes Agent a1da489770 Stage 368: PR #2368 — fix: hybridize background profile env routing by @Michaelyklam 2026-05-16 17:19:07 +00:00
Hermes Agent 57199f16ec Stage 368: PR #2382 — fix: serve raw chat attachments from inbox by @Michaelyklam 2026-05-16 17:19:06 +00:00
Hermes Agent 026a9957f4 Stage 368: PR #2385 — Keep fuller compression snapshots reachable in sidebar by @franksong2702 2026-05-16 17:19:05 +00:00
Hermes Agent e994c8820e Stage 368: PR #2371 — Clarify interrupted turn recovery after WebUI restart by @franksong2702 2026-05-16 17:19:05 +00:00
Frank Song 2dfe3ffb42 Fix live progress activity grouping 2026-05-16 23:37:44 +08:00
Frank Song 4899ae17b9 Keep fuller compression snapshots reachable 2026-05-16 20:58:44 +08:00
Michael Lam e4dad1c25d fix: serve raw chat attachments from inbox 2026-05-16 05:13:58 -07:00
Frank Song c415c843df Update interrupted recovery comment wording 2026-05-16 20:05:47 +08:00
Michael Lam 962b3840e6 fix: strip historical images in text mode 2026-05-16 03:55:12 -07:00
Michael Lam 5bd1f1441d fix: route background worker credentials through profile env 2026-05-16 01:02:19 -07:00
Frank Song 49bea3ad01 Clarify interrupted turn recovery marker 2026-05-16 14:29:58 +08:00
Michael Lam 9894157120 fix: hybridize background profile env routing 2026-05-15 23:19:37 -07:00
BonyFish f82a763dfb fix: support list format for custom_providers.models in model dropdown
The get_available_models() function only handled dict-format models
(`{model_id: {}}`) for custom_providers entries, silently dropping
models specified as YAML lists (`[model1, model2]`) or list of dicts
(`[{id: ..., label: ...}]`).

This caused users who define their custom providers with list-format
model declarations to see zero or incomplete model entries in both
Settings → Preferences → Default Model dropdown and the chat
interface model picker.

The fix adds an `elif isinstance(_cp_models_dict, list)` branch with
support for three list sub-formats:
  - Plain string list: `models: [m1, m2]`
  - Dict list: `models: [{id: m1, label: ...}]`
  - Mixed: `models: [m1, {id: m2}]`

Refs: hermes-agent issue where YAML list models were invisible
2026-05-16 05:43:09 +00:00
Michael Lam 15513b81f4 fix: harden OpenRouter cost snapshots 2026-05-15 21:28:54 -07:00
Michael Lam 690b666887 Add OpenRouter cost history backend 2026-05-15 21:28:54 -07:00
Frank Song 40f69a2b75 Keep recovered pending turns in context 2026-05-16 04:07:02 +00:00
Hermes Agent b293bf8bc5 stage-364: Opus-caught live SSE event_id fix (side-channel approach)
Replace the earlier frontend-reset approach with a backend side-channel
approach that preserves the queue (event, data) tuple shape.

Problem (Opus catch):
- Live SSE frames emitted by _sse() in api/streaming.py:2296 carried no
  'id:' field. Only journal-replay frames (via _sse_with_id) emitted IDs.
- Frontend's _lastRunJournalSeq cursor stayed at 0 during live streaming.
- Mid-stream error → reconnect-to-replay arrived with after_seq=0.
- Server replayed every journaled event from seq 1.
- assistantText (closure-scoped) had accumulated all live tokens already
  → double-rendered output.

Fix:
- api/config.py: STREAM_LAST_EVENT_ID: dict = {} module-level dict.
- api/streaming.py put(): capture journal event_id, write to
  STREAM_LAST_EVENT_ID[stream_id]. Keep queue tuple as (event, data).
- api/routes.py _handle_sse_stream: read STREAM_LAST_EVENT_ID[stream_id]
  at emit time, use _sse_with_id when set.
- api/streaming.py finally block: pop STREAM_LAST_EVENT_ID for cleanup.

Why side-channel instead of 3-tuple:
- Earlier attempt (queue tuple → (event, data, event_id)) broke 4 existing
  tests: test_cancel_interrupt, test_sprint42, test_sprint51,
  test_issue1857_usage_overwrite. These all unpack 'event, data = q.get()'.
- Frontend-reset approach (reset assistantText before replay) broke 3
  other tests: test_smooth_text_fade, test_streaming_markdown,
  test_streaming_race_fix. _wireSSE must NOT reset accumulators because
  legacy reconnect doesn't replay events; only journal-replay does.

Side-channel preserves both invariants:
- Queue contract stays (event, data) — legacy consumers unbroken.
- Frontend accumulators stay alive on _wireSSE — legacy reconnect unbroken.
- Live SSE emits 'id:' so the journal cursor advances correctly.

6 regression tests added in test_stage364_opus_live_sse_event_id.py.
1 existing test (test_run_journal_streaming_static.test_streaming_journals_sse_events_before_queue_delivery) updated to be tuple-shape-agnostic.

Test results:
- Full pytest: 5713 passed, 10 skipped, 1 xfailed, 2 xpassed, 0 failed
- Previously-failing 5 tests: ALL PASS
- 6 new regression tests: ALL PASS
2026-05-16 03:58:54 +00:00
Hermes Agent c0662a4624 Stage 364: PR #2283 — Add WebUI run event journal replay by @franksong2702 2026-05-16 03:08:35 +00:00
Frank Song 80d8d4b42c Address run journal replay review 2026-05-16 02:58:34 +00:00
Frank Song 3b96035af0 Add WebUI run event journal replay 2026-05-16 02:58:34 +00:00
Frank Song 685b075dd0 Avoid touching updated_at during stale stream cleanup 2026-05-16 02:58:33 +00:00
Hermes Agent 0d70ed9e26 Stage 363: PR #2334 — fix: lock turn journal appends by @Michaelyklam 2026-05-16 02:38:53 +00:00
Michael Lam 0e91f89ce3 fix: clear runtime fields on loaded compression snapshots 2026-05-15 17:55:35 -07:00
Michael Lam 4dbf6712dc fix: lock turn journal appends 2026-05-15 16:39:45 -07:00
Hermes Agent 2161b81da2 Revert "Merge pull request #2323 into stage-362"
This reverts commit 0651fe13b0, reversing
changes made to 1e6ce3d2e7.
2026-05-15 23:22:44 +00:00
Hermes Agent 0651fe13b0 Merge pull request #2323 into stage-362
fix: isolate background worker profile env (Michaelyklam, closes #2321)

# Conflicts:
#	CHANGELOG.md
2026-05-15 22:55:39 +00:00
Hermes Agent 1e6ce3d2e7 Merge pull request #2328 into stage-362
fix: clean session attachment and stream recovery leftovers (Michaelyklam, closes #2325)
2026-05-15 22:55:37 +00:00
Hermes Agent 59f73ba45a Merge pull request #2332 into stage-362
feat: show cron output usage metadata (Michaelyklam)
2026-05-15 22:55:36 +00:00
Hermes Agent 62e4d9b2f5 Merge pull request #2327 into stage-362
fix: use assistant name in cancel copy (dotBeeps)
2026-05-15 22:55:35 +00:00
Hermes Agent 5ab2ebed2e Merge pull request #2322 into stage-362
fix: route endpoint-discovered Ollama models correctly (Michaelyklam)
2026-05-15 22:55:30 +00:00
Hermes Agent 8b6673a3d1 Merge pull request #2326 into stage-362
fix: expand legacy Hermes CLI toolset alias (Michaelyklam, closes #2232)
2026-05-15 22:55:29 +00:00
Michael Lam 6799ec56cf test: retarget compression snapshot runtime regression 2026-05-15 15:29:28 -07:00
Michael Lam 8186577c7b feat: show cron output usage metadata 2026-05-15 14:54:20 -07:00
Michael Lam c991f36021 fix: clean session attachment and stream recovery leftovers 2026-05-15 13:30:46 -07:00
Michael Lam 2fdc1d99e2 fix: expand legacy Hermes CLI toolset alias 2026-05-15 13:08:22 -07:00
dot 🐶 3add6f450f fix: use assistant name in cancel copy
Replace the hardcoded Skyly cancellation wording with the configured bot_name from settings, falling back to Hermes when unset.

Keep the client-side fallback in sync by using window._botName if the session refresh after cancellation fails.

Co-authored-by: Obryn 🐉 <obryn-ai@dotbeeps.dev>
2026-05-15 16:00:30 -04:00
Hermes Agent 29d13953d6 stage-361: apply Opus SHOULD-FIX — allow _attachment_root() in _build_native_multimodal_message 2026-05-15 19:55:34 +00:00
Michael Lam ff9e20f132 fix: isolate background worker profile env 2026-05-15 12:47:24 -07:00
Hermes Agent 0a4d9679fc Merge pull request #2319 into stage-361
feat: store chat uploads outside workspace root (Michaelyklam)
2026-05-15 19:17:08 +00:00
Hermes Agent 74ee110b2f Merge pull request #2315 into stage-361
Seed bundled skills for WebUI profile creation (Michaelyklam, closes #2305)

# Conflicts:
#	CHANGELOG.md
2026-05-15 19:17:04 +00:00
Michael Lam 512c401e8a fix: route endpoint-discovered Ollama models correctly 2026-05-15 12:16:23 -07:00
Hermes Agent a8a27eeb7d stage-360: Opus follow-up — update _ENV_LOCK docstring to reflect narrow-lock semantics
Opus stage-360 review caught that the docstring at api/streaming.py:40-43
said 'around the entire agent run' which is no longer accurate after the
narrow-lock refactor. The lock is now held only briefly for the env-mutation
critical section; the agent runs outside the lock and the finally block
re-acquires to atomically restore env vars.

Docstring now points to both narrow-lock implementations as references:
- _run_agent_streaming at line ~2719 (the original pattern)
- profile_env_for_background_worker at api/profiles.py:715 (added stage-360)
2026-05-15 19:05:37 +00:00
Michael Lam 3ead446f14 feat: store chat uploads outside workspace root 2026-05-15 11:52:23 -07:00
Hermes Agent fb0e664a10 stage-360 maintainer fix: narrow _ENV_LOCK to env mutation only in profile_env_for_background_worker
#2299 introduced profile_env_for_background_worker() in api/profiles.py and
changed _ENV_LOCK from threading.Lock() to threading.RLock(). Both changes
were incorrect:

1. RLock masked rather than fixed the underlying deadlock. The QA
   test_env_lock_is_non_reentrant test exists precisely to enforce
   non-reentrance — RLock would let a single thread hold _ENV_LOCK across
   nested critical sections, which hides bugs while still allowing
   different-thread races.

2. The original context manager held _ENV_LOCK for the ENTIRE 'yield'
   duration, meaning the lock was held for the full background worker's
   runtime (title generation, compression, update summary — possibly
   many seconds). That blocked ALL other sessions on _ENV_LOCK, which
   the QA test_third_message_completes runtime test caught as a timeout
   on the third sequential message.

Fix: mirror the narrow-lock pattern from _run_agent_streaming:
  - Acquire _ENV_LOCK only for env mutation (set runtime_env + patch
    skill modules)
  - Release immediately, yield to worker (no lock held)
  - Reacquire in finally to restore env + skill modules

Restored _ENV_LOCK back to threading.Lock(). All 20 QA tests now pass,
including test_third_message_completes (was timing out, now 35s).
2026-05-15 17:11:45 +00:00
Michael Lam b2cbf7bb2f Seed bundled skills for WebUI profile creation 2026-05-15 09:29:46 -07:00