Simple command to check background agent status: - Shows running/completed agents from agent-history.json - Uses TaskOutput to poll agent status - --wait flag blocks until all complete - Reports time savings vs sequential execution Inspired by PR #43 but intentionally minimal (117 lines vs 317). Skipped task-level parallelization display (not implementing that).
3.5 KiB
3.5 KiB
name, description, argument-hint, allowed-tools
| name | description | argument-hint | allowed-tools | ||||
|---|---|---|---|---|---|---|---|
| gsd:status | Check status of background agents from parallel execution | [--wait] |
|
Shows running/completed agents from agent-history.json. Uses TaskOutput to check status of background tasks. With --wait flag, blocks until all agents complete.
Arguments: $ARGUMENTS **Load agent history:**cat .planning/agent-history.json 2>/dev/null || echo '{"entries":[]}'
If file doesn't exist or has no entries:
No background agents tracked.
Run /gsd:execute-phase to spawn parallel agents.
Exit.
**Find background agents:**Filter entries where:
execution_modeis "parallel" or "background"statusis "spawned" (still running) or recently completed
Group by parallel_group if present.
For each agent with status === "spawned":
Use TaskOutput tool:
task_id: [agent_id]
block: false
timeout: 1000
If TaskOutput returns completed result:
- Update agent-history.json: status → "completed"
- Set completion_timestamp
- Parse files_modified from output if present
If TaskOutput returns "still running":
- Keep as spawned (running)
If TaskOutput returns error:
- Update agent-history.json: status → "failed"
Background Agents
════════════════════════════════════════
| Plan | Status | Elapsed | Agent ID |
|--------|-------------|----------|---------------|
| 10-01 | ✓ Complete | 2m 15s | agent_01H... |
| 10-02 | ⏳ Running | 1m 30s | agent_01H... |
| 10-04 | ✓ Complete | 1m 45s | agent_01H... |
Progress: 2/3 complete
════════════════════════════════════════
Wait for all: /gsd:status --wait
Status icons:
- ✓ Complete
- ⏳ Running
- ✗ Failed
- ⏸ Queued (waiting for dependency)
For each agent with status "spawned":
Use TaskOutput with blocking:
task_id: [agent_id]
block: true
timeout: 600000
Report as each completes:
⏳ Waiting for 3 agents...
✓ [1/3] 10-01 complete (2m 15s)
✓ [2/3] 10-04 complete (1m 45s)
✓ [3/3] 10-02 complete (3m 30s)
════════════════════════════════════════
All agents complete!
Total time: 3m 30s (parallel)
Sequential estimate: 7m 30s
Time saved: ~4m (53%)
════════════════════════════════════════
Update agent-history.json with completion status for each.
**After all complete (or if already complete):**---
## ▶ Next Up
All parallel agents finished. Review results:
`/gsd:progress`
<sub>`/clear` first → fresh context window</sub>
---
<success_criteria>
- Reads agent-history.json for background agents
- Uses TaskOutput to check running agent status
- Updates history with current status
- Shows simple status table
- --wait flag blocks until all complete
- Reports time savings vs sequential </success_criteria>