Skip to content

fix: use resolved LLM key for PageIndex - #209

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

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

@veereshkumar-se

Copy link
Copy Markdown

Formations · PR #209 · 820b989359cc · NO ACTION

—

PR tests

—

Intent

—

Severity

0

Impacted

—

Selfhealed

Details

1 · PR tests

No PR test run recorded for this head.

2 · Classification

Intent: — · Severity: —

Copy link
Copy Markdown
Author

Closing this PR as superseded by #250. The underlying PageIndex credential-forwarding issue is still relevant, but #250 covers it more comprehensively and also addresses the local SQLite connection cleanup problem (#249).

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.

3 participants