Skip to content

Replace comment-based retry counter with structured metadata #170

@xliry

Description

@xliry

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:

  1. Instead of parsing retry count from comment text, store it in the issue body as structured metadata
  2. Use the existing metadata format: <!-- lota:v1:meta {"retries": 2} -->
  3. Update parseMetadata() / formatMetadata() in src/github.ts to support a retries field
  4. On recovery: read retries from metadata, increment, write back
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions