Skip to content

fix(enchante): Agent deeplink missing top-level name field - #3

Open
chenyida7-prog wants to merge 1 commit into
mainfrom
fix/enchante-agent-deeplink-missing-name
Open

fix(enchante): Agent deeplink missing top-level name field#3
chenyida7-prog wants to merge 1 commit into
mainfrom
fix/enchante-agent-deeplink-missing-name

Conversation

@chenyida7-prog

Copy link
Copy Markdown
Collaborator

问题

在装了 Enchanté 的真机上测试 App 里"生成 Agent 链接",链接能生成,但打开后 Enchanté 没有弹出安装确认框(静默失败)。

根因

enchante_agent_deeplink() 生成的 config base64 JSON 只有 role / skillNames / mcpServers 三个顶层字段,展示名只放在外层 URL 的 ?name= 查询参数里。真机排查确认 Enchanté 解析 config 时要求 JSON 内部也要有顶层 name 字段,缺了这个字段会导致反序列化/校验静默失败,不会有任何报错提示。

MCP-only 的 deeplink(enchante://mcp/install)和 base64 的 URL 转义(+///= 的 percent-encoding)没有这个问题,不受影响。

修复

bundle 里加了顶层 "name",值与外层 ?name= 一致,避免重复硬编码字符串。

测试

按 mentor 要求只跑了精准测试,没有跑全局前端测试套件:

pytest tests/test_client_config.py -k "deeplink or agent" -v
# 31 passed in 0.51s

包含更新后的 test_agent_deeplink(新增断言 bundle["name"] == "MyKnowledge 知识管理专家")和 test_agent_deeplink_shorter_than_before(确认加了字段后链接长度仍在 4206 字符基线内,实测 2178)。

未在真机上重新验证 Enchanté 侧是否真的弹出安装框(需要那台装了 Enchanté 的 Mac),麻烦 review 时确认一下。

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.
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.

1 participant