Fix compact no-op in gateway mode: add compact to GATEWAY_LOCAL_COMMANDS

Root cause of compact still failing after 1192/1205: in gateway mode,
on_room_message proxies any command not in GATEWAY_LOCAL_COMMANDS to the
active project's sled (proxy_bot_command) and returns — and that proxy
runs BEFORE the local compact interception (try_handle_compact_command).
'compact' was missing from the allowlist, so the gateway shipped it to a
sled (which has no compact command → no-op 'Command succeeded with no
response text'), and the real handler was never reached.

'reset' was already in the list, which is why reset worked in gateway
mode and compact did not. Add 'compact' as its sibling.

Why 1192 and 1205 both missed this: their tests drive
try_handle_compact_command directly, bypassing the gateway-proxy seam
that only exists on the full on_room_message path in gateway mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fHdm92yjvguPi2LiXfLB9
This commit is contained in:
Timmy
2026-07-18 09:37:05 +01:00
co-authored by Claude Opus 4.8
parent 4ab34d3be2
commit 98f8825701
@@ -482,6 +482,14 @@ pub(in crate::chat::transport::matrix::bot) async fn on_room_message(
"help",
"ambient",
"reset",
// `compact` is a gateway-local session command (sibling of `reset`):
// it distills THIS gateway's chat session transcript. It must be
// listed here so the gateway does not proxy it to the active
// project's sled (which has no compact command and no-ops) — that
// proxy runs before the local compact interception, so a missing
// entry silently swallows the command (bug: compact no-op in
// gateway mode, distinct from the 1192/1205 registry-ordering bug).
"compact",
"switch",
"all_status",
"new",