From 23cc0dacd1bb021dc413acf42a6e6b54bcc3763a Mon Sep 17 00:00:00 2001 From: webtecnica Date: Sat, 18 Jul 2026 09:51:38 -0300 Subject: [PATCH] fix: intercept /sessions and /resume slash commands in WebUI (#6224) Add a native-intercept branch in the block of send() alongside the /pet special-case. When the user types /sessions or /resume, expand the sidebar and refresh the session list instead of sending the raw slash text to the agent. Root cause: the agent command registry exposes sessions/resume as non-CLI-only commands, so the autocomplete popup shows them, but the WebUI send-time dispatch had no branch to catch them, causing the literal text to be sent as a prompt. --- static/messages.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/messages.js b/static/messages.js index cd763ec00e2..db2a912ff89 100644 --- a/static/messages.js +++ b/static/messages.js @@ -1465,6 +1465,12 @@ async function send(){ renderMessages(); $('msg').value='';autoResize();hideCmdDropdown();return; } + if(_parsedCmd.name==='sessions' || _parsedCmd.name==='resume'){ + // Open the native WebUI session browser rather than sending as chat text (#6224) + if(typeof expandSidebar==='function') expandSidebar(); + if(typeof renderSessionList==='function') await renderSessionList(); + $('msg').value='';autoResize();hideCmdDropdown();return; + } const _agentCmd=typeof getAgentCommandMetadata==='function' ? await getAgentCommandMetadata(_parsedCmd.name) : null;