Commit Graph

1013 Commits

Author SHA1 Message Date
nesquena-hermes 73cb3c1948 stage-265: test fix + CHANGELOG for v0.50.265 2026-05-02 03:42:58 +00:00
nesquena-hermes 3de70c52fb Merge PR #1445: feat: add opt-in WebUI extension hooks 2026-05-02 03:42:01 +00:00
Ryan Jones 9de61a0b9a feat: add opt-in webui extension hooks 2026-05-02 03:36:54 +00:00
nesquena-hermes fb66ba5e10 Merge pull request #1444 from nesquena/stage-264
release: v0.50.264 — ja locale, IME Safari fix, fence regex anchoring
v0.50.264
2026-05-01 20:11:08 -07:00
nesquena-hermes e6e9868625 Opus pre-release follow-up: blur resets _imeComposing flag
Opus advisor caught a recoverable footgun in PR #1441's manual flag: if
focus is lost mid-composition (window blur or older Safari WebKit IME
quirk), compositionend may never fire and _imeComposing stays true
until the next full composition cycle. Result: Enter-to-send is
silently broken until page reload — an unrecoverable stuck state for
something that's supposed to be transient.

Add a blur listener that also resets the flag. Cheap belt-and-suspenders
against the stuck state. Adds 1 regression test pinning the listener.

(other Opus findings logged in /tmp/stage-264-brief.md as follow-up
issues: _LOGIN_LOCALE parity for ja/pt/ko, promote _isImeEnter to the
6 other Safari-affected Enter guards in sessions.js + ui.js)
2026-05-02 02:56:48 +00:00
nesquena-hermes 241bdafd28 test: bump locale-count assertions for new ja locale (8 -> >=8/9) 2026-05-02 02:50:40 +00:00
nesquena-hermes 7027c6a50b docs: v0.50.264 release notes 2026-05-02 02:46:16 +00:00
nesquena-hermes 71cf06cd1c test: pr1441 IME helper guards + pr1439 ja locale parity
- Loosen test_ime_composition._ime_guarded_enter_pattern to accept the
  new _isImeEnter(e) helper (PR #1441 widened guard for Safari + 229 keyCode
  + manual _imeComposing flag). Original e.isComposing-only pattern still
  matches via alternation.
- Add test_pr1441_ime_safari_guard.py (6 tests): pin the 3-guard helper,
  compositionstart sets manual flag, compositionend defers reset to next
  tick (Safari race), null-guard $('msg') for non-chat pages, send-Enter
  uses helper, dropdown-Enter uses helper.
- Add test_japanese_locale.py (8 tests): mirror Chinese/Korean templates,
  block exists, representative translations, full key parity with English,
  no extra keys, duplicates mirror en exactly, placeholders preserved,
  arrow-function values mirrored, _label uses Japanese script.
2026-05-02 02:44:59 +00:00
nesquena-hermes cad2d1c0aa Merge PR #1439: feat: add Japanese (ja) locale 2026-05-02 02:42:56 +00:00
nesquena-hermes 641da8b9cc Merge PR #1441: Fix IME composition Enter (East Asian input) 2026-05-02 02:42:49 +00:00
nesquena-hermes e6ee89d3d9 Merge PR #1440: fix(renderer): line-anchor fence regex (#1438) 2026-05-02 02:42:42 +00:00
nesquena-hermes 584974c9d2 fix(renderer): line-anchor fence regex to prevent mid-line ``` corruption (#1438)
The markdown fence regex /```([\s\S]*?)```/g had no line anchoring. A literal
triple backtick inside code block content (e.g. a regex with ``` in a lookbehind,
or a script that documents fences) terminated the outer fence at the wrong place.
The leaked tail then went through bold/italic/inline-code passes, eating `*`
characters as italic markers and emitting literal </strong> tags into the
rendered output.

CommonMark §4.5 requires that an opening code fence be the first non-whitespace
content of a line (up to 3 spaces of indent allowed) and that the closing fence
also start a line. This patch updates 3 sites + the Python mirror to use that
invariant:

  static/ui.js:1559  renderMd() fenced-block stash (assistant messages)
  static/ui.js:66    _renderUserFencedBlocks() (user messages)
  static/ui.js:2599  _stripForTTS() (TTS speech pre-strip)
  tests/test_sprint16.py  Python mirror

