pi-a2a
The pi-a2a extension supports **long-running tasks** that can execute for hours or days without timeouts. This is essential for: - Data processing pipelines
Install / Use
npx skills add espennilsen/pi --skill pi-a2aInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of pi-a2a
pi-a2a scores 79/100 on our quality scale, 2536th of 2,864 Automation skills we index.
Its SKILL.md is 8.4 KB long, well organised into 33 sections with 10 code examples: a thorough specification that gives an agent plenty to work with.
It has no GitHub stars yet, so there is no community track record; judge it on its content.
Maintenance, license and trust
- The repository was last updated 12 days ago, so pi-a2a is actively maintained.
- Our last check on 2026-10-18 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 80/100, with 2 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
pi-a2a compared with similar skills
All 4 of these similar skills score higher than pi-a2a; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| pi-a2a (this skill)by espennilsen | 79 | 0 | 12d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 109.0k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 97.5k | today | MCP Server |
| rufloby ruvnet | 100 | 81.0k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 44d ago | SKILL.md |
Frequently asked questions
- How do I install pi-a2a?
- Run
npx skills add espennilsen/pi --skill pi-a2a. The install tabs above show the steps for each supported agent. - Which AI agents does pi-a2a work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is pi-a2a safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 80/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is pi-a2a still maintained?
- The repository was last updated 12 days ago, so pi-a2a is actively maintained.
Skill content
View source on GitHubpi-a2a Long-Running Tasks Skill
Overview
The pi-a2a extension supports long-running tasks that can execute for hours or days without timeouts. This is essential for:
- Data processing pipelines
- Batch operations
- Research and aggregation tasks
- External API jobs with unpredictable duration
- Any A2A task that exceeds the standard timeout
When to Use
Use long-running tasks when:
- Task execution time is unpredictable or known to exceed 10 minutes
- The remote agent is processing large datasets
- Task involves multiple external API calls
- You want the task to survive Pi restarts
Don't use for:
- Quick queries (< 5 minutes)
- Interactive conversations
- Tasks requiring immediate feedback
Configuration
Enable in settings.json:
{
"pi-a2a": {
"longRunningTasks": {
"enabled": true,
"maxTaskAgeHours": 168,
"resumeRetryAttempts": 3,
"resumeRetryDelayMs": 5000,
"pollingIntervalMs": 300000
}
}
}
```text
### Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `enabled` | boolean | `false` | Enable long-running task support |
| `maxTaskAgeHours` | number | `168` (7 days) | Maximum task retention period |
| `resumeRetryAttempts` | number | `3` | Retry attempts for resume failures |
| `resumeRetryDelayMs` | number | `5000` | Delay between retries |
| `pollingIntervalMs` | number | `300000` (5 min) | Hub polling interval |
## How It Works
### Architecture
┌─────────────────────────────────────────────────────────────┐ │ 1. Task Initiated │ │ - Task state saved to SQLite │ │ - Session ID assigned │ │ - Agent continues other work │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 2. Background Polling (every 5 min) │ │ - Checks hub for task completion │ │ - Detects state changes │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 3. Task Completes │ │ - State updated in SQLite │ │ - Resume request queued │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 4. Smart Resume Queue │ │ - Waits for agent to be idle │ │ - Processes one request at a time │ │ - Validates session ID (prevents stale callbacks) │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 5. Response Delivered │ │ - Completion message injected into chat │ │ - Task result available │ └─────────────────────────────────────────────────────────────┘
### Session Persistence
Tasks are stored in `db/a2a-long-running.db` with:
- `taskId` - A2A task identifier
- `contextId` - Conversation context
- `sessionId` - Pi session that owns the task
- `state` - Current task state
- `createdAt` / `lastUpdatedAt` - Timestamps
- `response` / `error` - Task result
### Resume Queue
The resume queue ensures responses are delivered at the right time:
1. **Agent Busy**: Queue the resume request
2. **Agent Idle**: Process immediately
3. **Session Mismatch**: Skip (task belongs to old session)
4. **Failure**: Retry with backoff (up to `resumeRetryAttempts`)
## Usage Patterns
### Pattern 1: Long-Running Data Processing
```typescript
// Send task to data processing agent
const result = await a2a_send({
agent: "data-processor",
message: "Process this 10GB dataset...",
});
// Agent continues other work immediately
// Task result delivered when processing completes (hours later)
Pattern 2: Multi-Agent Pipeline
// Start long-running pipeline
const pipelineTask = await a2a_send({
agent: "pipeline-orchestrator",
message: "Run full ETL pipeline",
});
// Check status periodically or wait for completion notification
// Result delivered automatically when pipeline finishes
Pattern 3: Research Aggregation
// Start research task
const researchTask = await a2a_send({
agent: "research-agent",
message: "Aggregate all news about AI safety from past month",
});
// Agent can handle other requests while research runs
// Results delivered when aggregation completes
Best Practices
✅ Do
- Enable for appropriate tasks: Use when tasks exceed 10 minutes
- Monitor task age: Set
maxTaskAgeHoursappropriately for your use case - Handle failures: Check for error messages in completion notifications
- Test session recovery: Verify tasks survive Pi restarts
- Set reasonable polling intervals: Balance responsiveness with resource usage
❌ Don't
- Don't enable for all tasks: Overhead not needed for quick operations
- Don't set polling too low: < 60 seconds creates unnecessary load
- Don't rely on immediate responses: Long-running tasks are asynchronous
- Don't ignore session boundaries: Tasks belong to specific sessions
Monitoring
Check Task Status
# View pending long-running tasks
sqlite3 db/a2a-long-running.db "SELECT task_id, state, created_at FROM long_running_tasks WHERE state NOT IN ('completed', 'failed');"
Check Resume Queue
# View queued resume requests
sqlite3 db/a2a-long-running.db "SELECT task_id, priority, retry_count FROM resume_queue ORDER BY enqueued_at;"
Logs to Monitor
long_running_task_saved- Task state persistedlong_running_task_completed- Task finishedresume_request_enqueued- Resume queuedresume_queue_processed- Response deliveredresume_queue_retry_scheduled- Retry scheduledlong_running_task_poll_error- Polling error
Troubleshooting
Task Not Completing
Symptoms: Task stuck in "working" state for extended period
Solutions:
- Check remote agent health
- Verify hub connectivity
- Increase
pollingIntervalMsif hub is rate-limited - Check logs for
long_running_task_poll_error
Resume Not Processing
Symptoms: Task completed but response not delivered
Solutions:
- Check if agent is busy (resume waits for idle)
- Verify session ID matches current session
- Check retry count (may have exhausted retries)
- Review
resume_queue_*logs
Session Mismatch
Symptoms: resume_queue_stale_session in logs
Cause: Task belongs to previous Pi session
Solutions:
- This is expected behavior - prevents cross-session contamination
- Task result available in previous session's data
- Consider shorter
maxTaskAgeHoursif this occurs frequently
Limitations
- Hub Dependency: Requires A2A hub for polling (can't poll direct agents)
- Session Boundaries: Tasks don't cross session boundaries
- Polling Latency: Completion detected within polling interval (default: 5 min)
- Storage: Tasks consume SQLite storage (pruned after
maxTaskAgeHours)
Example Configuration
Development
{
"pi-a2a": {
"longRunningTasks": {
"enabled": true,
"maxTaskAgeHours": 24,
"resumeRetryAttempts": 5,
"pollingIntervalMs": 60000
}
}
}
Production
{
"pi-a2a": {
"longRunningTasks": {
"enabled": true,
"maxTaskAgeHours": 168,
"resumeRetryAttempts": 3,
"pollingIntervalMs": 300000
}
}
}
Minimal Overhead
{
"pi-a2a": {
"longRunningTasks": {
"enabled": false
}
}
}
Related Features
- A2A Hub: Task status polling requires hub registration
- Session Persistence: Pi stores sessions on disk for recovery
- Smart Resume Queue: Respects agent workload before delivering responses
- Task Timeout: Standard tasks still have
taskTimeoutMs(default: 10 min)
Version History
- v0.1.0: Initial implementation
- LongRunningTaskStore for SQLite persistence
- Session ID tracking
- Smart resume queue
- Background polling
Related Skills
Agent-Reach
109.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Scrapling
97.5k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
ruflo
81.0k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
