fix(openviking): support discovery with user-bound API keys - #276
Merged
Merged
Conversation
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.
摘要 / Summary
OpenViking 的普通 user key 无权枚举 Admin API,导致保存服务配置失败。本修复允许显式填写
discoveryUser,使用数据面只读校验同步一个用户空间,并使后续请求遵循 key 绑定的身份。OpenViking service saves fail when a user key cannot enumerate Admin APIs. An explicit
discoveryUsernow validates and synchronizes one namespace through the read-only data API, and subsequent operations use the identity bound to the key.关联 Issue 或背景 / Related Issue or Context
Fixes #271
基于 main
84d469ffa838a36fa579295d94029fcac8ac058e的隔离工作树。已检索所有状态的相关 PR,核对 #234 的精确写入约束;未改动无关 draft #229。Developed in an isolated checkout from main
84d469f, after checking related PRs in every state and preserving #234's exact-write contract. The unrelated draft #229 is untouched. Implementation commit:4ed532540a6353e87be08f744934d9c51f829c5b.涉及区域 / Affected Areas
PR 类型 / PR Type
最新代码确认 / Latest Codebase Confirmation
main分支开发,或在提交前已 rebase 或合并最新main。 / I developed from the latestmain, or rebased or merged the latestmainbefore submitting.同步命令 / Sync command:
AI 编码披露 / AI Coding Disclosure
使用的 AI 模型 / AI model used: gpt-6-astra (max)
使用的编码 Agent 工具 / Coding Agent tool used: Codex
仓库规范检查 / Repository Rules
@deepseek-ai/*NPM 契约。 / I did not modify DSH source or point tsconfig at a DSH source checkout, and used only published@deepseek-ai/*NPM contracts.src/host/protocol.ts为准,没有在两侧重复定义 wire DTO。 / The Client and Host boundary still uses browser-safesrc/host/protocol.tsas the source for wire DTOs.lib/文件。 / I did not commit tokens, credentials, private memory, unredacted logs, or generatedlib/files.兼容性与数据安全 / Compatibility and Data Safety
account、discoveryUser与 API key,使用GET /api/v1/fs/ls验证现有用户记忆根。字段留空保留原 admin 发现,不在失败后自动降级;拒绝、无效响应、超时或取消均不替换原服务配置。 / Explicit user-key discovery requires safe account/user identifiers and a key, then validates the existing root withfs/ls. EmptydiscoveryUserpreserves admin discovery. No automatic fallback or health-only acceptance; failed validation leaves prior settings intact.api_key模式从 key 解析身份,因此此模式不发送 trusted account/user 请求头;account标识本地映射,不能验证或覆盖 key 所属账号。后续读取、精确写入和删除均保持该约束,并拒绝空间用户与配置不匹配。 / Data operations omit trusted identity headers because the backend binds identity to the key. The account identifies the local projection; it cannot verify or override that identity. All subsequent data operations retain the selected user scope.@deepseek-ai/*npm 包;真实 WebUI 为 DSH0.1.7-alpha.1、17 个打包 Mnemon 制品与校验过的官方 CLI0.2.9。 / Unchanged published DSH packages only; browser validation uses DSH0.1.7-alpha.1, 17 packed Mnemon artifacts and verified official CLI0.2.9.本地验证 / Local Validation
执行的命令 / Commands run:
结果摘要 / Result summary:
完整
verify通过:根测试 1,352 通过 / 6 跳过,16 个插件合计 402 通过 / 2 跳过;OpenViking 独立包 69 通过(含新路径 20 项)/ 1 个可选 live 测试跳过。新增真实 Host 组合回归与 2 个通用设置表单分支通过,官方 Mnemon CLI 0.2.9 的 Native Source 集成、Headless、可复现构建和公开包检查均通过。Full
verifypassed: 1,352 root tests and 402 plugin tests, with 8 documented optional/platform skips. OpenViking passed 69 tests, including 20 new regressions. The composed Host, accepted/rejected generic settings form, real Native CLI, Headless, deterministic builds and public package checks passed.顺序
verify:plugins --skip-build通过全部 16 个独立插件、17 个 tarball、外部 SDK 消费者、真实 DSH Starter 及可选 Strategy 组合,且无工作区依赖泄漏。/ Sequential artifact verification passed all 16 independent plugins, 17 tarballs, the public SDK consumer, and real DSH Starter/optional Strategy composition without workspace links.首次并发运行触发已有性能或 UI 超时;保留失败记录,未扩大测试时限或性能预算。根测试在独占窗口、单 Vitest worker 下完整通过。制品检查以公开
MNEMON_PLUGIN_VERIFY_CONCURRENCY=1顺序执行。/ Initial concurrent runs hit existing timing/UI timeouts; those outcomes are retained and no timeout or budget was increased. The unchanged root suite passed in an exclusive window; artifacts use the script’s public single-package setting.文档检查通过 1,734 个本地链接与 66 个 Markdown 锚点,双语路径及官方插件覆盖通过;changeset 覆盖 Provider 和 Memory Spaces Source 的发布输入。/ Documentation passed 1,734 local links, 66 anchors, bilingual paths and official plugin coverage; changeset coverage passed for Provider and Memory Spaces Source publication inputs.
用户可见变更证据 / Local Feature Evidence
证据 / Evidence:
完整的中英文验收记录、前后 tarball 哈希、官方 DSH 字节证明和脱敏请求记录见 English / 中文。实现为
4ed532540a6353e87be08f744934d9c51f829c5b,真实 WebUI 使用该实现对应的 17 个制品。The bilingual record contains before/after artifact hashes, unchanged official DSH byte checks, and redacted requests. The real WebUI uses all 17 artifacts corresponding to implementation
4ed5325.基线在 account 留空与填写后均收到 Admin access restrictions;请求分别为 accounts 与 users。/ Baseline saves fail with the account empty and filled, reaching the accounts and users Admin routes respectively.
修复后:
alice保存成功;bob保存被拒,原 key 与唯一活动alice映射经持久化核验保持。拒绝后浏览与直接检索均显示 1 条原 canary,Runtime 独立写入 1 条组合 canary。最终 11 条 Provider 请求中 Admin 调用、account/user 身份请求头均为 0。After the fix,
alicesaves successfully. Replacing it withbobis rejected while the original key and sole activealiceprojection remain persisted. Content and direct search still show one exact canary, and Runtime independently stores one composition canary. All 11 Provider requests use data APIs with zero Admin calls or account/user identity headers. See persisted-state and browser checks and real CLI composition.验证边界 / Validation limits: OpenViking responses come from an official-contract loopback fixture. This is not a real Volcengine account, live cloud availability, semantic-model quality or cloud write-permission certification. / OpenViking 响应来自基于官方契约的回环夹具,并非真实火山云账号、在线云服务、语义模型质量或云端写权限认证。