|
| 1 | +# Plan |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Update work-agent to skip non-stale locked issues and find the next available issue automatically, |
| 6 | +silently. work-prepare should expose a `stale: bool` field in its ERROR response (based on |
| 7 | +IssueLock.STALE_LOCK_THRESHOLD = 4 hours), so work-agent can decide whether to skip or offer cleanup |
| 8 | +without duplicating the threshold. |
| 9 | + |
| 10 | +When work-prepare returns ERROR with an existing worktree locked by another session: |
| 11 | +- If `stale == false` (lock_age_seconds < 14400): work-agent silently retries work-prepare to find |
| 12 | + the next available issue, without presenting any AskUserQuestion dialog |
| 13 | +- If `stale == true` (lock_age_seconds >= 14400): work-agent preserves the existing cleanup-offer |
| 14 | + behavior (Clean up and retry / Abort) |
| 15 | + |
| 16 | +## Pre-conditions |
| 17 | + |
| 18 | +(none) |
| 19 | + |
| 20 | +## Post-conditions |
| 21 | + |
| 22 | +- [ ] Bug fixed: work-agent no longer offers cleanup when encountering a non-stale locked issue |
| 23 | +- [ ] work-agent automatically retries work-prepare to find the next available issue when it receives |
| 24 | + ERROR with `stale == false`, without presenting any AskUserQuestion dialog |
| 25 | +- [ ] work-prepare ERROR response (existing worktree locked by another session) includes a boolean |
| 26 | + `stale` field, set to `true` when `lock_age_seconds >= 14400`, `false` otherwise |
| 27 | +- [ ] Staleness threshold sourced exclusively from `IssueLock.STALE_LOCK_THRESHOLD` in Java — no |
| 28 | + hardcoded `14400` appears in skill Markdown code |
| 29 | +- [ ] Regression test added: work-agent skips non-stale locked issues and finds next available issue |
| 30 | +- [ ] Regression test added: work-agent preserves the cleanup-offer behavior when `stale == true` |
| 31 | +- [ ] No new issues introduced |
| 32 | +- [ ] E2E verification: reproduce the scenario (work-prepare returns ERROR with `stale == false`) and |
| 33 | + confirm work-agent automatically finds the next available issue without any dialog |
0 commit comments