Skip to content

fix: pass extra_headers to llm_complete in config test runner#307

Merged
pancacake merged 1 commit intoHKUDS:devfrom
OldSuns:fix/test-runner-extra-headers
Apr 14, 2026
Merged

fix: pass extra_headers to llm_complete in config test runner#307
pancacake merged 1 commit intoHKUDS:devfrom
OldSuns:fix/test-runner-extra-headers

Conversation

@OldSuns
Copy link
Copy Markdown
Contributor

@OldSuns OldSuns commented Apr 13, 2026

Problem

When users configure custom extra_headers (e.g., custom User-Agent) in the model settings page, the connection test still sends the default SDK headers (e.g., user-agent: AsyncOpenAI/Python 2.31.0) instead of the user-configured values.

Root Cause

deeptutor/services/config/test_runner.py — the _test_llm method builds an LLMConfig with extra_headers correctly, but does not pass it to llm_complete().

Fix

One-line change: add extra_headers=llm_config.extra_headers to the llm_complete() call.

+            extra_headers=llm_config.extra_headers,

Impact

  • Users with custom headers: connection test now correctly sends user-configured headers
  • Regular users (no extra_headers): no change — {} is falsy and skipped
  • Fully backward compatible

The _test_llm method in ConfigTestRunner was not forwarding extra_headers to
llm_complete(), causing custom User-Agent and other headers to be ignored
during model connection tests.

This ensures that user-configured extra_headers in model settings are properly
propagated to the LLM API call during connection testing.
@pancacake pancacake merged commit dd110e5 into HKUDS:dev Apr 14, 2026
2 checks passed
@pancacake
Copy link
Copy Markdown
Collaborator

thanks for your contribution!

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