Migrate AI local review to OpenAI Responses API#234
Merged
Conversation
Enable gpt-5.4-pro and future reasoning models by switching the OpenAI endpoint from /v1/chat/completions to /v1/responses. Add _is_reasoning_model() helper, REASONING_MAX_TOKENS, --timeout CLI flag, gpt-5.4-pro pricing, conditional temperature/max-tokens, reasoning token reporting, and mocked unit tests for payload construction. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The output_text convenience field is null in raw HTTP responses (only populated by the Python SDK). Extract text from output[].content[] items instead. Update mock test responses to match real API format. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ests P1: Relax status check — extract content first via _extract_response_text(), only fail when no usable content is found (not on status mismatch alone). P2: Extract response parsing into dedicated helper with unit tests covering multiple payload shapes (missing status, null status, SDK output_text, multiple output blocks). Add reasoning-model timeout hint to stderr. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Pin the content-first parsing behavior: status='incomplete' with usable output should return content, not exit. Addresses P2 from gpt-5.4-pro review. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
P1: Treat status='incomplete' as a hard error even when content exists, since truncated reviews may silently suppress findings. Print incomplete_details and suggest remediation (reduce diff, lower context). P2: Fix gpt-5.4-pro pricing from (15,60) to (30,180) per official rates. P3: Fix argparse description to say "Responses API" not "Chat Completions". Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Owner
Author
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/ai-review-localscript from Chat Completions API to Responses API, enablinggpt-5.4-proand future reasoning models_is_reasoning_model()helper,REASONING_MAX_TOKENS,gpt-5.4-propricing,--timeoutCLI flag_extract_response_text()helper with content-first success detection (valid content accepted regardless of API status field)--timeoutdocs, background execution for reasoning models, and deep review examplesMethodology references (required if estimator / math changes)
.claude/scripts/,.claude/commands/) and tests.Validation
tests/test_openai_review.py— 36 new tests across 6 classes:TestIsReasoningModel(10 tests)TestProModelPricing(2 tests)TestExtractResponseText(5 tests)TestResponsesAPIConstants(2 tests)TestCallOpenAIPayload(11 tests — payload construction, response parsing, error paths, variant shapes)gpt-5.4andgpt-5.4-promodelsSecurity / privacy
Generated with Claude Code