Explains how to use OpenAI’s Decisions API to automate triage of GitHub pull requests by evaluating diffs against well-defined review questions. It recommends asking narrow, actionable judgments (for example, whether a change belongs in a compatibility or implementation review track, and whether existing callers must migrate) and supplying the model with concrete evidence: PR title and description, changed file paths, and patch text. The guidance stresses that evidence selection matters (include relevant interface docs and surrounding code when behavior is unclear), that contributor comments are evidence not policy, and that decision-model answer types (choice, predicate) keep outputs predictable so application code can route work reliably.
Provides a runnable Node.js example that reads a PR via GitHub’s REST API and posts the assembled input to OpenAI’s Decisions endpoint. Practical specifics include requiring Node 22+, OPENAI_API_KEY and GITHUB_TOKEN, and example constraints (supports 1-100 changed files, a 100 KB input budget, and aborts if the PR changes during collection). The sample asks two questions (review_track with choices compatibility/implementation/needs_review, and migration_needed as a predicate), uses model gpt-6-luna, and prints answers with probabilities tied to the inspected head/base commits. It emphasizes limitations: triage does not replace code review or merge rules, returned classifications are routing aids not correctness proofs, missing patches or oversized inputs must be handled separately, and automation thresholds should be calibrated against reviewer feedback.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.