Skip to content

feat(openviking-controlplane): 新增数据空间(Account)管理,发布 0.3.0 - #435

Merged
cuericlee merged 2 commits into
volcengine:mainfrom
t0saki:feat/openviking-controlplane-account
Sep 18, 2026
Merged

cuericlee merged 2 commits into
volcengine:mainfrom
t0saki:feat/openviking-controlplane-account

Conversation

@t0saki

@t0saki t0saki commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

概述

对接 OpenViking 企业版新增的「数据空间(Account)」能力。数据空间是同一个 OV 库内的一级隔离边界:不同数据空间的用户、鉴权凭证、记忆、资源、会话与技能互相不可见。

MCP tool 与 ov-cp 命令共用 client.py,下述能力在两个前端完全一致。覆盖的 Action 从 11 个扩展到 14 个,版本 0.2.0 → 0.3.0。

主要变更

1. 数据空间管理:新增 3 个 Action(627c457)

Action MCP tool CLI
CreateOpenVikingAccount create_collection_account ov-cp account create <rid> <account>
ListOpenVikingAccounts list_collection_accounts ov-cp account list <rid> [--keyword] [--page] [--limit]
⚠️ DeleteOpenVikingAccount delete_collection_account ov-cp account delete <rid> <account> [--yes]
  • 数据空间 ID 在本地按命名规则预校验(1-64 字符、仅 [A-Za-z0-9_.@-]、不以 _ 开头、不能是 . / ..、至多一个 @),非法输入不发请求,报错附带完整规则
  • 删除是级联且不可撤销的操作:默认交互确认,提示中写明销毁范围,--yes 跳过;default 数据空间在确认提示之前就被本地拒绝,不会让用户走完确认才收到服务端报错
  • MCP tool 名带 collection_ 前缀,与现有 *_collection_user* 对齐,也避免和"火山账号"的 account 语义混淆

2. 存量接口增加可选数据空间范围(627c457)

  • user list|register|update|delete、api-key、usage 新增 --account-id(MCP 侧 account_id),不传即 default 数据空间
  • usage 支持三级下钻:库级总览 → --account-id → --account-id --user-id。按数据空间或用户查询时不返回 EstimatedCosts / EstimatedBilling:费用是库级口径,贴在切片上会误导,同时省掉一次 GetOpenVikingCollection 请求
  • 向后兼容:不传新参数时请求体与 0.2.0 逐字节一致。test_user_contract.py 中既有的 client 层 wire 断言一字未改、全部通过

3. 字段名对齐 OpenVikingAccountID(8a8f6b1)

后端把数据空间字段从 AccountID 改名为 OpenVikingAccountID,请求和响应两侧都改了。旧实现除 usage 外都发 AccountID,后端报 InvalidParameter: AccountID is empty。本提交统一改名,account list 表格与 MCP tool 的返回值说明也改读新字段。

4. 展示

  • account list 渲染为 Data Spaces 表格(ID / 用户数 / 创建时间 / 是否默认)
  • 按数据空间或用户查询的 usage 面板不再显示 ¥—,改为说明费用按全库统计

5. 文档

  • README / README_zh / SKILL.md 补充数据空间章节、命令示例与命名规则
  • SKILL.md 对删除数据空间要求两步确认:先向用户复述目标库、数据空间 ID 与完整销毁范围,再让用户复述 ID 后才允许 --yes;禁止从 account list 的模糊匹配推断 ID
  • 示例中的个人信息替换为通用占位(<swimlane>、alice)

验证

  • 单元测试:94 个全部通过(NO_COLOR=1 TERM=dumb python -m unittest discover -s tests),新增 tests/test_account_contract.py 覆盖 client wire 契约、CLI、MCP 与三层签名一致性
  • mcp.list_tools() 返回 14 个 tool
  • mock 响应冒烟:account list / account create 的请求体与渲染符合接口文档

t0saki and others added 2 commits September 1, 2026 13:36
Add account lifecycle support across the shared client, CLI, and MCP surfaces, thread account scopes through user and usage operations, and document the 0.3.0 contract.

Validate identifiers locally, preserve legacy request bodies when account scope is omitted, and cover the new wire contracts and destructive confirmations.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
…ntID

The control plane renamed the data-space field from AccountID to
OpenVikingAccountID on both requests and responses, so account-scoped calls were
rejected with "AccountID is empty". Send and read the new name across the shared
client, the account renderer, the MCP tool contracts, and the wire tests.

Replace personal names in the CLI and documentation examples with generic
placeholders.
Copilot AI lite review requested due to automatic review settings September 18, 2026 03:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cuericlee cuericlee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@cuericlee
cuericlee merged commit e20be24 into volcengine:main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants