# Intel agent timed out waiting for a transcript API batch

## TL;DR
Transcript API batches time out because the agent waits synchronously for jobs that take many minutes. The fix is asynchronous polling: submit the batch, record the job ids, and poll each job on a schedule while the agent does other work. Timeouts become a scheduling problem, not a failure.

## The error
```text
(agent timeout)
intel agent timed out waiting for transcript api batch; 10 jobs submitted, connection held 30 min, run failed
```

## When this helps
- an agent times out on transcript batches
- transcription jobs take longer than the run budget
- building async transcription pipelines
- scheduling long-running API jobs

## When it doesn't
- the API offers webhooks; use them instead of polling
- jobs fail permanently; debug the failure, not the polling
- you need one transcript fast; poll that job alone

## Works with
Any transcription API with batch jobs as of 2026; python 3.8+ with requests.

## Steps
### 1. Submit the batch and record job ids, then disconnect
```python
import requests, json
s = requests.Session()
s.headers.update({"Authorization": "Bearer [transcription api key]"})
jobs = []
for audio in ["call1.mp3", "call2.mp3"]:
    r = s.post("https://api.YOUR-transcription-provider/v1/jobs", files={"audio": open(audio, "rb")}, timeout=60)
    jobs.append(r.json().get("job_id"))
open("jobs.json", "w").write(json.dumps(jobs))
print("jobs submitted:", jobs)
```
Expected: Job ids on disk. The agent never holds a connection open waiting for transcription.

### 2. Poll each job on a schedule
```python
import time, requests, json
s = requests.Session()
s.headers.update({"Authorization": "Bearer [transcription api key]"})
jobs = json.load(open("jobs.json"))
for job in jobs:
    for i in range(20):
        r = s.get("https://api.YOUR-transcription-provider/v1/jobs/" + job, timeout=30)
        if r.json().get("status") == "completed":
            print(job, "completed")
            break
        time.sleep(60)
```
Expected: Completion per job. Polling survives network drops that kill held connections.

### 3. Download transcripts as jobs complete
```python
import requests, json
s = requests.Session()
s.headers.update({"Authorization": "Bearer [transcription api key]"})
for job in json.load(open("jobs.json")):
    r = s.get("https://api.YOUR-transcription-provider/v1/jobs/" + job + "/transcript", timeout=60)
    open("transcript_" + job + ".txt", "w").write(r.text)
    print(job, len(r.text), "chars")
```
Expected: One transcript file per job. Downloads happen after completion, never during.

### 4. Do other briefing work while polling
```python
import json
print("while jobs poll: fetch filings, pull news, build non-transcript sections")
print("the agent's schedule interleaves polling with productive work")
```
Expected: An interleaved schedule. Polling is one task among many, not a blocking wait.

## Other ways people phrase this
### transcript api batch timeout agent
Submit, record ids, poll on schedule. Never hold the connection.

### transcription jobs polling timeout
Polling with backoff survives what synchronous waits cannot.

### agent waiting transcription batch
Interleave polling with other work. The wait becomes productive.

## Why it happens
Transcription is slow and batch jobs take many minutes, while agent runs have finite budgets. Synchronous waiting burns the budget on nothing. Async submit plus scheduled polling decouples the agent's progress from the provider's processing time.

## Edge cases
- Job ids must persist; a crashed poller resumes from the job list.
- Poll intervals should respect the provider's rate limits.
- Partial batch completion is normal; process completed jobs while others run.
- Set an overall batch deadline; jobs stuck for hours need escalation.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_NTJ9kHU_dTt0mnUiP5QviQ
