[reviewer] A/B the billing modes (subscription vs API key) + verbose agent logs - #4133
Draft
brentvatne wants to merge 1 commit into
Draft
[reviewer] A/B the billing modes (subscription vs API key) + verbose agent logs#4133brentvatne wants to merge 1 commit into
brentvatne wants to merge 1 commit into
Conversation
…ll agent output GPT review passes keep stalling and timing out, and the cause is unclear. This flips .expo-code-review auth to mode "random" (@expo/code-review-cli 0.7): each run randomly picks the ChatGPT/Codex subscription (oauth) or the metered API key, records the arm and pass outcomes in the run log, and runs both arms at the same concurrency — so stall/timeout/rate-limit rates can be compared per billing mode from field data. ECR_VERBOSE turns on full agent output (reasoning, reply text, tool inputs/outputs) in the job log, so a wedged pass shows what it was doing instead of a bare heartbeat. Requires the OPENAI_API_KEY repo secret (Restricted key: Responses + Chat completions Request only, dedicated budget-capped project). The auth lock now expects both credential env names.
|
❌ It looks like a changelog entry is missing for this PR. Add it manually to CHANGELOG.md. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4133 +/- ##
=======================================
Coverage 62.64% 62.64%
=======================================
Files 999 999
Lines 45175 45175
Branches 9483 9483
=======================================
Hits 28294 28294
Misses 15433 15433
Partials 1448 1448 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Why
GPT review passes keep stalling and timing out, and nothing in the logs says why. This PR turns the reviewer into an experiment: each run randomly picks a billing mode (ChatGPT/Codex subscription vs metered API key) and records the arm plus pass outcomes, so we can compare reliability per billing mode from field data. It also turns on full agent output in the job log.
Changes
.expo-code-review/config.jsonc: authmode: "random"withapiKeyEnv: OPENAI_API_KEY+oauthTokenEnv: CODEX_OAUTH_ACCESS_TOKEN. Both arms run at the same concurrency; the arm lands in the run log (authModes) withpassOutcomes(completed/failed/timedOut/stalled). Ending the experiment later is a one-field change (mode: "oauth"or"api-key").ECR_VERSIONfallback →^0.7.0; auth-lock fallback (ECR_EXPECTED_TOKEN_ENV) lists both credential env names (stable across the per-run coin flip);OPENAI_API_KEYpassed to the review steps;ECR_VERBOSE=1streams each agent's reasoning, reply text, and tool inputs/outputs into the job log.Before merging (in order)
mode: "random"and--verbose; this PR's config failsverify-configon 0.6.x.OPENAI_API_KEYrepo secret — a Restricted key with only Responses → Request and Chat completions → Request, created in a dedicated budget-capped project.ECR_EXPECTED_TOKEN_ENVrepo variable is set, update it toCODEX_OAUTH_ACCESS_TOKEN,OPENAI_API_KEY(the variable overrides the YAML fallback).Note:
ecr ciloads config from the PR's trusted base commit, so the experiment starts for PRs opened after this merges.Reading the results
reviews.jsonl(uploaded as the run artifact) now carries the arm per run:🤖 Generated with Claude Code