Skip to content

feat(client): ovcli.conf 支持 timeout 配置 + 修复 Rust CLI agent_id#308

Merged
qin-ctx merged 1 commit intomainfrom
feat/http-timeout-config
Feb 26, 2026
Merged

feat(client): ovcli.conf 支持 timeout 配置 + 修复 Rust CLI agent_id#308
qin-ctx merged 1 commit intomainfrom
feat/http-timeout-config

Conversation

@qin-ctx
Copy link
Collaborator

@qin-ctx qin-ctx commented Feb 26, 2026

Description

为 Python 和 Rust CLI 客户端添加通过 ovcli.conf 配置 HTTP 超时的支持,同时修复 Rust CLI 未正确读取 agent_id 的问题。

Related Issue

Closes #306

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update

Changes Made

  • Python HTTP 客户端 (openviking_cli/client/http.py): 从 ovcli.conf 读取 timeout, 优先级: SDK 显式传参 > ovcli.conf > 默认值 60.0
  • Python 同步客户端 (openviking_cli/client/sync_http.py): 透传 timeout 参数到 AsyncHTTPClient
  • Rust CLI 配置 (crates/ov_cli/src/config.rs): 将未使用的 user 字段替换为 agent_id, 新增 timeout 字段 (serde 默认 60.0)
  • Rust CLI 客户端 (crates/ov_cli/src/client.rs): 接收 agent_idtimeout_secs 参数, 发送 X-OpenViking-Agent 请求头, 与 Python 客户端对齐
  • Rust CLI 入口 (crates/ov_cli/src/main.rs): 将配置中的 agent_idtimeout 传递给 HttpClient
  • 文档: 将 timeout 文档从 configuration guide 移至 API overview (中英文)
  • 示例: ovcli.conf.example 加入 timeout 字段, 更新代码示例

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

Rust CLI 此前有一个从未使用的 user 字段, 且不支持 agent_id 和可配置超时。本 PR 将 Rust CLI 与 Python 客户端对齐:

  1. ovcli.conf 读取 agent_id 并作为 X-OpenViking-Agent 请求头发送
  2. ovcli.conf 读取 timeout 并应用到 reqwest HTTP 客户端

…lignment

- Python HTTP client reads `timeout` from ovcli.conf when using default value,
  with priority: SDK explicit param > ovcli.conf > default 60.0
- Rust CLI: replace unused `user` field with `agent_id`, send X-OpenViking-Agent
  header to align with Python client behavior
- Rust CLI: read `timeout` from ovcli.conf and pass to reqwest client
- Move timeout documentation from configuration guide to API overview
- Update examples and ovcli.conf.example with timeout field

Closes #306

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qin-ctx qin-ctx merged commit 1a40839 into main Feb 26, 2026
10 of 11 checks passed
@qin-ctx qin-ctx deleted the feat/http-timeout-config branch February 26, 2026 09:25
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug] HTTP 客户端缺少超时配置选项,请求容易超时

3 participants