feat: add user agent pass-through settings#1231
feat: add user agent pass-through settings#1231looplj merged 5 commits intolooplj:release/v0.9.xfrom
Conversation
…ponents - Add system-wide User-Agent pass-through settings with UI in general-settings component. - Implement User-Agent header pass-through for channel LLM requests via orchestrator middleware. - Update LLM HTTP client to respect channel-level User-Agent pass-through settings with fallback to global settings. - Enhance channels-action-dialog with user agent configuration support. - Add GraphQL resolvers and schema for UserAgentPassThroughSettings management. - Add comprehensive test coverage for system settings and orchestrator overrides.
…gh was enabled initially - Set AxonHub default User-Agent when pass-through is disabled instead of leaving it empty. - Update test to expect AxonHub default User-Agent when pass-through is disabled.
… update flow - Created conditional proxy config based on proxyType supporting disabled, environment, and URL modes. - Applied mergeChannelSettingsForUpdate to sync proxy config and passThroughUserAgent with existing settings. - Updated update mutation flow to include nextSettings instead of undefined.
There was a problem hiding this comment.
Code Review
This pull request introduces a User-Agent Pass-Through feature, enabling the forwarding of original client User-Agent headers to upstream AI providers via global system settings or channel-level overrides. The implementation includes frontend UI components, GraphQL schema updates, and a new orchestrator middleware. Feedback identifies logic issues where the pass-through mechanism could overwrite custom header overrides, suggests simplifying the HTTP client model by removing redundant fields, and points out minor indentation errors in the frontend code.
…ducing redundant proxy config - Pass settings from currentRow to edit route values for proper initialization. - Remove redundant proxy config object from mergeChannelSettingsForUpdate call.
…A handling logic - Removed PassThroughUserAgent boolean field from Request struct in model.go. - Simplified BuildHttpRequest to only set default User-Agent when header is empty. - Removed pass-through field assignments from orchestrator middleware (override.go). - Updated test cases to remove expectations for the removed field. - Fixed error handling in GeneralSettings component with proper state reversion.
|
tested and working. Tried combinations of channel-specific setting on/off+global setting on/off. |
|
Just confirm, the system will pass-through user-agent by default. Will this pr break the default behavior. |
No, the PR keeps the default behavior unchanged: By default, the axonhub user-agent is sent upstream to API endpoints, and the user has to enable user-agent pass-through. |
Clean implementation of user agent pass-through settings for channels.
Replaces #1204 which had Git contamination issues.
Changes