Test

Merged
SW
4mo ago
+1155-772

Summary by cubic

Moved chat generation to an async runs API backed by the durable runAgentWorkflow. Adds run status checks, per-run ephemeral recoup_sk_ keys, and shared provisioning so interactive and headless paths behave the same.

  • New Features

    • POST /api/chat/runs: provisions a session + sandbox, mints a short‑lived account‑scoped recoup_sk_ key (~15m TTL), starts runAgentWorkflow, and returns 202 with { runId, chatId, sessionId } and a Location header. The workflow revokes the key on completion; auth rejects expired keys.
    • GET /api/chat/runs/{runId}: returns { runId, status } normalized to queued|running|completed|failed|cancelled.
  • Migration

    • Removed POST /api/chat/generate. Use POST /api/chat/runs, read output via GET /api/chat/{chatId}/stream, and poll GET /api/chat/runs/{runId} for status.
    • Request body no longer supports topic, roomId, or excludeTools. The default model is anthropic/claude-haiku-4.5.