← Back to PRs

#5334: fix(gateway): support abort as alias for chat.abort to restore /stop command

by njbyte open 2026-01-31 10:52 View on GitHub →
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