Skip to content

Test AI review workflow with intentionally flawed code - #11

Closed
zhongkechen wants to merge 1 commit into
mainfrom
codex/test-ai-review-findings
Closed

Test AI review workflow with intentionally flawed code#11
zhongkechen wants to merge 1 commit into
mainfrom
codex/test-ai-review-findings

Conversation

@zhongkechen

Copy link
Copy Markdown
Contributor

Purpose

This PR intentionally adds flawed code to exercise the merged Claude and Codex pull request review workflows. Do not merge this PR.

Expected behavior

  • both AI reviewers run with the repository defaults
  • actionable findings appear as inline comments
  • each inline comment visibly identifies its reviewer

Local validation

  • python3 -B scripts/plan_failed_review_reruns.py --help
  • python3 -B -m unittest tests/test_ai_pr_review_workflow.py tests/test_prepare_ai_review_comments.py
  • git diff --check

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime August 4, 2026 22:20 — with GitHub Actions Active
@zhongkechen
zhongkechen temporarily deployed to ai-pr-review-runtime August 4, 2026 22:20 — with GitHub Actions Inactive


def parse_github_timestamp(value: str) -> datetime:
return datetime.fromisoformat(value.removesuffix("Z"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

GitHub updated_at values end in Z. Removing it creates an offset-naive datetime, while cutoff is UTC-aware, so normal input raises TypeError instead of producing a plan. Preserve the UTC offset and add a standard GitHub timestamp test.

Suggested change
return datetime.fromisoformat(value.removesuffix("Z"))
return datetime.fromisoformat(value.replace("Z", "+00:00"))

) -> list[list[int]]:
run_ids = [int(run["id"]) for run in runs]
return [
run_ids[start : start + batch_size - 1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

Python excludes the slice's end index, while the next iteration advances by the full batch size. This silently drops every batch_sizeth run, including the 100th run with the default setting. Slice through start + batch_size and test exact-boundary and multi-batch inputs.

Suggested change
run_ids[start : start + batch_size - 1]
run_ids[start : start + batch_size]

Comment on lines +58 to +60
parser.add_argument("--batch-size", type=int, default=100)
args = parser.parse_args()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

The numeric options accept invalid values: --batch-size 0 crashes in range(), a negative batch size silently produces no batches, and a negative age creates a future cutoff. Reject non-positive batch sizes and negative ages through argparse.

Suggested change
parser.add_argument("--batch-size", type=int, default=100)
args = parser.parse_args()
parser.add_argument("--max-age-days", type=int, default=7)
parser.add_argument("--batch-size", type=int, default=100)
args = parser.parse_args()
if args.max_age_days < 0:
parser.error("--max-age-days must be non-negative")
if args.batch_size <= 0:
parser.error("--batch-size must be greater than zero")

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codex AI review

The new planner has three correctness issues, and no tests cover its timestamp, batching, or argument-validation paths.

Reviewed commit 21bc5ec84410d618511c425d85c4b323bc06387d. Workflow run

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Claude AI review

test

Reviewed commit 21bc5ec84410d618511c425d85c4b323bc06387d. Workflow run

@zhongkechen zhongkechen closed this Aug 4, 2026
@zhongkechen
zhongkechen deleted the codex/test-ai-review-findings branch August 4, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant