Skip to content

[Bug][personal-assistant]: statewave_integration.py reads OPENAI_API_KEY while the rest of the repo uses LLM_API_KEY #480

Open
smaramwbc/statewave-personal-assistant
#4

Description

@jy7lsna

Affected Component

statewave-personal-assistant — statewave_integration.py, app/static/integrate.html

Bug Description

The app and the copy-paste integration module read the LLM key from different env vars:

  • The app, .env.example, README.md (lines 175, 608, 612) and CLAUDE.md all use LLM_API_KEY.
  • statewave_integration.py:56 reads OPENAI_API_KEY: AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY", "")), and its docstring (line 19) plus integrate.html (lines 358, 555) say the same.

statewave_integration.py is the file the /integrate page tells people to download (GET /static/statewave_integration.py). Someone who already has a working .env from this repo runs it and gets an OpenAI 401, because OPENAI_API_KEY is empty.

Expected Behavior

One env var name across the repo.

Suggested fix

In statewave_integration.py, read LLM_API_KEY and fall back to OPENAI_API_KEY:

api_key=os.getenv("LLM_API_KEY") or os.getenv("OPENAI_API_KEY", "")

Then update the docstring and the two spots in integrate.html to match.

Steps to Reproduce

  1. cp .env.example .env, fill in LLM_API_KEY.
  2. python statewave_integration.py (runs its _smoke() demo) → OpenAI authentication error.

Environment

main @ e89f33b.

Severity

Low — a confusing first-run failure in the "integrate it into your app" path.

Activity

  1. stealth-raptor commented on Oct 5, 2026

    @stealth-raptor

    Hi @jy7lsna I would like to work on this issue. I will look into the existing implementation and submit a PR with the fix

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions