/**
 * POST /api/chat/sessions/<id>/abort → 200 { ok, running } | 409
 *
 * Stops the in-flight tool-call loop for this session. The chat-standalone
 * agent loop breaks at the next iteration boundary and persists a
 * "⏹ Stopped by user" assistant message. 409 if no turn is running.
 */

import { proxyToChat } from '@/lib/chat/proxy';

export async function POST(req: Request, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params;
  return proxyToChat(req, `/api/sessions/${encodeURIComponent(id)}/abort`);
}
