feat(bot): add unified VikingBot gateway routing and OpenViking auth#3119
Merged
Conversation
# Conflicts: # bot/vikingbot/config/loader.py # crates/ov_cli/src/error_ui.rs
chenjw
approved these changes
Jul 10, 2026
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.
English
Summary
This PR makes VikingBot Gateway a first-class OpenViking CLI endpoint while preserving the existing
openviking-server --with-botpath.ov chat -> OpenViking server -> /bot/v1 -> VikingBot Gateway./api/v1/*proxying forov list,search,session, and other CLI commands.Related RFC: Discussion #3042
Routing
Modes
openviking-server --with-bot/bot/v1route and injects request-scoped identity503Key changes
explicit,inherited, andstandaloneupstream states internally; no newsourceortargetconfig fields.auth_modeat startup, then rechecks it per request and fails closed on mode changes.bot.gateway.tokenonly for non-localhost Gateway listeners. The CLI sends it only after a marked Gateway challenge and never forwards it upstream.ov chatoutput and actionable errors for missing identity, missing keys, standalone proxy, and dev-mode boundaries.Verification
416tests passed.103tests passed.--with-botroute, direct Gateway chat, API proxying, standalone mode, public Gateway token checks, anddev/api_key/trustedauthentication.中文
概述
本 PR 在保留
openviking-server --with-bot旧链路的基础上,将 VikingBot Gateway 扩展为 OpenViking CLI 的统一入口。ov chat -> OpenViking server -> /bot/v1 -> VikingBot Gateway。/api/v1/*代理,支持ov list、search、session等命令。关联 RFC:Discussion #3042
调用链路
使用模式
openviking-server --with-bot/bot/v1,注入 request-scoped 身份503主要改动
explicit、inherited、standalone状态,不新增source、target配置。auth_mode,请求时实时复核;模式变化时 fail closed。bot.gateway.token。CLI 只在收到带标识的 Gateway challenge 后发送 token,且不会转发给 OpenViking。ov chat的中英文展示,以及身份缺失、Key 缺失、standalone proxy、dev 安全边界等错误提示。验证
416项测试通过。103项测试通过。--with-bot链路、Gateway 直连对话、API proxy、standalone、公网 Gateway token,以及dev/api_key/trusted三种鉴权模式。