#5334: fix(gateway): support abort as alias for chat.abort to restore /stop command
app: web-ui
gateway
fix(gateway): add abort alias for chat.abort ( issue #5239 )
Some clients were sending the 'abort' method instead of 'chat.abort',
causing the gateway to reject the request with "unknown method: abort".
This change restores compatibility by:
- Adding 'abort' as an alias for the 'chat.abort' handler
- Allowing 'abort' in WRITE_METHODS for proper authorization
- Exposing 'abort' in BASE_METHODS for method enumeration
- Adding an e2e test to ensure `abort` behaves identically to 'chat.abort'
This preserves backward compatibility while keeping permission checks intact.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR restores backwards compatibility for clients that send the legacy RPC method name `abort` by aliasing it to the existing `chat.abort` handler. It updates gateway method enumeration (`src/gateway/server-methods-list.ts`) and authorization (`src/gateway/server-methods.ts`) so `abort` is treated like a write method, and adds an end-to-end test that verifies `abort` behaves identically to `chat.abort`.
Overall the change fits cleanly into the existing gateway method registry/authorization model (central method lists + per-module handler maps), and the alias is implemented as a simple handler map entry pointing at the same function.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk; the alias wiring is straightforward and covered by an e2e test.
- Changes are localized to method listing, authorization sets, and a single alias entry in the chat handler map. No behavioral changes to `chat.abort` itself. Only minor concern is that the new test’s response typing is permissive, which affects test strength but not runtime behavior.
- src/gateway/server.chat-abort-alias.e2e.test.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#14811: feat(gateway): route chat/agent events per-connection instead of glob…
by jiangjin11 · 2026-02-12
75.2%
#19284: fix(delivery): treat AbortErrors as failures for retry
by EdGuan · 2026-02-17
73.2%
#11101: fix: handle AbortError and WebSocket 1006 in unhandled rejection ha...
by Nipurn123 · 2026-02-07
73.1%
#9218: Fix Control UI chat resync on gaps and terminal events
by figitaki · 2026-02-05
72.6%
#21115: fix(agent): immediately abort active run on stop/abort message during…
by anillBhoi · 2026-02-19
72.4%
#16330: fix(gateway): preserve conversation history on gateway restart
by openperf · 2026-02-14
72.0%
#6466: fix(gateway): add handshake timeout and connection error handling
by jarvis-raven · 2026-02-01
71.9%
#10509: fix(telegram): bare abort words bypass debounce + clear buffered me...
by romancircus · 2026-02-06
71.8%
#7128: feat: add gateway.restart RPC for graceful in-process restart
by AkashaBot · 2026-02-02
71.6%
#6143: fix(agents): handle AbortError from activeSession.abort() on timeout
by Glucksberg · 2026-02-01
71.4%