Skip to content

stage-362: 8-PR follow-up batch — Ollama routing + legacy toolset + cancel copy + cleanup + custom provider mismatch + cron metadata + dead-code removal (with #2323 revert after Opus-caught silent regression) - #2335

Merged
nesquena-hermes merged 21 commits into
masterfrom
stage-362
May 15, 2026

Conversation

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

stage-362 — 8-PR follow-up batch (v0.51.69)

Tenth full PR sweep of the day. Eight PRs in stage-362 — #2323 reverted after Opus caught a silent regression (separately filed as #2334 for follow-up).

+432 / -78 across ~22 files (after #2323 revert).

Composition

Added (1 PR)

Fixed (7 PRs)

Reverted from this stage (Opus-caught silent regression)

Deferred to future sweeps:

Stage-362 maintainer fixes (THE CRITICAL ONE)

#2323 silent profile-routing regression

This was the most important catch of the day. The PR appeared to implement my own #2321 follow-up correctly (thread-local instead of os.environ for background workers — Opus's recommended long-term fix). All targeted tests passed. CI green. The architectural shape made sense.

But Opus did empirical verification by actually running the code path:

os.environ['HERMES_HOME'] = '/tmp/default-home-test'
_set_thread_env(HERMES_HOME='/tmp/work-profile-test')
from hermes_cli.config import get_config_path
# returns: /tmp/default-home-test/config.yaml   ← thread-local ignored

Chain of evidence Opus traced:

  1. agent/auxiliary_client.py:3879 _get_auxiliary_task_config()hermes_cli/config.py:4151 load_config()get_config_path()get_hermes_home() (hermes_constants.py:13) → reads os.environ["HERMES_HOME"] only, no thread-local fallback.
  2. WebUI's own api/config.py thread-local helpers exist, but background-worker threads don't have _tls.profile set (the streaming thread is separate from worker threads).
  3. Pre-fix: isolate background worker profile env #2323 os.environ["HERMES_HOME"] = str(profile_home_path) was the only line that made Fix profile-scoped auxiliary routing for background workers #2299 (stage-360) work.

The three "verifying" tests (test_title_aux_routing.py, test_update_banner_fixes.py, test_sprint46.py) all mock the production reader and don't exercise hermes_cli.config.load_config(). The tests verify the thread-local WAS SET — they don't verify any production code reads it.

Production impact without revert: every non-default-profile session triggering background title generation, manual compression, or update-summary would silently use the default profile's auxiliary config — exact bug #2299 fixed.

Reverted with commit 2161b81d. Filed as #2334 with three options for re-attempt:

Specific review (other 8 PRs)

#2322 — Endpoint-discovered Ollama models

Recognizes custom:<host>-<port>:<model> picker values as UI routing hints when the configured local-server base URL matches; resolves via actual ollama provider instead of looking for CUSTOM_*_API_KEY.

#2330startsWith('custom:') edges

Opus verified:

  • 'custom:' (trailing colon, no name) → matches → skip check. Fails soft on malformed input, matches intent.
  • 'custom:openrouter' (theoretical collision) → matches → skip check. Correct, since named custom is always aggregator-shaped.

#2327 — Bot name fallback

Opus verified (window._botName||'Hermes').trim()||'Hermes' double-fallback handles empty/whitespace bot_name. Both static/messages.js and api/streaming.py mirror the same logic. No regression vs. prior hardcoded "Skyly".

#2328 — Cleanup hardening

  • shutil.rmtree(_session_attachment_dir(sid), ignore_errors=True) handles non-existent dirs cleanly
  • Listener bail (S.session&&S.session.session_id)!==activeSidactiveSid captured in closure, S.session read at firing time — correct scope

#2333 — Dead helper removal

_save_pre_compression_snapshot() reachable only from a test (now retargeted to the production _preserve_pre_compression_snapshot() helper).

Opus surfaced one SHOULD-FIX (non-blocking): branch 2 of _preserve_pre_compression_snapshot() (the load-and-mark-only path, lines 1785-1804 — added in stage-359 as my SHOULD-FIX on Opus's previous review) has runtime-clear semantics that aren't covered by the retargeted test. Both pre-existing tests exercise branch 1 only. Worth adding branch 2 coverage in a follow-up.

Verification

  • Targeted PR tests (13 test files): 284/284 pass in 7.12s
  • Full pytest: 5604 passed, 13 skipped, 1 xfailed, 2 xpassed, 8 subtests passed in 98.08s
  • Post-revert sanity: 110/110 targeted tests pass after fix: isolate background worker profile env #2323 revert
  • run-browser-tests.sh: 20/20 QA + 11/11 API checks PASSED in 103s
  • QA env-lock invariants (stage-360's work): 11/11 pass — no regressions
  • Python + JS syntax: clean across all modified files
  • Conflict markers: zero
  • CI on constituent PRs (latest SHA): 3/3 SUCCESS on each

Opus Advisor Review

After the revert applied, all 8 remaining PRs are SHIP-cleared.

PR Verdict
#2322 SHIP
#2326 SHIP
#2327 SHIP
#2328 SHIP
#2330 SHIP
#2331 SHIP
#2332 SHIP
#2333 SHIP ✓ (one follow-up: branch 2 coverage in _preserve_pre_compression_snapshot)
#2323 REVERTED — refile as #2334 for re-attempt with one of three approaches

Closes / refs

Stats

~22 files changed, ~432 insertions(+), ~78 deletions(-) + 3 maintainer commits (CHANGELOG + #2323 revert + CHANGELOG cleanup)

Michaelyklam and others added 21 commits May 15, 2026 12:16
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>
test: retarget compression snapshot runtime regression (Michaelyklam, closes #2312 item #1)
fix: expand legacy Hermes CLI toolset alias (Michaelyklam, closes #2232)
fix: route endpoint-discovered Ollama models correctly (Michaelyklam)
fix: skip provider mismatch for named custom providers (Michaelyklam)
fix: show readable live activity progress (Michaelyklam)

# Conflicts:
#	CHANGELOG.md
fix: use assistant name in cancel copy (dotBeeps)
feat: show cron output usage metadata (Michaelyklam)
fix: clean session attachment and stream recovery leftovers (Michaelyklam, closes #2325)
fix: isolate background worker profile env (Michaelyklam, closes #2321)

# Conflicts:
#	CHANGELOG.md
…ed for 9-PR stage-362 batch with proper attribution
This reverts commit 0651fe1, reversing
changes made to 1e6ce3d.
@nesquena-hermes
nesquena-hermes merged commit 352064e into master May 15, 2026
3 checks passed
@nesquena-hermes
nesquena-hermes deleted the stage-362 branch May 15, 2026 23:28
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
stage-362: 8-PR follow-up batch — Ollama routing + legacy toolset + cancel copy + cleanup + custom provider mismatch + cron metadata + dead-code removal (with nesquena#2323 revert after Opus-caught silent regression)
bernyforce pushed a commit to bernyforce/hermes-webui that referenced this pull request Jul 29, 2026
stage-362: 8-PR follow-up batch — Ollama routing + legacy toolset + cancel copy + cleanup + custom provider mismatch + cron metadata + dead-code removal (with nesquena#2323 revert after Opus-caught silent regression)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment