From 66057a97f7ac4d0d206dc48df1205030e2ef5790 Mon Sep 17 00:00:00 2001 From: iris Date: Sat, 4 Jul 2026 12:41:18 +0200 Subject: [PATCH] fix(agent-term): split join_room/open_dm cases to fix open_dm always showing ? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit join_room and open_dm shared a fall-through case with (fmtRoom(input.room) || fmtUser(input.user_id) || '?'). fmtRoom() returns the string '?' when input.room is undefined — truthy — so the fmtUser() fallback was never reached and open_dm always displayed 'open_dm* ?'. Split into two separate cases: join_room reads input.room, open_dm reads input.user_id. Both degrade to '?' via fmtRoom/fmtUser's own null guard. --- frontend/packages/agent/src/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/packages/agent/src/app.js b/frontend/packages/agent/src/app.js index 248a70e0..63916293 100644 --- a/frontend/packages/agent/src/app.js +++ b/frontend/packages/agent/src/app.js @@ -1662,8 +1662,9 @@ window.marked = marked; case 'mcp__matrix__send_reaction': return short + ' ' + fmtRoom(input.room) + ' ' + (input.key || '?'); case 'mcp__matrix__join_room': + return short + ' ' + fmtRoom(input.room); case 'mcp__matrix__open_dm': - return short + ' ' + (fmtRoom(input.room) || fmtUser(input.user_id) || '?'); + return short + ' ' + fmtUser(input.user_id); case 'mcp__matrix__invite_user': return short + ' ' + fmtUser(input.user_id) + ' → ' + fmtRoom(input.room); case 'mcp__matrix__download_file':