Limit Codex feedback retry rounds#50
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12429e26f8
ℹ️ 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".
| output_dir = Path("data/output/codex_feedback") | ||
| issue = json.loads((output_dir / "issue.json").read_text(encoding="utf-8")) | ||
| comments = [comment.get("body") or "" for comment in issue.get("comments", [])] | ||
| previous_rounds = sum(body.startswith("<!-- codex-pr-feedback:") for body in comments) |
There was a problem hiding this comment.
Reset retry counter when codex-bridge is reapplied
The retry cap is computed from the total number of existing issue comments that start with <!-- codex-pr-feedback: and never resets, so once an issue has reached the cap it will continue to hit the limit on every later failure/review even after an operator manually reapplies codex-bridge. That conflicts with the workflow’s own instruction to “re-apply the label only if another automated Codex pass is still appropriate,” because reapplying the label cannot actually grant new automatic rounds under this counting logic.
Useful? React with 👍 / 👎.
Summary
This PR caps the automatic Codex feedback loop for monthly remediation PRs.
codex-bridgeissuecodex-bridgeand leave a retry-limit comment once the cap is reachedValidation
python3 -m pytest tests/test_fanout_monthly_optimization_tasks.py tests/test_auto_optimization_pr_workflow_config.py tests/test_prepare_auto_optimization_pr.py -qgit diff --checkRefs QuantStrategyLab/AuditOrchestrator#1