Skip to content

fix(ai): correct the Context Chat embedding API key env var name - #15495

Open
bakiburakogun wants to merge 1 commit into
nextcloud:masterfrom
bakiburakogun:fix/context-chat-embedding-apikey-env
Open

fix(ai): correct the Context Chat embedding API key env var name#15495
bakiburakogun wants to merge 1 commit into
nextcloud:masterfrom
bakiburakogun:fix/context-chat-embedding-apikey-env

Conversation

@bakiburakogun

Copy link
Copy Markdown

The Context Chat scaling section documents the embedding API key as CC_EM_API_KEY, but context_chat_backend reads CC_EM_APIKEY.

In context_chat_backend/config_parser.py:

if os.getenv('CC_EM_BASE_URL'):
    if os.getenv('CC_EM_APIKEY'):
        auth = TEmbeddingAuthApiKey(apikey=os.environ['CC_EM_APIKEY'])
    elif os.getenv('CC_EM_USERNAME') and os.getenv('CC_EM_PASSWORD'):

CC_EM_APIKEY appears four times across the repository; CC_EM_API_KEY appears nowhere. The other three names in the same sentence — CC_EM_BASE_URL, CC_EM_MODEL_NAME, CC_EM_USERNAME, CC_EM_PASSWORD — all match the code.

The failure mode is quiet: an administrator who follows the documentation sets a variable nothing reads, auth falls through to None, and the backend talks to the embedding service unauthenticated. Depending on how that service answers, the first sign of trouble is an indexing failure some distance away from the cause.

I hit this while setting up an on-premises embedding service for a Nextcloud 34 installation.

Only the documented name is changed here. If you would rather the code accept both spellings, I am happy to open that against context_chat_backend instead.

@kyteinsky kyteinsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@kyteinsky

Copy link
Copy Markdown
Contributor

will backport this after #15491 and its backports are in.

The documented name is CC_EM_API_KEY, but context_chat_backend reads
CC_EM_APIKEY. An administrator following the docs gets an unauthenticated
embedding client with no obvious sign of why.

Signed-off-by: Baki Burak Öğün <63836730+bakiburakogun@users.noreply.github.com>
@bakiburakogun
bakiburakogun force-pushed the fix/context-chat-embedding-apikey-env branch from bc5e792 to 3a98eda Compare August 30, 2026 03:49
@kyteinsky

Copy link
Copy Markdown
Contributor

/backport to stable35

@kyteinsky

Copy link
Copy Markdown
Contributor

/backport to stable34

@kyteinsky

Copy link
Copy Markdown
Contributor

/backport to stable33

@kyteinsky

Copy link
Copy Markdown
Contributor

/backport to stable32

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants