Skip to content

Per-job NIM API key silently dropped for TXT/SRT/DOCX (EPUB-only forwarding) #230

Description

@hydropix

Summary

A per-job NIM API key supplied in the web UI is silently dropped for TXT, SRT, and DOCX jobs — only EPUB forwards it. The factory then falls back to the .env value, and if .env has no NIM key the job errors despite a valid key having been provided.

Where

  • src/core/adapters/translate_file.py:277-286 (TXT/SRT adapter path: llm_config omits nim_api_key)
  • src/core/adapters/translate_file.py:204-215 (DOCX create_llm_provider call omits nim_api_key)
  • Fallback: src/core/llm/factory.py:157-159

Details

translate_file accepts nim_api_key and forwards it for the EPUB path, but the adapter path (TXT/SRT) and the DOCX path don't include it in the config passed to the provider factory. The factory falls back to the .env NIM key; with no .env key the job fails even though the user provided one.

Suggested fix

Thread nim_api_key into the llm_config for the TXT/SRT adapter path and into the DOCX create_llm_provider call, matching the EPUB path. Check whether any other per-job keys share the same gap.


Found during the June 2026 repo audit. Severity: low-medium. Confidence: certain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — bounded impactaudit-2026-06Found during the June 2026 repo auditbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions