← Back to PRs

#19471: fix(gateway): honor deliver param in chat.send

by kays0x open 2026-02-17 21:02 View on GitHub →
app: web-ui gateway size: S
## Summary - **Problem:** `chat.send` accepts `deliver: boolean` but ignores it — replies stay local to the WebSocket client - **Why it matters:** TUI users with `--deliver` expect replies forwarded to their session's delivery channel (e.g. Telegram) - **What changed:** Added `deliverChatReply` that resolves the session's external channel and calls `deliverOutboundPayloads` with `bestEffort: true` - **Scope boundary:** Only `chat.send` delivery path; no changes to agent.send, dispatcher, or session state ## Change Type - [x] Bug fix ## Scope - [x] Gateway / orchestration ## Notes When TUI connects it overwrites `deliveryContext.channel` to `webchat`, so `resolveAgentDeliveryPlan` loses the original channel. `inferChannelFromTarget` works around this by extracting the channel from the `to` prefix (e.g. `telegram:123` → `telegram`) and validating it with `isDeliverableMessageChannel`. ## Testing - [x] `pnpm build` - [x] `pnpm check` (format + lint clean) - [x] `pnpm test` (5683 pass, 1 pre-existing failure in `web/auth-store.ts`) - [x] Manual: `openclaw --dev tui --session main --deliver` → reply delivered to Telegram

Most Similar PRs