Pattern: (^|\n)[ ]{0,3}```(?:([\s\S]*?)\n)?[ ]{0,3}```(?=\n|$)

The non-capturing (?:...\n)? group keeps empty fences (```\n```) working;
without it, a body+\n is required and the closing fence on the very next line
no longer matches. The lead group (^|\n) is prefixed back to the stash token
so paragraphs above don't bleed into the <pre> block.

20 regression tests in tests/test_issue1438_fence_anchoring.py cover:
- Cygnus's exact repro from Discord (May 1 2026)
- Inline ``` mid-paragraph (must not open fence)
- Partial/streaming fence with no close (must not eat content)
- Empty fences with and without language tag
- 3-space indented fences (allowed) vs 4-space (not a fence)
- Multiple adjacent blocks
- Bold/italic/inline-code surviving after a fence
- Source-level guards on all 3 patched sites + lead-prefix invariant

Empirical browser verification (live JS, on bug repro):
  Before fix:  </code></pre>[^\n]<em>|%%[ \t]</em>...   ← truncated, italic leak
  After fix:   <pre><code>...```[^\n]*|%%...</code></pre>  ← intact, regex preserved

Tests: 3678 passed (+20 from new test file, was 3658), 0 failures.

Reported-By: Cygnus (Discord)
Relayed-By: @AvidFuturist
Closes #1438
2026-05-02 02:30:20 +00:00
snuffxxx 14da297cd6 feat: add Japanese (ja) locale to i18n.js
Adds a ja locale entry (828 keys) under static/i18n.js LOCALES,
inserted between en and ru. All existing keys translated to natural
concise Japanese suitable for UI labels, with placeholders ({0}, etc.)
and template literals preserved verbatim.

- _lang: 'ja', _label: '日本語', _speech: 'ja-JP'
- 828 keys (matches en, including the documented duplicate keys
  whose JS last-wins semantics are preserved)
- syntax verified with `node -c static/i18n.js`

