long-running-server

Enable Responses API agent tasks to run beyond HTTP timeout limits with background execution and Lakebase-backed persistence.

Updated May 10, 2026
One-click install
npx skills add https://github.com/keqingli1129/agent-langgraph-one --skill long-running-server
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: long-running-server
Source: https://github.com/keqingli1129/agent-langgraph-one/tree/main/.claude/skills/long-running-server
Command: npx skills add https://github.com/keqingli1129/agent-langgraph-one --skill long-running-server

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires databricks-ai-bridge[agent-server], mlflow.

What problem does it solve?

Long-running agent requests fail or time out when an HTTP client or gateway limits execution duration, forcing you to retry and losing progress.

Core Features & Use Cases

  • LongRunningAgentServer background execution: Enables background/async execution so requests can continue after the initial HTTP call finishes.
  • Client-friendly polling and streaming: Supports background=true with GET /responses/{id} polling, and background=true&stream=true with cursor-based resumption via starting_after.
  • Lakebase persistence for resilience: Persists long-running task state to Lakebase PostgreSQL so results can be retrieved reliably even when the original request times out.

Quick Start

Add databricks-ai-bridge[agent-server]>=0.18.0, replace AgentServer with LongRunningAgentServer, configure Lakebase env vars in .env (or databricks.yml), and start the server so background requests can be polled or streamed.

Frequently Asked Questions about long-running-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run agent requests that exceed HTTP timeouts?

Long-running agent requests that exceed HTTP timeouts can run in the background using LongRunningAgentServer with Lakebase-backed task persistence. This enables requests to continue executing after the initial HTTP call finishes.

How does background polling work for async Responses API tasks?

Background polling for async Responses API tasks works via GET /responses/{id} endpoints. Clients request background=true to start the task, then poll the endpoint to retrieve results reliably even when the original request times out.

Can I stream long-running agent responses with cursor-based resumption?

Yes, streaming long-running agent responses supports cursor-based resumption. By requesting background=true and stream=true, clients can resume streaming using the starting_after cursor and stream event ID transformation ensures consistent response identifiers.

Do I need Lakebase to persist background task state?

Yes, Lakebase PostgreSQL is required to persist long-running task state. This persistence mechanism ensures results can be retrieved reliably even when the original HTTP request times out or fails.

What's the best way to handle agent tasks that run longer than 120 seconds?

Handling agent tasks running longer than 120 seconds is best done by replacing AgentServer with LongRunningAgentServer. This approach enables async execution and prevents HTTP gateway timeouts from failing the request.

Why does my agent server fail when processing long requests?

Agent server requests fail when HTTP clients or gateways limit execution duration, typically around 120 seconds. LongRunningAgentServer solves this by enabling persistent background execution with Lakebase-backed state persistence.