fix: analyzer OpenAI runtime guard, fetch timeout/retry, model env var#3
Open
arc-web wants to merge 15 commits into
Open
fix: analyzer OpenAI runtime guard, fetch timeout/retry, model env var#3arc-web wants to merge 15 commits into
arc-web wants to merge 15 commits into
Conversation
A3: Add a runtime guard in callOpenAI that throws a clear error when OPENAI_API_KEY is missing or malformed instead of silently failing with a 401. Replace bare fetch with fetchWithRetry (30s timeout, 2 retries with backoff) to handle transient network errors. A4: Replace hardcoded 'claude-haiku-4-5-20250315' at line 15 with process.env.EXITSTORM_ANALYSIS_MODEL ?? 'claude-haiku-4-5-20250315'. Document the new var in .env.example and README.md environment table. Agent: claude-sonnet-4-6 Session: action-a-exitstorm-rebuild Plan: ~/.claude/plans/inherited-exploring-lovelace.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
A3 - OpenAI runtime guard + fetch resilience
callOpenAInow throws a clear, actionable error ifOPENAI_API_KEYis missing or doesn't start withsk-, instead of sending a malformed request and getting a 401fetchwithfetchWithRetryhelper: 30s timeout viaAbortController, up to 2 retries with 500ms/1000ms backoff on network errors (not on HTTP errors - those surface immediately)A4 - Model ID env var
callAnthropicnow readsprocess.env.EXITSTORM_ANALYSIS_MODEL ?? 'claude-haiku-4-5-20250315'instead of hardcoding the modelEXITSTORM_ANALYSIS_MODELdocumented in.env.exampleand the new env var table inREADME.mdTest plan
pnpm typecheck)EXITSTORM_ANALYSIS_MODEL=claude-opus-4-5is picked up at runtimeanalyzeProjectwith no keys throws the new descriptive errorAgent: claude-sonnet-4-6
Session: action-a-exitstorm-rebuild
Plan: ~/.claude/plans/inherited-exploring-lovelace.md