Skip to content

[Bug]: The argument '--config' for 'openviking-server' is useless #445

@yeshion23333

Description

@yeshion23333

Bug Description

--config参数,在启动server时可以指定配置文件地址,查看代码,发现逻辑期望覆盖 环境变量 OPENVIKING_CONFIG_FILE,优先级最高。
但实际配置内容并未全部生效,该启动方法只使用了新的server配置。
排查发现实际执行链路:
指令引入:openviking-server = "openviking.server.bootstrap:main"
在引入 server 包的时候,该包init方法,已经引入了"from openviking.async_client import AsyncOpenViking"等包。
这些包都会进行logger初始化:logger = get_logger(name)
logger包的:_load_log_config() 方法也会进行 OpenVikingConfigSingleton.get_instance() 的初始化。此时环境变量还未被 --config参数覆盖,实际使用的还是默认的ov.conf路径配置。

此问题比较复杂,感觉是目前项目结构的问题,很多地方都依赖了logger,bootstrap启动应该在项目依赖的最顶端。

Steps to Reproduce

openviking-server --config /Users/bytedance/.openviking_2/ov.conf

Expected Behavior

路径配置未生效

Actual Behavior

优先使用server参数的配置

Minimal Reproducible Example

Error Logs

OpenViking Version

new version

Python Version

3.13

Operating System

macOS

Model Backend

None

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions