Commit Graph

234 Commits

Author SHA1 Message Date
nesquena-hermes 7c3dcce1d0 Stage 388: PR #2598 2026-05-20 00:17:47 +00:00
AJV20 612fcd30fe fix: avoid duplicate live tool events 2026-05-19 18:41:08 -04:00
nesquena-hermes e63de7c15f Stage 387: PR #2593
# Conflicts:
#	CHANGELOG.md
2026-05-19 22:08:56 +00:00
AJV20 ebb4dffc7d fix: stream live tool callback events 2026-05-19 14:55:19 -04:00
nesquena-hermes 6c0f864b10 Stage 386: PR #2587
# Conflicts:
#	CHANGELOG.md
2026-05-19 18:20:47 +00:00
nesquena-hermes 86f52f67b8 Stage 386: PR #2581
# Conflicts:
#	api/streaming.py
2026-05-19 18:20:47 +00:00
nesquena-hermes 0585881511 Stage 386: PR #2583 2026-05-19 18:20:07 +00:00
Michael Lam 0736e45485 fix: dedupe tool-only partial recovery markers 2026-05-19 11:16:21 -07:00
Lumen Yang a8d429775c fix(webui): preserve casual chat compaction guard 2026-05-19 14:34:58 +00:00
AJV20 f93e288214 Fix stale stream recovery writeback race 2026-05-19 10:26:45 -04:00
dobby-d-elf 2a95c1e482 Fix profile-aware assistant display names 2026-05-19 07:17:11 -06:00
starship-s 2e9ca283dc fix: display canonical cache hit percentage 2026-05-19 02:27:12 -06:00
Lumen Yang 6ca63e5815 perf(webui): keep external refresh metadata cheap 2026-05-19 08:02:43 +00:00
Lumen Yang 467ef33a24 feat(webui): reconcile external session updates
When API server runs append messages directly to state.db, reconcile WebUI sidecar sessions with those canonical rows across API responses, model-facing streaming context, and active browser refresh.

Add append-only state.db merge helpers, metadata-only counts for refresh polling, and regression coverage for API visibility, context incorporation, and frontend refresh behavior.
2026-05-19 08:02:43 +00:00
Dennis Soong ea978a1989 fix: surface auto-compression handoff 2026-05-19 10:45:43 +08:00
nesquena-hermes 91099051c6 Stage 384: PR #2505
# Conflicts:
#	CHANGELOG.md
2026-05-18 22:44:02 +00:00
Michael Lam e94827f460 fix: stop replaying reasoning-only history 2026-05-18 10:50:42 -07:00
Hermes Agent 42b97d15f6 fix: clear fallback streaming warnings 2026-05-18 12:21:59 -05:00
Michael Lam f3f9f3ed40 fix: allow keyless named custom endpoints 2026-05-18 04:27:31 -07:00
nesquena-hermes 935d9e6402 Stage 379: PR #2461
# Conflicts:
#	CHANGELOG.md
2026-05-17 23:35:18 +00:00
swftwolfzyq b2ee7e365f Merge latest origin/master into codex/workspace-prefix-display-fix 2026-05-17 23:44:16 +08:00
swftwolfzyq 3553e63a51 Merge origin/master into codex/workspace-prefix-display-fix 2026-05-17 23:39:12 +08:00
starship-s 625d8d02fd fix: preserve memory lifecycle mark ordering 2026-05-17 05:16:46 -06:00
starship-s eb70a6dc5d fix: align WebUI memory commits with CLI boundaries 2026-05-17 05:04:57 -06:00
starship-s aecad0f427 [verified] Fix WebUI memory session lifecycle commits 2026-05-17 03:30:06 -06:00
nesquena-hermes 47c210899e Stage 374: PR #2421 — fix(cache-tokens): surface provider prompt-cache read/write tokens in WebUI usage by @Michaelyklam (fixes #2419)
Co-authored-by: Michael Lam <michael@example.local>
2026-05-17 02:49:34 +00:00
nesquena-hermes 8a950cfbdd Stage 373: PR #2417 — fix(streaming): stale compaction task resume on fresh greetings (closes #2308, supersedes #2309)
Co-authored-by: Frank Song <franksong2702@gmail.com>
2026-05-17 00:22:22 +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
starship-s 727e3c9c8f fix(streaming): preserve session agents for credential pools 2026-05-16 13:05:25 -06:00
Frank Song 2dfe3ffb42 Fix live progress activity grouping 2026-05-16 23:37:44 +08:00
Michael Lam 962b3840e6 fix: strip historical images in text mode 2026-05-16 03:55:12 -07: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
Frank Song 3b96035af0 Add WebUI run event journal replay 2026-05-16 02:58:34 +00:00
Michael Lam 0e91f89ce3 fix: clear runtime fields on loaded compression snapshots 2026-05-15 17:55:35 -07: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
Michael Lam 6799ec56cf test: retarget compression snapshot runtime regression 2026-05-15 15:29:28 -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
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
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
Hermes Agent 3b05929f1a Merge pull request #2299 into stage-360
Fix profile-scoped auxiliary routing for background workers (starship-s)
2026-05-15 16:15:39 +00:00
Hermes Agent b2ebbebf01 Merge pull request #2279 into stage-360
Fix WebUI stream completion recovery gaps (franksong2702, closes #2262 + #2168)
2026-05-15 16:15:38 +00:00
Hermes Agent 75a2464821 stage-359: apply Opus SHOULD-FIX — symmetric runtime-field clearing on snapshot load-and-mark path 2026-05-15 15:27:24 +00:00
Hermes Agent fb8b91019e Merge pull request #2295 into stage-359
fix: clear runtime fields on compression snapshots (ai-ag2026)

# Conflicts:
#	CHANGELOG.md
#	api/streaming.py
2026-05-15 15:06:35 +00:00
Hermes Agent 4826a31fbc Merge pull request #2285 into stage-359
fix: hide pre-compression snapshots from sidebar (dso2ng, refs #2230)

# Conflicts:
#	CHANGELOG.md
2026-05-15 14:55:19 +00:00
starship-s abb6057304 test(profiles): keep profile module reloads isolated 2026-05-15 04:14:09 -06:00
Frank Song cadcf983d5 Tighten silent failure shrink detection 2026-05-15 18:04:53 +08:00
starship-s 4ffecdd7c9 refactor(profiles): consolidate background profile env 2026-05-15 03:58:40 -06:00
Dennis Soong eb31b4ed1e test: tighten compression snapshot preservation coverage 2026-05-15 17:31:37 +08:00