Skip to content

fix: warn on provider mismatch & fix redundant mobile close button - #333

Closed
ccqqlo wants to merge 3 commits into
nesquena:masterfrom
ccqqlo:main
Closed

fix: warn on provider mismatch & fix redundant mobile close button#333
ccqqlo wants to merge 3 commits into
nesquena:masterfrom
ccqqlo:main

Conversation

@ccqqlo

@ccqqlo ccqqlo commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

This PR solves two issues:

  1. Auth mismatch warnings (401 errors)
    Selecting an OpenRouter model while Hermes is configured for a local provider (or vice-versa) sends the request to the wrong endpoint, which returns a 401 error. This explicitly detects 401/auth errors, preserving the auth_mismatch UI type and surfacing a hint to check hermes model rather than failing silently.

  2. Redundant Workspace Panel close buttons
    When the screen width is <= 900px, both the desktop #btnCollapseWorkspacePanel and the .mobile-close-btn (X) were shown simultaneously in the Workspace header. This explicitly hides the desktop collapse button under mobile widths so only the X is rendered.

@nesquena-hermes

nesquena-hermes commented Apr 12, 2026

Copy link
Copy Markdown
Collaborator

Check the diff/files changed, is this PR doing what you expect it to be doing?

@ccqqlo ccqqlo changed the title fix: warn on provider/model mismatch and surface auth errors fix: warn on provider mismatch, surface auth errors, hide redundant UI close button Apr 13, 2026
@ccqqlo ccqqlo changed the title fix: warn on provider mismatch, surface auth errors, hide redundant UI close button fix: warn on provider mismatch & fix redundant mobile close button Apr 13, 2026
@nesquena

Copy link
Copy Markdown
Owner

Full Review: PR #333

Thanks @ccqqlo!

Note: PR title is misleading

The title says "warn on provider mismatch" but that feature was already merged in PR #283. This PR actually contains:

  1. Auto-title expansion (streaming.py) — triggers auto-title on 'New Chat' and empty titles in addition to 'Untitled'
  2. Mobile close button CSS fix (style.css) — adds .mobile-close-btn{display:none} default and shows it at 900px breakpoint; hides desktop collapse button on mobile

Both changes are correct and useful, just mislabeled.

Security Audit

Clean. The streaming.py change is a string comparison condition — no user input involved. The CSS change is layout-only.

Code Review

streaming.py line 338:

if s.title == 'Untitled' or s.title == 'New Chat' or not s.title:

Correct. 'New Chat' is used as a default title in some session creation paths. not s.title handles None and empty string. The or chain is clear and readable. Low risk — only affects auto-titling, never overwrites user-set titles.

style.css mobile close button:

  • .mobile-close-btn{display:none} at desktop — correct, the button element exists in HTML but should only show on mobile
  • .mobile-close-btn{display:flex} at @media(max-width:900px) — correct
  • #btnCollapseWorkspacePanel{display:none} at 900px — correct, desktop-only control hidden on mobile

The 900px media query reformatting (one-line → multi-line) is a readability improvement.

Tests

735 passed, 0 failed, 48 skipped. No regressions.

Verdict

Approved. Both changes are correct and low-risk. The PR title should be updated to something like "fix: auto-title new/empty sessions + show mobile close button" but that's cosmetic.

nesquena-hermes added a commit that referenced this pull request Apr 13, 2026
* fix(merge): preserve auth errors + fix title auto-generation

* fix(css): hide mobile close button on desktop for workspace panel

* fix: hide duplicate collapse button in mobile workspace panel view

* docs: v0.50.10 — title auto-generation fix + mobile close button (PR #333)

---------

Co-authored-by: MILO <milo@MILOdeMacMINI-2.local>
Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Review complete — merged as v0.50.10 ✅

Code review: Clean. Both changes are minimal and correct.

streaming.py — The expanded title condition ('Untitled' or 'New Chat' or not s.title) is a straightforward widening of the existing guard. 'New Chat' is defensive (not a title used internally), and the not s.title guard covers empty-string edge cases. No risk of accidentally re-titling user-renamed sessions — the comment "preserves user renames" holds because the condition only applies to default-state titles.

style.css.mobile-close-btn{display:none;} at the desktop scope plus the 900px media query overrides are the correct approach. The existing .rightpanel and .mobile-files-btn rules inside that query were preserved. No regressions.

PR description note: The description mentions "auth mismatch warnings" — that code was already in master from PR #283. The actual new code in this PR is the title fix + CSS. Not a problem, just context.

Tests added (not in original PR): tests/test_sprint41.py — 11 tests covering both fixes. All 11 pass on this branch, 6 correctly fail on master before the fix.

QA results:

  • 800/802 tests pass (2 pre-existing failures, both on master before this PR)
  • Full browser API sanity: 20/20 checks pass
  • pre-release-check.sh: ALL CHECKS PASSED

Rebased cleanly onto current master (which had moved to v0.50.9 + zh locale fixes since the PR was filed).

Merged as PR #339 → tag v0.50.10release.

@nesquena

Copy link
Copy Markdown
Owner

@ccqqlo Interested in being a core contributor to this WebUI project? Reach out to me via email (on my profile) or on Twitter if so!

JKJameson pushed a commit to JKJameson/hermes-webui that referenced this pull request Apr 25, 2026
…v0.50.10

* fix(merge): preserve auth errors + fix title auto-generation

* fix(css): hide mobile close button on desktop for workspace panel

* fix: hide duplicate collapse button in mobile workspace panel view

* docs: v0.50.10 — title auto-generation fix + mobile close button (PR nesquena#333)

---------

Co-authored-by: MILO <milo@MILOdeMacMINI-2.local>
Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
…v0.50.10

* fix(merge): preserve auth errors + fix title auto-generation

* fix(css): hide mobile close button on desktop for workspace panel

* fix: hide duplicate collapse button in mobile workspace panel view

* docs: v0.50.10 — title auto-generation fix + mobile close button (PR nesquena#333)

---------

Co-authored-by: MILO <milo@MILOdeMacMINI-2.local>
Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants