Skip to content

fix: use resolved LLM key for PageIndex - #209

Draft
wachiravit-thitagran wants to merge 1 commit into
VectifyAI:mainfrom
wachiravit-thitagran:fix/pageindex-llm-settings
Draft

fix: use resolved LLM key for PageIndex#209
wachiravit-thitagran wants to merge 1 commit into
VectifyAI:mainfrom
wachiravit-thitagran:fix/pageindex-llm-settings

Conversation

@wachiravit-thitagran

@wachiravit-thitagran wachiravit-thitagran commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • pass the per-request credential bundle into long-document PageIndex indexing
  • forward LLM_API_KEY, base URL, headers, and timeout through PageIndex llm_params
  • use a narrow local-client adapter so an explicit resolved key satisfies provider validation without mutating process-wide OPENAI_API_KEY
  • preserve the existing UI persistence and once-per-request credential resolution flow

Root cause

PageIndex validates provider-specific process environment variables during local client construction, before its per-call llm_params are used. OpenKB stores the UI key as LLM_API_KEY and resolves it into an isolated request bundle, so OpenAI-compatible models failed with OPENAI_API_KEY missing even though the UI key was configured.

Validation

  • pytest tests/test_indexer.py tests/test_add_command.py tests/test_api.py -q (224 passed)
  • ruff check and ruff format --check on changed files
  • mypy openkb/cli.py openkb/indexer.py
  • git diff --check

Warning

AI-generated code: This fix was generated by GPT-5.6 Sol.

@mike-011

Copy link
Copy Markdown

It looks like this is a related issue #205

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants