Show only OpenAI and Anthropic provider and login status. Remove nine obsolete upstream README translations. Redirect documentation links to the maintained root README. Update status regression coverage and documentation guidance.
2.2 KiB
2.2 KiB
🔄 非同期タスクと Spawn
README に戻る
Spawn を使用した非同期タスク
長時間実行タスク(Web 検索、API 呼び出し)には、spawn ツールを使用してサブ Agent (subagent) を作成します:
# Periodic Tasks
## Quick Tasks (respond directly)
- Report current time
## Long Tasks (use spawn for async)
- Search the web for AI news and summarize
- Check email and report important messages
主な動作:
| 特性 | 説明 |
|---|---|
| spawn | 非同期サブ Agent を作成、メインハートビートをブロックしない |
| 独立コンテキスト | サブ Agent は独自のコンテキストを持ち、セッション履歴なし |
| message tool | サブ Agent は message ツールでユーザーと直接通信 |
| ノンブロッキング | spawn 後、ハートビートは次のタスクに進む |
サブ Agent の通信の仕組み
ハートビートトリガー (Heartbeat triggers)
↓
Agent が HEARTBEAT.md を読み取り
↓
長時間タスクの場合: サブ Agent を spawn
↓ ↓
次のタスクに進む サブ Agent が独立して作業
↓ ↓
すべてのタスク完了 サブ Agent が "message" ツールを使用
↓ ↓
HEARTBEAT_OK を応答 ユーザーが直接結果を受信
サブ Agent はツール(message、web_search など)にアクセスでき、メイン Agent を経由せずにユーザーと独立して通信できます。
設定:
{
"heartbeat": {
"enabled": true,
"interval": 30
}
}
| オプション | デフォルト値 | 説明 |
|---|---|---|
enabled |
true |
ハートビートの有効/無効 |
interval |
30 |
チェック間隔(分単位、最小: 5) |
環境変数:
PICOCLAW_HEARTBEAT_ENABLED=falseで無効化PICOCLAW_HEARTBEAT_INTERVAL=60で間隔を変更