mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-26 03:30:36 +00:00
fix: hide nonfatal pre-start send warnings
This commit is contained in:
@@ -216,6 +216,16 @@ function _clearStaleBusyStateBeforeSend({compressionRunning=false}={}){
|
||||
return true;
|
||||
}
|
||||
|
||||
function _runOptionalPreStartUiStep(label, fn){
|
||||
try{
|
||||
return typeof fn==='function'?fn():undefined;
|
||||
}catch(e){
|
||||
const message=e&&e.message?e.message:String(e||'unknown error');
|
||||
try{console.warn('[webui] optional pre-start UI step failed', label, message);}catch(_){ }
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function _sessionTitleLooksDefaultOrProvisional(titleText, provisionalText){
|
||||
const title=String(titleText||'').replace(/\s+/g,' ').trim();
|
||||
if(!title||title==='Untitled'||title==='New Chat')return true;
|
||||
|
||||
@@ -78,6 +78,10 @@ def test_pre_start_optimistic_ui_helpers_cannot_block_chat_start():
|
||||
assert "try" in helper_body and "catch" in helper_body, (
|
||||
"optional pre-start UI helper wrapper must catch errors before /api/chat/start"
|
||||
)
|
||||
assert "setStatus(`UI warning before send:" not in helper_body, (
|
||||
"non-fatal pre-start UI helper failures should stay in the console; visible status flashes "
|
||||
"look like real send errors even though /api/chat/start continues"
|
||||
)
|
||||
assert "_runOptionalPreStartUiStep" in pre_start, (
|
||||
"send() should wrap optimistic sidebar/title/polling helpers before /api/chat/start"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user