Repository navigation
feat(agents): incident-auto-cleanup-phase1 - #11
Conversation
Extend the stale-ticket GC to auto-resolve incidents stuck in StatusAnalyzing (default 48h) and StatusFixProposed (default 168h), in addition to the existing StatusOpen (24h) pass. Adds AUTO_RESOLVE_ANALYZING_AFTER and AUTO_RESOLVE_FIX_PROPOSED_AFTER env vars with safe defaults. Each auto-resolution appends a structured reason string to the ticket's analysis field for audit purposes. Proposal: platform-gitops/agents-state/mctl-agent/proposals/incident-auto-cleanup-phase1/
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27b1e3ce4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| thresholds := map[string]time.Duration{ | ||
| ticket.StatusOpen: p.StaleAfter, | ||
| ticket.StatusAnalyzing: p.AnalyzingAfter, | ||
| ticket.StatusFixProposed: p.FixProposedAfter, | ||
| } |
There was a problem hiding this comment.
Allow status-specific TTL GC when open-ticket TTL is disabled
resolveStale now defines separate thresholds for analyzing and fix_proposed, but this path is still gated by an early p.StaleAfter <= 0 return. If an operator sets AUTO_RESOLVE_STALE_AFTER=0 to disable only open-ticket cleanup while keeping AUTO_RESOLVE_ANALYZING_AFTER/AUTO_RESOLVE_FIX_PROPOSED_AFTER enabled, those newer GC passes never run, which contradicts the per-status configuration implied by this change.
Useful? React with 👍 / 👎.
|
@codex review |
|
@copilot review |
Codex P2 on PR #11: the early-return at the top of resolveStale was gated on p.StaleAfter <= 0 alone, which short-circuited the entire function. Operators setting AUTO_RESOLVE_STALE_AFTER=0 to disable only open-ticket cleanup would also disable AUTO_RESOLVE_ANALYZING_AFTER and AUTO_RESOLVE_FIX_PROPOSED_AFTER GC passes — contradicting the per-status configuration. Gate the early return on all three thresholds being zero. The per-status cutoff <= 0 check inside the loop already skips disabled statuses individually.
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Implements accepted proposal
mctl-agent/incident-auto-cleanup-phase1.Spec: https://github.com/mctlhq/mctl-gitops/tree/main/platform-gitops/agents-state/mctl-agent/proposals/incident-auto-cleanup-phase1/
Generated by mctl-agents Tier 2 implementer. Review carefully — this PR was opened automatically and the spec may have gaps.