{{ message }}
Repository navigation
fix: standardize provider user agents with the AstrBot version - #10082
Merged
Merged
Conversation
9 tasks done
GuJi08233
added a commit
to GuJi08233/AstrBot
that referenced
this pull request
Sep 17, 2026
The StepFun ASR provider predates the provider user agent standardization (AstrBotDevs#10082) and built its request headers from scratch, so its requests carried aiohttp's default user agent and silently ignored the custom_headers config. Merge self.request_headers into the request, with the SSE protocol headers (Content-Type, Accept, Authorization) applied last so a custom Accept cannot break the stream.
BegoniaHe
pushed a commit
to Xero-Team/Zephirum
that referenced
this pull request
Sep 17, 2026
…otDevs#10082) Wire build_provider_headers into the fork provider sources, including openai_chat_completions_source and openai_responses_source. Keep Edge TTS as a lazy import. Tests live under tests/unit/provider/. Upstream-Commit: d524b87 Upstream-Author: Soulter <37870767+Soulter@users.noreply.github.com> Upstream-PR: AstrBotDevs#10082 Sync-Disposition: adapt Fork-Adaptation: Map openai_source.py onto openai_chat_completions_source.py and openai_responses_source.py; keep Edge TTS importlib loading; omit missing dashscope embedding and TEI sources; tests under tests/unit/provider/. Tested: uv run pytest tests/unit/provider/test_provider_user_agent.py tests/unit/provider/test_anthropic_kimi_code_provider.py tests/unit/provider/test_openai_chat_completions_source.py tests/unit/provider/test_openai_responses_source.py tests/unit/provider/test_openai_embedding_source.py tests/unit/provider/test_opencode_go_providers.py tests/unit/provider/test_ssycloud_source.py tests/unit/provider/test_mirarouter_source.py -q --test-profile blocking AI-Generated: true Generated-At: 2026-09-16T06:51:43Z
BegoniaHe
added a commit
to Xero-Team/Zephirum
that referenced
this pull request
Sep 17, 2026
Record dispositions for bd046ed..ab42c0d: adapt AstrBotDevs#10082, AstrBotDevs#10069, AstrBotDevs#10084, AstrBotDevs#10079, and AstrBotDevs#10071; cherry-pick AstrBotDevs#10046; skip AstrBotDevs#10085. Advance the cursor to ab42c0d and note absorbed 4.28.1 changelog entries. AI-Generated: true Generated-At: 2026-09-16T07:05:28Z
buyun14
added a commit
to buyun14/AstrBot
that referenced
this pull request
Sep 17, 2026
… test Upstream AstrBotDevs#10082 injects a versioned User-Agent into every provider's headers; the PR AstrBotDevs#9852 assertion predates it and must account for the added header.
buyun14
added a commit
to buyun14/AstrBot
that referenced
this pull request
Sep 17, 2026
… test Upstream AstrBotDevs#10082 injects a versioned User-Agent into every provider's headers; the PR AstrBotDevs#9852 assertion predates it and must account for the added header.
4 tasks done
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Provider requests currently use SDK-specific or hardcoded user agents. Default built-in chat, speech, embedding, and reranking requests to
astrbot/<version>, derived fromastrbot.__version__. Preserve configured HTTP User-Agent overrides regardless of header casing, and remove hardcoded Claude Code headers from new coding-plan provider templates. Existing saved custom headers are preserved.Cover both SDK clients and direct HTTP sessions, including SDK-specific handling for Gemini, DashScope, and Edge TTS. Gemini's generated duplicate header is removed after client initialization; Edge TTS uses its shared SDK synthesis-header default because it does not expose a per-client header option.
Validation:
ruff format .,ruff check ., and 230 passing targeted Python tests. New tests capture local HTTP and WebSocket requests to verify exact default and custom user agents. External provider authentication and service acceptance were not exercised.Summary by Sourcery
Standardize provider User-Agent headers around the current AstrBot version while retaining explicit user configuration.
Bug Fixes:
astrbot/<version>while preserving configured custom overrides regardless of header casing.Enhancements:
Tests: