fix(opus-4.7): flip CSV to adaptive + remove PDD_FORCE gate on github_copilot#1156
Merged
Conversation
Contributor
Author
|
/gcbrun |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Contributor
Author
|
LGTM — approved for merge as-is. Verified all ten checklist items against the diff and /tmp/pdd-fix-tier2 on disk:
|
4 tasks
Contributor
Author
|
/heal |
…_copilot Anthropic enforced the new adaptive thinking API for Claude Opus 4.7 on 2026-05-23 ~17:25 UTC; the legacy thinking.type.enabled shape now returns 400 invalid_request_error. PR #1047 (commit 8646b16) added the adaptive code path on 2026-05-17 but explicitly deferred the CSV flip "out of scope". The deferral expired; PROD pdd cloud functions (fixcode, verifycode, crashcode, generatetest, generateexample) were broken for ~12h. Compounding issue: when the 400 fires, candidate iteration falls through to github_copilot/* rows. The credential check at _ensure_api_key gates the token-file existence check behind PDD_FORCE, which server contexts (Cloud Run) don't set. Copilot models pass the check, get tried, and hang for minutes on litellm device-flow OAuth. Changes: 1. pdd/data/llm_model.csv: flip Anthropic,claude-opus-4-7 to reasoning_type=adaptive, max_reasoning_tokens=16000. Azure AI row stays at budget pending separate audit — adaptive serialization in llm_invoke.py is gated on provider=='anthropic' anyway. 2. pdd/generate_model_catalog.py: teach _infer_reasoning_type and _infer_max_reasoning_tokens about the adaptive shape so regeneration doesn't revert the manual flip. Adaptive list is hardcoded ({"claude-opus-4-7"}) — extend as future models require adaptive. 3. pdd/llm_invoke.py: drop the `and os.environ.get('PDD_FORCE')` gate on the github_copilot token-file check. The token file is a precondition for any successful Copilot call (interactive or not); checking it unconditionally turns a multi-minute device-flow hang into a clean fast-fail with a `pdd setup` hint. Authenticated CLI users with a token file present are unaffected. 4. tests: cover the three github_copilot credential paths (no token / token present / PDD_FORCE-set) plus the generator's adaptive classification. Process note: this PR closes the deferred CSV flip from PR #1047. Future commits that add new reasoning_type values to llm_invoke.py should land the CSV row atomically — deferring past a release means production can break the moment a provider enforces the new shape (as happened here). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PDD-Auto-Heal-Checkpoint: success
4efc683 to
18a3a94
Compare
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
See commit body for the full incident timeline and rationale.
Test plan
pytest tests/test_llm_invoke.py -k github_copilot -v(three new tests pass)pytest tests/test_generate_model_catalog.py -k reasoning_type -v(three new generator tests pass)pytest tests/test_llm_invoke.py -v(no regression in existing tests)/gcbruncloud-test passesPlease visit github.com/login/devicewarnings appear in Cloud Run logs.🤖 Generated with Claude Code