feat: forward request headers to model providers#3243
Open
xingguo-yang wants to merge 5 commits into
Open
Conversation
qin-ctx
requested changes
Jul 15, 2026
qin-ctx
left a comment
Collaborator
There was a problem hiding this comment.
该 PR 的请求内动态 header 解析实现清晰,但当前请求上下文无法覆盖 OpenViking 的后台 task 和 QueueManager 执行链路。默认资源导入、semantic/VLM、embedding、watch、reindex、session commit 等路径会在响应返回后或独立线程/event loop 中调用模型,因此需要先明确并补齐凭证 handoff 生命周期。
added 4 commits
July 16, 2026 19:23
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.
Description / 说明
背景
OpenViking 接入企业内部的模型代理时,代理通常需要认证或租户路由请求头。当前
extra_headers只能配置固定值,因此无法把调用 OpenViking 时携带的用户级Authorization、租户 ID 等信息继续传给下游模型服务。解决方案
本 PR 在现有
extra_headers中增加一个显式的动态取值语法:{ "extra_headers": { "Authorization": "@request.header.Authorization", "X-Tenant-ID": "@request.header.X-OpenViking-Tenant", "X-Proxy-Route": "primary" } }@request.header.<请求头名>:每次调用模型时,从当前 OpenViking HTTP 请求中读取对应请求头。"primary"):仍按原逻辑作为固定值发送。这样既能满足 Bearer Token、租户标识等动态认证场景,也不需要给 VLM、Embedding、Rerank 分别增加新配置字段。
影响范围
动态请求头已接入以下模型调用链路:
原有配置无需修改,未使用
@request.header.*的用户行为保持不变。兼容性与安全性
@request.header.<name>时才会动态解析,普通字符串不会被误处理。api_key和extra_headers已脱敏,避免认证信息出现在日志中。api_key回退行为。Human Involvement / 人工参与
Related Issue / 关联 Issue
暂无。
Type of Change / 变更类型
Changes Made / 主要改动
@request.header.<name>解析逻辑。extra_headers调用链路中解析动态值。api_key回退行为兼容。Testing / 测试
验证结果:
97 passedragfs_python原生库未能执行;该限制与本次改动无关Checklist / 检查项