supervisor-api-background-mode

Submits Supervisor API requests asynchronously and polls responses.retrieve until completion, converting output to stream events.

4|Updated May 9, 2026
One-click install
npx skills add https://github.com/victorlou/housing-assistant --skill supervisor-api-background-mode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supervisor-api-background-mode
Source: https://github.com/victorlou/housing-assistant/tree/main/app/app-templates/.claude/skills/supervisor-api-background-mode
Command: npx skills add https://github.com/victorlou/housing-assistant --skill supervisor-api-background-mode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of agent workflows timing out when long-running tool use must complete end-to-end before returning results to the user.

Core Features & Use Cases

  • Background execution for long-running tasks: Submits Supervisor API requests asynchronously and returns immediately with a response_id, then polls until terminal completion.
  • Timeout-safe “simulated streaming”: Converts fully available background output into incremental frontend-friendly stream deltas, preserving a chat-like experience.
  • Robust ordering and approval handling: Skips echoed history items, breaks on incomplete output items to avoid validation errors, and supports multi-turn MCP tool approvals when needed.
  • Use case: When an agent needs to run complex multi-tool workflows (e.g., large Genie queries or multi-step data analysis) that may exceed HTTP time limits, this Skill keeps the interaction responsive while still completing safely.

Quick Start

Ask the agent how often to poll for completion (every 2, 10, or 30 seconds), then apply the background-mode changes to your agent server to submit with background=True and stream the polled results to the frontend.

Frequently Asked Questions about supervisor-api-background-mode

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

FAQPage Schema
How do I prevent HTTP timeouts when running long agent tasks?

To prevent HTTP timeouts for long agent tasks, submit Supervisor API requests asynchronously with background=True and return immediately with a response_id, then poll until terminal completion.

How does simulated streaming work for completed background API tasks?

Simulated streaming for completed background API tasks works by converting fully available background output into incremental frontend-friendly stream deltas, preserving a chat-like experience.

Can I handle multi-turn MCP tool approvals with background agent polling?

Yes, you can handle multi-turn MCP tool approvals with background agent polling by skipping echoed history items using the original request context and supporting approval flows when needed.

Why does my async Python agent polling break on incomplete output items?

Async Python agent polling breaks on incomplete output items to avoid validation errors. You must break processing when encountering incomplete items and only convert completed items into response stream events.

How often should I poll responses.retrieve for background agent task completion?

You should poll responses.retrieve for background agent task completion at regular intervals of 2, 10, or 30 seconds, asking the agent to determine the optimal polling frequency for your workload.

What is the best way to stream SSE output from large Genie queries that exceed HTTP time limits?

The best way to stream SSE output from large Genie queries exceeding HTTP time limits is applying background-mode changes to submit asynchronously and streaming the polled results to the frontend.