fix(enchante): Agent deeplink missing top-level name field - #3
Open
chenyida7-prog wants to merge 1 commit into
Open
fix(enchante): Agent deeplink missing top-level name field#3chenyida7-prog wants to merge 1 commit into
chenyida7-prog wants to merge 1 commit into
Conversation
Real-device testing on a Mac with Enchanté installed showed the Agent deeplink (enchante://agent/install) never surfaced an install prompt. Root cause: Enchanté requires the display name duplicated *inside* the base64 config JSON (top-level "name"), not only in the outer ?name= query param — without it, deserialization/validation fails silently on Enchanté's side. Adds "name" to the bundle in enchante_agent_deeplink() and asserts it in the existing test_agent_deeplink test. The MCP-only deeplink (enchante://mcp/install) and the base64 URL percent-encoding are unaffected — both already matched Enchanté's requirements.
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.
问题
在装了 Enchanté 的真机上测试 App 里"生成 Agent 链接",链接能生成,但打开后 Enchanté 没有弹出安装确认框(静默失败)。
根因
enchante_agent_deeplink()生成的configbase64 JSON 只有role/skillNames/mcpServers三个顶层字段,展示名只放在外层 URL 的?name=查询参数里。真机排查确认 Enchanté 解析config时要求 JSON 内部也要有顶层name字段,缺了这个字段会导致反序列化/校验静默失败,不会有任何报错提示。MCP-only 的 deeplink(
enchante://mcp/install)和 base64 的 URL 转义(+///=的 percent-encoding)没有这个问题,不受影响。修复
在
bundle里加了顶层"name",值与外层?name=一致,避免重复硬编码字符串。测试
按 mentor 要求只跑了精准测试,没有跑全局前端测试套件:
包含更新后的
test_agent_deeplink(新增断言bundle["name"] == "MyKnowledge 知识管理专家")和test_agent_deeplink_shorter_than_before(确认加了字段后链接长度仍在 4206 字符基线内,实测 2178)。未在真机上重新验证 Enchanté 侧是否真的弹出安装框(需要那台装了 Enchanté 的 Mac),麻烦 review 时确认一下。