-
Notifications
You must be signed in to change notification settings - Fork 0
Replace comment-based retry counter with structured metadata #170
Copy link
Copy link
Closed
Description
Problem
Retry count is parsed from comment text via regex: comment.body.match(/⚠️ Retry (\d+)\/3/). This is fragile — if a human posts a comment containing "Retry 3/3", the task gets instantly marked as failed. The retry state lives in natural language, not structured data.
What to do
In src/daemon.ts, recoverStaleTasks() function:
- Instead of parsing retry count from comment text, store it in the issue body as structured metadata
- Use the existing metadata format:
<!-- lota:v1:meta {"retries": 2} --> - Update
parseMetadata()/formatMetadata()insrc/github.tsto support aretriesfield - On recovery: read retries from metadata, increment, write back
- Remove the regex-based comment scanning
Alternatively, use a simpler approach: store retry count in a label like retry:1, retry:2, retry:3.
Acceptance
- Retry count stored in structured metadata (not comment text)
- Human comments cannot poison the retry counter
- Recovery logic still works correctly (retry 3x then fail)
- Build passes:
npm run build
Reactions are currently unavailable