Skip to content

[smoke-detector] 🚨 CRITICAL: GenAIScript Failure Persists After Model Fix - 7th Consecutive Failure (API Key or Service Issue) #2272

Description

@github-actions

🚨 CRITICAL RECURRING FAILURE - 7th Consecutive Occurrence

Summary

The Smoke GenAIScript workflow has FAILED AGAIN with the EXACT SAME ERROR, despite the model configuration being fixed from gpt-4.1 to gpt-4o in previous investigations. This is the 7th consecutive failure since 2025-10-22. The pattern has EVOLVED - the model name is now correct, but the error persists, pointing to a different root cause.

Failure Details

Root Cause Analysis - Pattern Evolution

🔄 Pattern Has Changed

Previous Issues (#2157, #2204, #2207, #2227): Invalid model name openai:gpt-4.1
Current Configuration: ✅ Valid model name openai:gpt-4o (confirmed in .github/workflows/shared/genaiscript.md:6)
Result: ❌ Same error persists

This definitively rules out model configuration as the root cause. The failure has evolved from a configuration issue to what appears to be an authentication, service availability, or code bug issue.

Error Chain (Unchanged Despite Fix)

  1. GenAIScript attempts to use model openai:gpt-4o (valid model) ✅
  2. OPENAI_API_KEY validation passes ✅
  3. GenAIScript calls OpenAI API ❓
  4. Something fails - API returns error/null/unexpected response ❌
  5. GenAIScript crashes: TypeError: Cannot read properties of undefined (reading 'text')
  6. Detection job fails with exit code 255 ❌

Stack Trace (Identical to All Previous Occurrences)

2025-10-24T06:09:40.6320337Z 2025-10-24T06:09:40.631Z genaiscript:error {
2025-10-24T06:09:40.6320853Z   name: 'TypeError',
2025-10-24T06:09:40.6321311Z   message: "Cannot read properties of undefined (reading 'text')",
2025-10-24T06:09:40.6321918Z   stack: "TypeError: Cannot read properties of undefined (reading 'text')\\n" +
2025-10-24T06:09:40.6322786Z     '    at githubActionSetOutputs ((redacted))\\n' +
2025-10-24T06:09:40.6324255Z     '    at async Command.runScriptWithExitCode ((redacted))'
2025-10-24T06:09:40.6324970Z }
2025-10-24T06:09:40.6325324Z Cannot read properties of undefined (reading 'text')

Investigation Findings

Possible Root Causes (Now That Config Is Fixed)

  1. Invalid/Expired OPENAI_API_KEY 🔴 MOST LIKELY

    • The secret may exist but be invalid/expired
    • API returning 401/403 authentication errors
    • GenAIScript doesn't properly handle auth failures
  2. OpenAI API Service Issues 🟡 POSSIBLE

    • Rate limiting (429 errors)
    • Service degradation or outages
    • Timeout issues
  3. GenAIScript Bug 🟡 POSSIBLE

    • Poor error handling in githubActionSetOutputs
    • Doesn't check for undefined before accessing .text
    • Mishandles certain API error responses
  4. MCP Configuration Issue 🟢 UNLIKELY (but noted)

    Failed to load MCP configuration: MCP configuration file not found: /tmp/gh-aw/mcp-config/mcp-servers.json
    

    This is a separate warning - MCP config is optional for this workflow

Configuration Status ✅

# .github/workflows/shared/genaiscript.md:6
GH_AW_AGENT_MODEL_VERSION: "openai:gpt-4o"  ✅ CORRECT

The model configuration was successfully updated and is now valid. The workflow also includes:

  • ✅ API key validation step (passes)
  • ✅ GenAIScript version 2.5.1 installed
  • ✅ Proper environment variable setup

Failed Jobs and Errors

Job Execution Summary

  1. activation - succeeded (2s)
  2. agent - succeeded (1.4m) - Agent completed successfully
  3. detection - FAILED (59s) - Threat detection crashed
  4. create_issue - succeeded (3s)
  5. ⏭️ missing_tool - skipped

Failure Timeline - 7 Consecutive Occurrences

# Run ID Date/Time (UTC) Hours Since Prev Model Config Status
1 18727962258 2025-10-22 19:45:52 - gpt-4.1 Issue #2157 created
2 18733557489 2025-10-23 00:19:22 ~5.5h gpt-4.1 Issue #2157 closed
3 18739169072 2025-10-23 06:07:04 ~6.2h gpt-4.1 Issue #2204 created
4 18747816413 2025-10-23 12:08:41 ~6.6h gpt-4.1 Issue #2207 created
5 18757658104 2025-10-23 18:06:57 ~6.0h gpt-4.1 Issue #2227 created
6 18765594567 2025-10-24 00:17:56 ~6.2h gpt-4o Model fixed! But still failed
7 18771194604 2025-10-24 06:06:47 ~6.1h gpt-4o This failure

Pattern: Failing every ~6 hours on scheduled runs
Duration: Over 34 hours of continuous failures
Failure Rate: 100% since first occurrence
Model Fix: Occurred between run #5 and #6, but failures continued

Recommended Actions

🔴 CRITICAL - Immediate Investigation

  • Verify OPENAI_API_KEY secret in repository settings

    • Check if the key exists
    • Test the key manually with a simple OpenAI API call
    • Rotate key if invalid/expired
    • Ensure proper permissions are set
  • Check OpenAI API Status

    • Visit (redacted)
    • Check for service degradation or outages
    • Review any rate limiting or quota issues
  • Enable Detailed Logging

    • Capture actual OpenAI API responses
    • Log HTTP status codes and error messages
    • Add verbose debugging to GenAIScript execution

🟡 HIGH PRIORITY - GenAIScript Error Handling

  • File upstream bug with GenAIScript

  • Add Retry Logic

    • Implement exponential backoff for transient failures
    • Add circuit breaker pattern for persistent failures

🟢 MEDIUM PRIORITY - Alternative Solutions

  • Consider switching providers

    • Option A: GitHub Models (github:gpt-4o)
    • Option B: Azure OpenAI (if configured)
    • Option C: Disable threat detection until issue resolved
  • Add Health Check

    • Pre-flight API key validation with test call
    • Fail fast with clear error message
    • Skip smoke test if API unavailable

🔵 LOW PRIORITY - Documentation

  • Update troubleshooting guide with API key validation steps
  • Document OpenAI API dependency and alternatives
  • Add monitoring for API key expiration

Prevention Strategies

  1. Implement API Key Health Checks - Test API keys before workflows run
  2. Better Error Handling - Fix GenAIScript to handle API failures gracefully
  3. Monitoring & Alerts - Monitor OpenAI API status and API key validity
  4. Retry Logic - Add exponential backoff for transient API failures
  5. Provider Alternatives - Configure fallback AI providers
  6. Scheduled Key Rotation - Proactively rotate API keys before expiration

Impact Assessment

Severity: 🔴 CRITICAL

  • All GenAIScript smoke tests failing continuously for 34+ hours
  • Threat detection non-functional
  • 7 consecutive failures with no resolution
  • Model fix applied but issue persists
  • Pattern evolution indicates deeper systemic issue

Urgency: 🔴 IMMEDIATE

  • Issue extends beyond configuration to authentication/service layer
  • Requires investigation of API key validity
  • May require provider change if OpenAI unreliable

Scope:

  • Affects: All workflows using GenAIScript with OpenAI
  • Frequency: Every scheduled smoke test run (~6 hours)
  • Duration: Ongoing since 2025-10-22 19:45 UTC (34+ hours)
  • Wasted CI Minutes: ~24.5 minutes (7 failures x 3.5 min average)

Historical Context

From investigation database (/tmp/gh-aw/cache-memory/investigations/):

{
  "pattern_signature": "GENAISCRIPT_INVALID_MODEL → GENAISCRIPT_API_OR_OUTPUT_ERROR",
  "pattern_evolution": true,
  "first_occurrence": "2025-10-22T19:45:52Z",
  "recurrence_count": 7,
  "failure_rate": "100%",
  "model_fix_applied": "2025-10-24 between run 5 and 6",
  "failures_after_fix": 2,
  "is_flaky": false,
  "external_dependency": "OpenAI API",
  "persistence_across_releases": true
}

Related Issues

Next Steps

This issue requires immediate attention from someone with access to:

  1. Repository secrets (to verify OPENAI_API_KEY)
  2. OpenAI account/billing (to check API key status)
  3. Alternative AI provider configuration

The model configuration has been fixed, but failures persist. This is now an authentication, service, or code bug issue - not a configuration issue.


Investigation Metadata

  • Investigator: Smoke Detector (Failure Investigation Agent)
  • Investigation Run: #18771256728
  • Pattern: GENAISCRIPT_API_OR_OUTPUT_ERROR (evolved from GENAISCRIPT_INVALID_MODEL)
  • Investigation Record: /tmp/gh-aw/cache-memory/investigations/2025-10-24-18771194604.json
  • Created: 2025-10-24T06:12:00Z

🤖 AI generated by Smoke Detector - Smoke Test Failure Investigator
This is an automated investigation of recurring smoke test failures.

AI generated by Smoke Detector - Smoke Test Failure Investigator

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions