Skip to content

fix(onboarding): pass the OpenRouter key to qsv describegpt via QSV_LLM_APIKEY - #18

Merged
jqnatividad merged 1 commit into
dathere:mainfrom
jqnatividad:qsv-llm-key-via-env
Oct 8, 2026
Merged

jqnatividad merged 1 commit into
dathere:mainfrom
jqnatividad:qsv-llm-key-via-env

Conversation

@jqnatividad

Copy link
Copy Markdown
Collaborator

run_qsv_describegpt passed the OpenRouter key on --api-key. describegpt copies its command line into the attribution of the descriptions it generates, so the key ended up in qsv_dict.json, meta.json and index.json. That is why the _scrub_secrets and scrubbed_json_bytes redaction exists. Putting it on argv also exposed it to other local users through ps.

qsv reads the same key from QSV_LLM_APIKEY when --api-key is absent (src/cmd/describegpt.rs), so this passes it in the child's environment instead. The base URL and model stay on the command line.

  • The existing scrubbers are kept, since data onboarded before this change still contains the key. Their comments are updated to say so.
  • New tests/unit/test_qsv_profiling.py runs run_qsv_describegpt against a fake qsv on PATH that records its argv and environment. It asserts the key arrives in QSV_LLM_APIKEY and appears nowhere in argv. I mutation-checked it: putting --api-key back makes the test fail.
  • tests/unit all pass (974 passed, 2 skipped), and ruff is clean.

This is the first, standalone step of moving Verikan's qsv calls onto qsv-client, which also adds timeouts and typed errors.

🤖 Generated with Claude Code

…LM_APIKEY

describegpt copies its command line into the descriptions it generates, so
the key passed on --api-key ended up in qsv_dict.json, meta.json and
index.json (and was visible to other local users in ps). qsv reads the same
key from QSV_LLM_APIKEY when --api-key is absent, so pass it there.

The existing scrubbers stay: data onboarded before this change still
contains the key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jqnatividad
jqnatividad merged commit 7c6bb1c into dathere:main Oct 8, 2026
6 checks passed
@jqnatividad
jqnatividad deleted the qsv-llm-key-via-env branch October 8, 2026 19:27
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.

1 participant