-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Currently, taskMaestro detects worker completion solely by polling capture-pane output and matching prompt patterns (e.g., ⏵⏵|⏵ |❯). This approach has several limitations:
- Fragile text parsing — prompt patterns vary across environments and Claude CLI versions
- No structured output — no machine-readable way to know what the worker accomplished (PR number, issue closed, cost, etc.)
- False positives — an idle prompt doesn't distinguish between "task completed successfully" vs "task failed and returned to prompt" vs "user interrupted"
Proposed Solution
Introduce a RESULT.json file-based completion signaling mechanism with a 2-tier detection strategy.
RESULT.json Schema
Workers write a RESULT.json file to their worktree root upon completion:
{
"status": "success | failure | error",
"issue": 123,
"pr_number": 456,
"pr_url": "https://github.com/owner/repo/pull/456",
"timestamp": "2026-03-21T12:00:00Z",
"cost": "$0.42",
"error": null
}| Field | Type | Required | Description |
|---|---|---|---|
status |
string |
Yes | success, failure, or error |
issue |
number |
Yes | GitHub issue number the worker was assigned |
pr_number |
number |
No | PR number if one was created |
pr_url |
string |
No | Full PR URL |
timestamp |
string |
Yes | ISO 8601 completion timestamp |
cost |
string |
No | Estimated API cost for the task |
error |
string |
No | Error message if status is failure or error |
2-Tier Detection Strategy
- Primary: RESULT.json — Check for
RESULT.jsonin the worker's worktree directory. If present, parse it for structured completion data. - Fallback: capture-pane — If no
RESULT.jsonexists, fall back to the current prompt-pattern matching viatmux capture-pane.
This provides backward compatibility while enabling richer completion data.
Completion Protocol in Worker Prompt
Add a [TASKMAESTRO COMPLETION PROTOCOL] section to the worker prompt template instructing the worker to write RESULT.json before exiting:
[TASKMAESTRO COMPLETION PROTOCOL]
When your task is complete, write a RESULT.json file to the worktree root with:
- status: "success" or "failure"
- issue: the issue number you were assigned
- pr_number / pr_url: if you created a PR
- timestamp: ISO 8601 completion time
- cost: estimated API cost (if available)
- error: error message (if failed)
Impact on Subcommands
status— Check RESULT.json first, then fall back to capture-panewatch— Use RESULT.json for auto-detecting wave completion and triggering next wave- State file — Add
resultfield to persist per-pane completion data
Reference
This feature was prototyped in the codingbuddy skill layer:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request