feat(agent-term): show details for plugin_install and commands_changed

Currently both system subtypes fall through to the generic muted
note renderer (⚙ <subtype>), giving the operator no insight into
what is happening.

plugin_install:
  Render status explicitly — "loading…" on started, "✓ done" on
  completed — so a slow plugin boot is visible in the scrollback
  instead of two identical cryptic rows.

commands_changed:
  Render the count of available slash commands in the summary row
  and expand to the full list in a collapsible details block. The
  list is most useful right after a fresh plugin_install so the
  operator can see exactly which /commands are now on offer.

Both handlers sit immediately before the generic catch-all in the
system-subtype dispatch in renderStream, preserving the existing
fall-through for other subtypes (context_window_exceeded etc.).

Closes #2183.
This commit is contained in:
iris 2026-07-04 11:43:11 +02:00 committed by mara
commit 44531820d0

View file

@ -1809,6 +1809,34 @@ window.marked = marked;
}
return;
}
// plugin_install: claude is loading/finishing a plugin (MCP server or
// slash-command provider). Show the status so the operator knows when
// a fresh session is loading its toolset.
if (v.subtype === 'plugin_install') {
const status = v.status === 'completed' ? '✓ done'
: v.status === 'started' ? 'loading…'
: (v.status || '?');
api.row('note', '⚙ plugin install · ' + status);
return;
}
// commands_changed: the set of available slash commands changed (usually
// right after plugin_install). Show the count in the summary; expand to
// see the full list.
if (v.subtype === 'commands_changed') {
const cmds = Array.isArray(v.commands) ? v.commands : [];
if (!cmds.length) {
api.row('note', '⚙ commands changed · (empty)');
return;
}
const summary = '⚙ commands changed · ' + cmds.length + ' available';
const body = cmds.map((c) => {
const aliases = c.aliases && c.aliases.length
? ' [/' + c.aliases.join(', /') + ']' : '';
return '/' + c.name + aliases;
}).join('\n');
api.details('note', summary, body);
return;
}
// Other system subtypes (context_window_exceeded, etc.) — render a
// muted note with the subtype label; reserve the loud orange `sys`
// catch-all for truly unrecognised top-level types.