Tested live on a self-hosted instance; Settings → Language → 日本語
selects the new locale and switches the UI text.
2026-05-02 11:21:20 +09:00
RZ 39c99b015a Fix IME composition Enter sending message prematurely
East Asian IMEs (Japanese/Chinese/Korean) use Enter to commit composition.
The existing isComposing guard misses Safari, where the committing keydown
fires after compositionend with isComposing=false. Also track composition
manually and check keyCode===229 for broader coverage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:12:14 +09:00
nesquena-hermes 9d0d86be5f Merge pull request #1437 from nesquena/fix/issue-1436-context-indicator-load-path
fix: context-window indicator broken on older sessions (#1436)
v0.50.263
2026-05-01 18:54:13 -07:00
nesquena-hermes 51552e849a docs: v0.50.263 release notes and version bump 2026-05-02 01:52:49 +00:00
nesquena-hermes 081e600b33 fix: context-window indicator broken on older sessions (#1436)
Fix two-layer bug where `/api/session` returned `context_length=0` for
sessions that pre-date #1318, then the frontend silently fell back to
cumulative `input_tokens` and the 128K JS default, producing nonsense
indicators like "100" capped from "890% used (context exceeded), 1.2M
/ 131.1k tokens used".

Empirical impact: 23 of 75 sessions on dev server rendered >100% before
this fix. #1356 fixed the same symptom on the live SSE path but missed
the GET /api/session load path that older sessions go through.

Two-layer fix:
  1. Backend (api/routes.py:1295-1313) — resolve context_length via
     agent.model_metadata.get_model_context_length() when the persisted
     value is 0. Mirrors api/streaming.py:2333-2342.
  2. Frontend (static/ui.js:1269) — drop the cumulative `input_tokens`
     fallback. When last_prompt_tokens is missing, render "·" + "tokens
     used" (existing !hasPromptTok branch) instead of computing a
     percentage from the cumulative total.

10 regression tests in tests/test_issue1436_context_indicator_load_path.py
covering both layers + the empty-model edge case (avoids the 256K
default-for-unknown-model trap that get_model_context_length('') returns).

Verified live: claude-opus-4-7 session with input_tokens=5,226,479 now
renders "·" + "5.3M tokens used" instead of "100" + "3987% used".

Reported by @AvidFuturist.
Closes #1436.
2026-05-02 01:43:00 +00:00
nesquena-hermes c8f2daa990 Merge pull request #1435 from nesquena/fix/profile-autocapitalize-and-newchat-guard
fix: new-chat guard ignores in-flight streams (#1432) + profile form auto-capitalizes (#1423)
v0.50.262
2026-05-01 18:04:09 -07:00
nesquena-hermes 2ec15a4345 docs: v0.50.262 release notes and version bump
- CHANGELOG: stamp [Unreleased] -> [v0.50.262] dated 2026-05-02
- ROADMAP: bump 'Last updated' to v0.50.262 / 3648 tests
- TESTING: bump test count 3309 -> 3648 in header and footer + date
2026-05-02 01:02:23 +00:00
nesquena-hermes 26d0f45791 fix: new-chat guard ignores in-flight streams (#1432) + profile form auto-capitalizes typed values (#1423)
Two unrelated UX bugs, both small surgical fixes with regression tests.

Issue #1432 — "+" button doesn't open new chat during streaming
================================================================
Reported by @Olyno: clicking "+" after sending a first message keeps
redirecting to the same chat instead of opening a new blank conversation,
making parallel chats impossible until the first response finishes.

Root cause:
  static/boot.js:691 (and the Cmd/Ctrl+K branch at :844) had an empty-session
  guard from #1171 that skipped newSession() when message_count===0:

    if(S.session && (S.session.message_count||0)===0){
      $('msg').focus(); closeMobileSidebar(); return;
    }

  But during the first user turn of a brand-new session, message_count is
  still 0 server-side because the user message hasn't been merged into
  s.messages yet. The guard treated that as "empty" and silently dropped
  the click, blocking parallel chats for the entire stream duration.

Fix:
  Tighten the predicate to also exclude in-flight state:

    if(S.session
       && (S.session.message_count||0)===0
       && !S.busy
       && !S.session.active_stream_id
       && !S.session.pending_user_message){
      $('msg').focus(); closeMobileSidebar(); return;
    }

  Same predicate applied to the Cmd/Ctrl+K handler at :844. The in-flight
  signal (active_stream_id || pending_user_message) is the same one
  _restoreSettledSession() in messages.js:1081 already uses to decide
  whether a session is "settled" — keeping both call sites aligned.

  Verified end-to-end: with S.busy=true and pending_user_message set, the
  old guard returned `block=true` (= the bug), the new guard returns
  `block=false` (= fixed). With a truly empty session (no busy, no pending),
  both old and new guards still block — preserving #1171 behavior.

Issue #1423 — Profile name field auto-capitalizes typed values
==============================================================
Self-reported (Mac app, May 1 2026): typing `hello` into the New Profile
"Name" field shows `Hello` after blur/autofill, contradicting the
"Lowercase letters, numbers, hyphens, underscores only" hint right next
to it. The form lowercases on submit so stored data is correct, but the
displayed value during typing is misleading.

Root cause:
  static/panels.js:2532 had only autocomplete="off":

    <input type="text" id="profileFormName"
           placeholder="..." autocomplete="off" required>

  Missing three attributes that actually prevent the misbehavior:
  - autocapitalize="none" — mobile keyboards (iOS Safari, Android Chrome,
    WKWebView in the Mac app) auto-capitalize the first letter without it
  - autocorrect="off" — Safari runs autocorrect on blur, can rewrite hello→Hello
  - spellcheck="false" — desktop browsers may run spellcheck on blur

Fix:
  Add the three attributes to profileFormName. Also added to
  profileFormBaseUrl since URLs are similarly bad targets for
  autocapitalize/autocorrect. profileFormApiKey is type="password" and
  already has correct browser behavior.

  Verified end-to-end against the live DOM: openProfileCreate() →
  getElementById('profileFormName').getAttribute(...) returns the new
  attributes correctly, with required preserved.

Tests
-----
3648 passed, 2 skipped, 3 xpassed (was 3640 — added 8 new regression tests
in test_1432_newchat_and_1423_profile_input.py).

One pre-existing test had to be widened: tests/test_mobile_layout.py
test_new_conversation_closes_mobile_sidebar grabbed only the first 500
chars of the btnNewChat handler block to scan for closeMobileSidebar.
The new comment block pushed closeMobileSidebar past that window even
though both calls are still present. Bumped the window to 1500 chars
and the shortcut-block lines from 12 to 24 to match the multi-line guard.

Closes #1432
Closes #1423

Reported by @Olyno (#1432, GitHub)
2026-05-02 00:52:41 +00:00
nesquena-hermes 0dd4dd39c4 Merge pull request #1434 from nesquena/stage-261
v0.50.261: composer-footer toolsets chip responsive (replaces #1433)
v0.50.261
2026-05-01 17:23:38 -07:00
nesquena-hermes 8ceeef3716 Apply Opus pre-release fixes: dropdown resize guard + display:block
Three fixes from Opus advisor review of stage-261:

1. CRITICAL: dropdown-survives-resize bug. The composerToolsetsDropdown is a
   DOM sibling of composerToolsetsWrap, not a child, so CSS hiding the wrap
   does not cascade-hide an open dropdown. If a user opens the dropdown at
   composer-footer >= 1100px and then opens the workspace panel (or resizes
   the window), the dropdown would stay open without a visible anchor.

   Fixed in three places (defense-in-depth):
   - resize listener: closes dropdown when chip.offsetParent === null
   - _positionToolsetsDropdown: closes if chip hidden (defense-in-depth)
   - toggleToolsetsDropdown: early-returns if chip hidden (defense against
     future #1431 redesign code that might invoke from elsewhere)

2. MEDIUM: display:flex changed to display:block to match sibling wraps
   (.composer-profile-wrap, .composer-model-wrap, .composer-reasoning-wrap
   all use the natural block display).

3. Added 3 new regression tests to pin all three guards.

Refs #1431, #1433.
2026-05-02 00:21:15 +00:00
nesquena-hermes a6884ca40f Make composer-footer toolsets chip responsive instead of always-hidden
Replaces PR #1433 unconditional JS display:none with a CSS @container query
that shows the chip only at composer-footer widths >= 1100px. JS now clears
inline style instead of setting display:none, so the CSS responsive cascade
is the single source of truth. Also removed inline style=\"display:none\" from
index.html so the CSS base rule provides the default-hidden state.

10 regression tests pin the base hide, wide-container show, narrow-container
hide (520px container query), mobile viewport hide (640px @media), JS does
not force display:none, JS clears inline style, /api/session/toolsets and
the dropdown machinery (toggleToolsetsDropdown, _populateToolsetsDropdown)
are preserved.

Refs #1431, #1433.
2026-05-02 00:04:12 +00:00
nesquena-hermes daba5413df Merge PR #1433 from nesquena-hermes: hide composer-footer toolsets chip (refs #1431) 2026-05-01 23:58:22 +00:00
Hermes Agent 4f50cb2511 Reference correct issue number (#1431) in comment + CHANGELOG 2026-05-01 23:47:46 +00:00
Hermes Agent 4adbb5ebee Hide composer-footer toolsets chip (cramped layout)
The session-toolsets restriction chip (#493) was making the composer
footer too cramped on narrower widths once it was sharing space with
model, reasoning effort, profile, and context-usage indicators.

Surgical fix: `_applyToolsetsChip()` now sets the wrap to display:none
unconditionally. Underlying state and the /api/session/toolsets endpoint
still work, so any cron job or scripted client that relies on
`enabled_toolsets` continues unaffected. To be revisited when the
footer layout is redesigned (#1430).
2026-05-01 23:47:13 +00:00
nesquena-hermes ee3717a758 Merge pull request #1429 from nesquena/stage-260
v0.50.260 — Docker reliability overhaul (PR #1428 + UX/docs + Opus follow-up)
v0.50.260
2026-05-01 16:12:46 -07:00
nesquena-hermes b57525241b v0.50.260: Docker reliability batch - PR #1428 + broader UX/docs improvements + Opus advisor fixes
Combines PR #1428 (UID/GID alignment) with a broader Docker reliability pass
that addresses recurring user reports about compose files not working.

Constituent PR:
- #1428 sunnysktsang - Align agent UID/GID with webui (fixes #1399).
  Two- and three-container compose files had agent at UID 10000 (image
  default) and webui at UID 1000 (WANTED_UID default), causing permission
  denied on shared hermes-home volume. All services now use ${UID:-1000}.

Plus broader Docker UX overhaul:
- All 3 compose files document HERMES_SKIP_CHMOD/HERMES_HOME_MODE escape
  hatches inline (the v0.50.254 fix wasn't surfaced for Docker users).
- New .env.docker.example template covering UID/GID, paths, password,
  permission handling. UID/GID are uncommented with placeholder values
  per Opus advisor (so macOS users don't skim past).
- New docs/docker.md - comprehensive guide: 5-min quickstart, failure
  mode table with one-line fixes, bind-mount migration, multi-container
  architecture diagram, macOS Docker Desktop VirtioFS note, link to
  community sunnysktsang/hermes-suite all-in-one image.
- README Docker section rewritten - clearer quickstart, failure-mode
  table, link to docs/docker.md. Stale /root/.hermes references removed.

Plus Opus pre-release advisor MUST-FIX:
- HERMES_HOME_MODE has DIFFERENT semantics in the WebUI vs the agent
  image. WebUI: credential-file mode threshold (0640 allows group bits).
  Agent: HERMES_HOME directory mode (default 0700). 0640 on a directory
  has no owner-execute bit, so the agent can't traverse its own home and
  bricks. My initial draft recommended HERMES_HOME_MODE=0640 in agent
  service blocks - corrected to 0750 across all 4 surfaces (compose
  files, .env.docker.example, docs/docker.md). 3 regression tests pin
  the asymmetry.

12 regression tests total in test_v050260_docker_invariants.py.
Full suite: 3627 passed, 0 failed.

Nathan explicitly authorized merge with my own review + Opus only, no
independent review needed.
2026-05-01 23:10:52 +00:00
nesquena-hermes 1e9aaac809 Merge PR #1428 from sunnysktsang: align agent UID/GID with webui in compose files (#1399) 2026-05-01 22:54:54 +00:00
nesquena-hermes c0d50b3828 Merge pull request #1427 from nesquena/stage-259
v0.50.259 — SessionDB FD-leak hotfix (#1421) + LRU-eviction Opus follow-up
v0.50.259
2026-05-01 15:46:27 -07:00
nesquena-hermes 69ab856d37 test fix: skip test_session_db_close_is_idempotent when hermes_state not on import path
CI-only failure: test_session_db_close_is_idempotent imported hermes_state
from /home/hermes/.hermes/hermes-agent which exists locally but NOT on the
GH Actions runner that only has the WebUI repo.

Use importlib.util.find_spec to detect availability and pytest.skip when
the agent repo isn't present. The source-level pin in
test_cached_agent_reuse_closes_old_session_db catches revert of the close()
call; the runtime idempotency test is added confirmation when both repos
are co-located.

Local: 5 passed. CI: 4 passed + 1 skipped (idempotency).
2026-05-01 22:45:18 +00:00
sunnysktsang 777a672ce5 fix: align agent UID/GID with webui in compose files (#1399)
Both docker-compose files had a UID mismatch between the agent
(defaults to 10000) and webui (defaults to 1000). When containers
share a volume, the webui gets Permission denied reading files
written by the agent.

- docker-compose.two-container.yml: add HERMES_UID/HERMES_GID
  (was missing entirely)
- docker-compose.three-container.yml: change default from 10000
  to 1000 to match webui's WANTED_UID/WANTED_GID

Fixes #1399
2026-05-02 06:44:25 +08:00
nesquena-hermes c75ce33280 v0.50.259: Opus pre-release follow-up — close _session_db on LRU eviction + CHANGELOG + 5 regression tests
PR #1421 (SessionDB WAL handle leak fix on cached-agent reuse path) had a
sibling leak at the LRU eviction site that I caught during pre-review:

api/streaming.py SESSION_AGENT_CACHE.popitem(last=False) was discarding
the evicted entry with `evicted_sid, _ = ...`. The agent's _session_db
was dropped on the floor and only released when GC eventually finalized
the agent — which on a long-running server may be never (cyclic refs,
extension types holding C handles, etc.).

Same fix shape as #1421: capture the evicted entry, call
_evicted_agent._session_db.close() explicitly. SessionDB.close() is
idempotent + thread-safe (with self._lock: if self._conn:), so the
double-close-is-benign property still holds.

5 regression tests in test_v050259_sessiondb_fd_leak.py:
- Source-level: cached-agent reuse path closes before replace
- Source-level: LRU eviction path captures + closes evicted agent
- Behavioral: SessionDB.close() is idempotent (3 calls safe)
- Behavioral: cached-agent reuse with mock — close called exactly once
- Behavioral: LRU eviction with mock — only evicted agent's DB closes

Full suite: 3615 passed, 0 failed.

Nathan explicitly authorized 'just go ahead and merge it as a small release'
since the PR is 9 LOC, focused, has Opus pre-release follow-up + tests, and
matches the empirically-confirmed leak shape (73-handle leak at EMFILE).
2026-05-01 22:42:53 +00:00
nesquena-hermes f05893215e Merge PR #1421 from wali-reheman: close previous SessionDB before replacing on cached agent 2026-05-01 22:38:53 +00:00
nesquena-hermes 2ae07ba906 Merge pull request #1422 from nesquena/stage-258
v0.50.258 — login stability batch (#1419) + redirect-encoding Opus follow-up
v0.50.258
2026-05-01 15:30:49 -07:00
nesquena-hermes 399f12ac96 v0.50.258: Opus follow-up — fix multi-param redirect-encoding bug + CHANGELOG
PR #1419 (login session TTL + redirect-back + connectivity probe) had a
real bug in the server-side ?next= construction:

quote(path, safe='/:@!$&'()*+,;=') keeps ? and & literal, so:

(a) /api/sessions?limit=50&offset=0 round-trips as /api/sessions?limit=50
    — the inner & terminates the outer next= value and offset=0 leaks as
    a top-level outer query the login page ignores.

(b) An attacker-controlled path with embedded &next=https://evil.com
    injects a second top-level next parameter. Browsers parse first-match
    (benign), Python parse_qs parses last-match (the evil URL) — the
    parser-divergence is a footgun even though _safeNextPath() in login.js
    rejects the actual exploit.

Fix: encode the entire path?query blob with safe='/' so ?, &, = all
percent-encode. The outer next then holds exactly one path-with-query
string the browser auto-decodes once.

6 regression tests in test_v050258_opus_followups.py pin round-trip behavior
across simple paths, single-query, multi-param queries, attacker-injection
neutralization, and the SESSION_TTL=30d constant.

Full suite: 3610 passed, 0 failed.
2026-05-01 21:30:10 +00:00
nesquena-hermes ba33dbd7bc Merge PR #1419 from bsgdigital: login session TTL + redirect-back + connectivity probe 2026-05-01 21:26:35 +00:00
Wali Reheman 9b987eefb0 fix: close previous SessionDB before replacing on cached agent
SessionDB WAL handles leak when streaming.py creates a new SessionDB
instance per request and replaces the cached agent's _session_db without
closing the old one. Each orphaned connection holds 2 FDs (.db +
.db-wal), causing FD exhaustion and EMFILE crashes after ~73 messages.

Fix: close the previous _session_db before replacing it on cached
agents, mirroring the close-before-replace pattern used elsewhere in the
codebase.
2026-05-01 13:51:21 -07:00
bsgdigital fa0ac9f3e7 fix(login): retry connectivity probe every 3s, auto-reload when server recovers
When the server is unreachable (VPN/Tailscale off), the login page now
polls /health every 3 seconds instead of failing silently. Once the
server becomes reachable, the page reloads automatically so the user
doesn't have to manually refresh.
2026-05-01 19:54:47 +00:00
bsgdigital af3d26f141 fix(login): probe /health on load, show VPN error if unreachable 2026-05-01 19:54:47 +00:00
bsgdigital 9c0667d187 fix(auth): extend session TTL to 30 days + redirect back after login 2026-05-01 19:54:47 +00:00
nesquena-hermes 101c2b47c5 Merge pull request #1417 from nesquena/stage-257
v0.50.257 — batch release: 2 PRs (#1402 + #1415) + 5 Opus follow-ups (1 CRITICAL)
v0.50.257
2026-05-01 12:04:16 -07:00
nesquena-hermes c78bcddda6 v0.50.257: CRITICAL Opus finding — fix non-functional per-session toolset override
Opus pre-release advisor caught a 5th issue not covered by my initial
follow-up sweep, this one CRITICAL: PR #1402 #493 per-session toolset
override silently no-op'd every time.

Bug: api/streaming.py:1755 called _session_meta.get('enabled_toolsets') on
the result of Session.load_metadata_only(). It returns a Session INSTANCE,
not a dict. .get() raised AttributeError, which the surrounding bare
except swallowed silently. The toolset chip in the UI saved correctly to
disk, but the streaming agent always ran with global toolsets.

Fix: use getattr(_session_meta, 'enabled_toolsets', None).

Two new regression tests:
- Source-level: forbid the .get() / [] dict-access shape.
- Runtime: Session.load_metadata_only must return a Session instance.

Full suite: 3604 passed, 0 failed.
2026-05-01 18:36:24 +00:00
nesquena-hermes f8007d43f3 v0.50.257: 4 Opus pre-release follow-ups + CHANGELOG + test fixes for #1415
stage-257 batch (PRs #1402 + #1415):

Opus pre-release advisor caught 4 issues in stage-257:

1. MUST-FIX (security): api/oauth.py::_write_auth_json — tmp.replace()
   preserves the temp file umask (0644 default), so OAuth access/refresh
   tokens landed world-readable on shared systems. Fix: tmp.chmod(0o600)
   BEFORE rename, with try/except OSError that warns but does not abort.

2. SHOULD-FIX: _handle_cron_history and _handle_cron_run_detail accepted
   job_id as a path component without validation. Mirrors the rollback
   path-traversal vector caught in v0.50.255 (#1405). Path() / .. does NOT
   normalize. New regex ^[A-Za-z0-9_-][A-Za-z0-9_.-]{0,63}$ with explicit
   . / .. rejection.

3. SHOULD-FIX: _handle_cron_history int(offset)/int(limit) raised
   ValueError on malformed input → confusing 500. Now try/except + clamp
   to (max(0, offset), max(1, min(500, limit))).

4. NIT: same regex applied to _handle_cron_run_detail (defense-in-depth
   even though path-resolve check would catch it downstream).

PR #1415 follow-up: 8 pre-existing tests in test_issue1106 and
test_custom_provider_display_name asserted bare model IDs but #1415
changes named-custom-provider IDs to @custom:NAME:model form when active
provider differs. Tests updated to use _strip_at_prefix helper to keep
checking the same invariant in the new shape.

4 regression tests in test_v050257_opus_followups.py + 8 fixed pre-existing
tests. Full suite: 3602 passed, 0 failed.
2026-05-01 18:30:41 +00:00
nesquena-hermes 42d4070e2d Merge PR #1415 from Thanatos-Z: fix named custom provider routing in model picker 2026-05-01 18:20:07 +00:00
nesquena-hermes bc17229a7d Merge PR #1402 from bergeouss: P2 improvements — cron history, toolsets per session, Codex OAuth
# Conflicts:
#	static/i18n.js
2026-05-01 18:20:05 +00:00
youzhi 59e07f3fff Fix WebUI custom provider routing 2026-05-02 02:11:41 +08:00
nesquena-hermes 29f77c4b6e Merge pull request #1414 from nesquena/fix-tts-volume-icon
fix: register 5 missing Lucide icons (TTS speaker + queue chevron + insights cards) (#1413)
v0.50.256
2026-05-01 11:01:24 -07:00
nesquena-hermes 0f594ec714 fix: register 5 missing Lucide icons (TTS speaker + queue chevron + insights cards) (#1413)
The li() helper in static/icons.js logs console.warn and returns ''
when an icon name is not in LI_PATHS. Five icon names referenced by
static/*.js were never registered, so their host elements rendered as
empty 0-size buttons / containers despite display:flex.

Five missing icons added:

  - 'volume-2'    — TTS speaker on every assistant message
                    (ui.js:3376; regression from #499; surfaced after
                    #1411 fixed CSS specificity in v0.50.255)
  - 'chevron-up'  — queue pill chevron (ui.js:2178; the '▲' fallback
                    only fired when li was undefined, not when it
                    returned '')
  - 'hash'        — Insights 'Messages' stat card (panels.js:883)
  - 'cpu'         — Insights 'Tokens' stat card (panels.js:884)
  - 'dollar-sign' — Insights 'Cost' stat card (panels.js:885)

The Insights icons are a fresh regression from #1405 (v0.50.255).

Adds tests/test_issue1413_li_path_coverage.py — three tests:

  1. Walk every li('NAME', ...) call across static/*.js, assert NAME
     is registered in LI_PATHS. Prevents the entire class of bug.
  2. Pin the five icons added by this fix so removal gets a clear
     error message.
  3. Pin the warn+empty-string contract of li() so the diagnostic
     story in the test docstring stays accurate.

Reported by @AvidFuturist via Telegram, 2026-05-01.

Fixes #1413
2026-05-01 17:57:34 +00:00
nesquena-hermes 101d02a3e9 Merge pull request #1412 from nesquena/stage-255
v0.50.255 — batch release: 2 PRs (#1390 + #1405) + 4 Opus follow-ups
v0.50.255
2026-05-01 10:40:10 -07:00