Skip to content

401 Response Clears Access Token #455

@JWShroyer

Description

@JWShroyer

Description

Friday, Nov 14th my team's service stopped working completely across two hosts because OpenAI's API returned a 401 response during service degradation.

This caused ktor to attempt to refresh the token, but because there's no refreshToken callback provided, it defaults to returning null and sets the token to this new value.

We fixed the issue by redeploying our service in the meantime while looking for the root cause.

Steps to Reproduce

  1. Have the OpenAI API return a 401 or mock a 401 response causing ktor's refreshToken logic to fire
  2. Subsequent API calls are missing the Bearer accessToken

Environment

  • openai-kotlin version: 4.0.1
  • Kotlin version: 2.0.0
  • OS: All

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions