Files
scarf/scarf
Alan Wizemann 096dbe085e feat(chat): richer slash menu in resumed sessions; preserve agent commands across reset
Two fixes uncovered by v2.8.0 dogfooding when clicking a previous chat
in the sidebar (vs. starting a new one):

1. **Preserve `acpCommands` across `RichChatViewModel.reset()`**.
   Hermes ACP only emits `available_commands_update` after `session/new`,
   not after `session/load`. Wiping the cached set on every session
   switch meant resumed sessions landed at a 4-command fallback even
   though the agent identity (and therefore the command list) hadn't
   changed. The new comment in `reset()` documents the rationale; the
   host-switch case still tears down the whole `ContextBoundRoot`, so
   stale carry-over isn't reachable when the agent identity does change.

2. **Expand the static fallback when a session is active**. Adds the
   agent-level command set (`/clear`, `/compact`, `/cost`, `/model`,
   `/tools`, `/reload-skills`, `/help`) to `alwaysAvailableCommands`
   when `sessionId != nil`. `/new` continues to show in both states.
   Pre-session, only `/new` surfaces — the others all require a live
   session, and surfacing them would mislead. Deduped by name against
   the ACP-advertised set so the richer (server-authoritative)
   description / argument hint wins once Hermes does emit them.

The two fixes together cover all paths to the slash menu:
- Cold start, click resume → fix #2 paints the active-session set
- Hot path, switch sessions after a `session/new` → fix #1 keeps the
  ACP-advertised set in `acpCommands`
- Cold start, click "+ New" → ACP populates as before; unchanged

Discovered during v2.8.0 dogfooding against a live Hermes v0.13.0 host.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 20:29:56 +02:00
..