feat(external-context): Add provider extension profile - #9068
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
E2E and final verification reportValidated commit: Platform: macOS 26.4.1 (25E253), arm64, Node.js v24.12.0, npm 10.9.8.
E2E 与最终验证报告验证提交: 平台:macOS 26.4.1 (25E253),arm64,Node.js v24.12.0,npm 10.9.8。
|
|
Gate re-run at the current head — conclusions unchanged, the gate passes. Template looks good ✓ Problem: Unchanged from prior passes — this is the next planned increment of the Direct External Context roadmap (#7585), with five prior increments already merged. The gap it addresses (without a portable profile, every provider needs a Qwen-maintained adapter or invents an incompatible MCP shape) is documented and real, not theoretical. Direction: Aligned, for the same reasons as before — provider integrations stay on the existing Extension + MCP surface, and the diff still carries zero Size: Not applicable — no core paths touched (docs, Approach: Scope still right. The five fix commits since the first pass are all hardening within the stated scope — contract bounds, packaging, and proxy semantics. The last commit swaps the example's HTTP proxying from default CONNECT tunneling to forward-proxy semantics, which is exactly the regression round 5 flagged; no drive-by changes spotted. Risk: No elevated risk signals — none of the changed files match the revert-correlated paths. Moving on to code review. 🔍 中文说明在当前 head 上重新准入门禁——结论不变,门禁通过。 模板完整 ✓ 问题:与之前各轮一致——这是 Direct External Context 路线图(#7585)的下一个既定增量,此前五个增量已合并。它解决的缺口(没有可移植 profile,每个 provider 都要 Qwen 维护适配器或自造不兼容的 MCP 形态)有记录且真实,不是理论性问题。 方向:对齐,理由不变——provider 集成保持在现有 Extension + MCP 边界上,diff 依然零 规模:不适用——未触及核心路径(仅 docs、 方案:范围依然合理。首轮之后的五个 fix commit 全部是既定范围内的加固——契约边界、打包、代理语义。最后一个 commit 把示例的 HTTP 代理从默认 CONNECT 隧道改为正向代理语义,正是第 5 轮指出的回归;未发现夹带改动。 风险:无升级风险信号——改动文件均未命中与 revert 相关的高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewRe-run at the new head, five fix commits after the pass that requested changes. Both prior blockers are resolved, and I verified each statically at this exact commit rather than taking the round summaries on faith:
Everything the earlier passes credited still holds at this head:
Non-blocking observations, for the record:
Test evidence (this PR's own CI, via API)Unattended run — per the static-review rule I did not build or execute PR code; the evidence below is the PR's own CI on the reviewed commit, read through the API. Nothing here is TUI-visible, so no live product run applies. All 226 check runs on this commit settled: 22 success, 199 skipped, 0 failure (the 5 cancelled entries are all That suite includes the new real-socket proxy test and the pack-content test, plus the repo's core suite (53 files / 1150 passed, 9 skipped) in the same job. The macOS/Windows Test jobs and the CLI integration job are skipped by workflow design (merge queue only), not a gap caused by this PR.
Sandboxed verification is in flight on this exact head as part of the current triage run (run 31938434218); its report will post here when it completes. What it will settle that CI does not: the bundled example driven end-to-end against a loopback provider on this head, and the A/B wire-level proof of the rejection-before-provider behavior — the earlier ✅ verify report was run against the first commit 中文说明代码审查:在请求修改之后的五个 fix commit 基础上,于新 head 重新审查。此前两个阻塞项均已解决,且我是在本 commit 上静态核实、而非轻信轮次汇总:
此前各轮认可的结论在当前 head 依然成立:
非阻塞观察项,留档:
测试证据(本 PR 自己的 CI,通过 API 读取):无人值守运行——按静态审查规则未构建或执行 PR 代码;以上证据是被审 commit 上本 PR 自己的 CI。本 PR 无 TUI 可见变化,无需真机操作。 被审 commit 上 226 个 check run 全部落定:22 成功、199 跳过、0 失败(5 个 cancelled 均为 沙箱验证正在当前 head 上随本次 triage 运行进行(run 31938434218),完成后报告会发布在本线程。它将补足 CI 未覆盖的部分:在当前 head 上对 bundled 示例做回环 provider 端到端驱动,以及"触达 provider 前拒绝"的 A/B 线级证明——此前的 ✅ verify 报告运行在第一个 commit — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 4/5 — six rounds in, both blockers are fixed and test-pinned, CI is green on the head, and what remains is nits; the last point is withheld only because the sandboxed re-verification of this exact head is still in flight. Honest reflection:
Approving, pinned to the reviewed commit. @wenshao's first-round review is the remaining human thread — main needs two approvals, so a maintainer re-review stands regardless of this vote. 中文说明信心:4/5 —— 六轮之后,两个阻塞项均已修复并被测试钉住,当前 head 的 CI 为绿,剩余只有小问题;扣掉的一分仅因为针对当前 head 的沙箱复验仍在运行中。 如实反思:
批准,钉在被审 commit 上。@wenshao 的首轮审查是剩余的人类审查线——main 需要两个批准,无论如何都还需 maintainer 复审。 — Qwen Code · qwen3.8-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed. Suggestions are inline.
Not explored to full depth (tool budget reached): "PR 9068 adds an External Context Provider Extension…": did not trace whether the native extension-manifest parser strips/ignores a trust field on mcpServers entries (the doc's "ordinary Extension manifests canno…; "PR 9068 adds an External Context Provider Extension…": the design doc's "Qwen's conservative MCP connection replay requires server trust, workspace trust, and explicit safe annotations" — I verified the trust mechan…; "PR 9068 adds an External Context Provider Extension…": the design doc's "conservative MCP connection replay requires server trust, workspace trust, and explicit safe annotations" — verified the trust machinery exist…; "PR 9068 adds an External Context Provider Extension…": none — all checks I started were completed within budget.; "PR 9068 adds an External Context Provider Extension…": none — all planned checks completed within budget..
Not reviewed: reverse audit — did not converge within the reverse-audit round cap of 5.
中文说明
仅完成部分审查,审查缺口已披露。 建议见行内评论。
未探索到全部深度(达到工具调用预算):"PR 9068 adds an External Context Provider Extension…":did not trace whether the native extension-manifest parser strips/ignores a trust field on mcpServers entries (the doc's "ordinary Extension manifests canno…;"PR 9068 adds an External Context Provider Extension…":the design doc's "Qwen's conservative MCP connection replay requires server trust, workspace trust, and explicit safe annotations" — I verified the trust mechan…;"PR 9068 adds an External Context Provider Extension…":the design doc's "conservative MCP connection replay requires server trust, workspace trust, and explicit safe annotations" — verified the trust machinery exist…;"PR 9068 adds an External Context Provider Extension…":none — all checks I started were completed within budget.;"PR 9068 adds an External Context Provider Extension…":none — all planned checks completed within budget.。
未审查:反向审计——在 5 轮的反审轮数上限内未收敛。
— qwen3.8-max via Qwen Code /review (v0.21.11)
wenshao
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its platform-specific suite did not run locally.
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its platform-specific suite did not run locally。
— Qwen via Qwen Code /review (v0.21.11)
|
@qwen-code /triage |
|
Sandboxed verification: ✅ passed — merge-ready (agent verdict) - workflow run Ran the PR in an isolated, token-free container: A/B against the base build, mock-free harness assertions, targeted gates. Advisory evidence for human reviewers — not a review, an approval, or a CI check. Scripted assertions: 175 passed · 0 failed · 175 total 中文 — 判定:✅ 通过 · 可合入(agent 判定)沙箱验证在隔离、无凭证的容器中执行了该 PR 的代码(与 base 构建 A/B 对照、无 mock harness 断言、定向门禁)。仅作为评审证据,不构成评审、批准或 CI 检查。 脚本断言:175 通过 · 0 失败 · 175 总计 Verification reportPR 9068 — feat(external-context): Add provider extension profileVerdict: 中文摘要
ScopeCentral claim: the reference Secondary claims: (1) the local example adapter behaves per the contract against a loopback REST provider and ships as a self-contained bundle; (2) the published test vectors validate against both the language-neutral JSON Schemas and the runtime schemas. Central claim — A/B wire oracleHarness
Head 27/27, base 22/22 (base assertions encode the predicted lax behavior; all held). The base wire Secondary claimsLocal example E2E ( Contract vectors ( Scaling ladder ( FindingsNo blocking findings. Informational:
Vacuity / mutation matrixScratch copy of the package; control unmutated 185/185 green (matches author's claim: 11 files, 185 tests). Witness
Notable: M1 left the wire-schema/ajv vector test green (zod-to-json-schema emits Targeted gates (head)
Not covered
MethodologyEnvironment: CI merge-ref checkout (depth 2), pre-built at head; all harnesses drove compiled Evidence imagesHarness scripts and raw logs are in the workflow run artifacts (7-day retention). — Qwen Code · sandboxed verification |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Needs one fix before merge: the parent package's files allowlist packs the local example's manifest but not the dist/main.js that manifest launches — a packed archive ships an example extension that cannot start. Details and the suggested fix (plus a package-content test to keep it pinned) are in my Stage 2 comment. This supersedes my earlier approval of this commit. 🙏
合并前需要一处修复:父包的 files 白名单打包了本地示例的 manifest,却没有打包该 manifest 启动所需的 dist/main.js——打包归档会携带一个无法启动的示例扩展。详情与建议修复(并加一个包内容测试保持钉住)见我的 Stage 2 评论。本评审取代我此前在同一 commit 上的批准。
— Qwen Code · qwen3.8-max
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Review fixes pushedCommit:
Validation: External Context 12 files / 191 tests passed; External Context build, typecheck, and lint passed; repository build, typecheck, and lint passed; independent test-engineer reproduction and post-fix verification passed; two consecutive open-ended audits were clean. 中文说明评审修复已推送提交:
验证:External Context 12 个文件 / 191 项测试通过;External Context build、typecheck、lint 通过;仓库 build、typecheck、lint 通过;独立 test-engineer 复现和修复后验证通过;两轮连续开放式审计清洁。 |
|
@qwen-code /triage |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: reverse audit — stopped at the 5-round cap without converging (round 5 still reported a finding; every reported finding was probe-verified).
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its platform-specific suite did not run locally.
Not explored to full depth (tool budget reached): "agent 1b": could not run src/provider-extension-local.test.ts (pack regression test) or src/manifest.test.ts — a concurrent pipeline job on this shared runner was mid-….
中文说明
仅完成部分审查,审查缺口已披露。
未审查:reverse audit — stopped at the 5-round cap without converging (round 5 still reported a finding; every reported finding was probe-verified)。
未审查:build-and-test — Test (windows-latest, Node 22.x) was skipped in CI and its platform-specific suite did not run locally。
未探索到全部深度(达到工具调用预算):"agent 1b":could not run src/provider-extension-local.test.ts (pack regression test) or src/manifest.test.ts — a concurrent pipeline job on this shared runner was mid-…。
— qwen3.8-max via Qwen Code /review (v0.21.12)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Review round 2 follow-upPushed
Validation: External Context 196/196 tests; focused 43/43 tests; bare Vitest 9 passed/1 npm-dependent pack test skipped; External Context build/typecheck/lint; repository build/typecheck/lint; independent no-flags regex probes; two clean diff audits. 中文说明第二轮评审跟进已推送
验证:External Context 196/196 测试;定向测试 43/43;裸 Vitest 9 通过、仅跳过 1 个依赖 npm 的打包测试;External Context build/typecheck/lint;仓库级 build/typecheck/lint;独立无 flags 正则探测;两轮干净 diff 审计。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed. Suggestions are inline.
Not reviewed: reverse audit — stopped at the 5-round cap without converging (round 5 still reported a finding; every reported finding was probe-verified).
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) and Test (macos-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally.
中文说明
仅完成部分审查,审查缺口已披露。 建议见行内评论。
未审查:reverse audit — stopped at the 5-round cap without converging (round 5 still reported a finding; every reported finding was probe-verified)。
未审查:build-and-test — Test (windows-latest, Node 22.x) and Test (macos-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally。
— qwen3.8-max via Qwen Code /review (v0.21.12)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Review round 3 follow-upPushed
Validation: External Context 199/199 tests; focused 46/46 tests; package build/typecheck/lint; repository build/typecheck/lint; published-vector schema sweep; two consecutive clean diff audits; independent read-only test-engineer verification. 中文说明第三轮评审跟进已推送
验证:External Context 199/199 测试;定向 46/46 测试;包级 build/typecheck/lint;仓库级 build/typecheck/lint;公开向量 schema 扫描;连续两轮干净 diff 审计;独立只读测试工程师验证。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed. Suggestions are inline.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) and Test (macos-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally.
Not explored to full depth (tool budget reached): "agent reverse-audit (round 4)": tracing the exact merge point where extension-contributed MCP servers reach the effective server map, to rule out a process.env-based ${VAR} resolution pass o…; "agent reverse-audit (round 4)": tracing the extension-MCP-server merge point end-to-end to rule out (or confirm) a process.env-based ${VAR} resolution pass over manifest env values.; "agent reverse-audit (round 4)": verifying the doc's "the provider receives the normalized query" claim against the example's tool handler ( examples/provider-extension-local/src/provider.ts ) ….
Not reviewed: reverse audit — did not converge within the reverse-audit round cap of 5.
中文说明
仅完成部分审查,审查缺口已披露。 建议见行内评论。
未审查:build-and-test — Test (windows-latest, Node 22.x) and Test (macos-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally。
未探索到全部深度(达到工具调用预算):"agent reverse-audit (round 4)":tracing the exact merge point where extension-contributed MCP servers reach the effective server map, to rule out a process.env-based ${VAR} resolution pass o…;"agent reverse-audit (round 4)":tracing the extension-MCP-server merge point end-to-end to rule out (or confirm) a process.env-based ${VAR} resolution pass over manifest env values.;"agent reverse-audit (round 4)":verifying the doc's "the provider receives the normalized query" claim against the example's tool handler ( examples/provider-extension-local/src/provider.ts ) …。
未审查:反向审计——在 5 轮的反审轮数上限内未收敛。
— qwen3.8-max via Qwen Code /review (v0.21.12)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Review round 4 fixes are available in
Rejected or deferred: none. Verification: Node 22 bundle/startup smoke, Prettier check, package typecheck, lint, build, and all 200 external-context tests passed. Independent isolated mutation and stdio probes confirmed all five findings and the selected remedies. 第 4 轮评审修复已包含在
拒绝或延期:无。 验证:Node 22 bundle/启动冒烟、Prettier、包级 typecheck、lint、build,以及 external-context 全部 200 项测试均通过。独立隔离变异测试和 stdio 探针确认了五条问题及所选修复方案。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Test (macos-latest, Node 22.x) and Test (windows-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally.
Not reviewed: reverse audit — did not converge within the reverse-audit round cap of 5.
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Test (macos-latest, Node 22.x) and Test (windows-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally。
未审查:反向审计——在 5 轮的反审轮数上限内未收敛。
— qwen3.8-max via Qwen Code /review (v0.21.12)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Round 5 review handling summary / 第 5 轮审查处理汇总 Commit: a41ed5f
Verification: Prettier check, package typecheck, lint, build, and all external-context tests passed (12 files, 201 tests). Independent probes observed absolute-form POST for HTTP proxying and CONNECT for HTTPS proxying. After roughly five review rounds, repository policy limits this round to Critical correctness, security, data-loss, and regression fixes; all deferred Suggestions are recorded above rather than silently dropped. 第 5 轮中,R5-1 被确认是生产正确性回归并已修复:HTTP Provider 通过代理时使用经典正向代理请求,同时 HTTPS Provider 仍使用 CONNECT;新增了真实本地代理回归测试。R5-2 至 R5-6 均已独立评估并按约第 5 轮的收敛规则延期:分别属于测试隔离、覆盖补充、文档修正、非强制性的 Schema 说明及非关键诊断改进。 验证已通过:Prettier、包级 typecheck、lint、build,以及 external-context 全部测试(12 个文件、201 个测试)。独立探测也确认 HTTP 使用绝对形式 POST,HTTPS 使用 CONNECT。 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed. Suggestions are inline.
Not reviewed: build-and-test — Test (windows-latest, Node 22.x) and Test (macos-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally.
中文说明
仅完成部分审查,审查缺口已披露。 建议见行内评论。
未审查:build-and-test — Test (windows-latest, Node 22.x) and Test (macos-latest, Node 22.x) were skipped in CI (merge queue only) and their platform-specific suites did not run locally。
— qwen3.8-max via Qwen Code /review (v0.21.12)
|
@qwen-code /triage |
|
Sandboxed verification: ✅ passed — merge-ready (agent verdict) - workflow run Ran the PR in an isolated, token-free container: A/B against the base build, mock-free harness assertions, targeted gates. Advisory evidence for human reviewers — not a review, an approval, or a CI check. Scripted assertions: 445 passed · 0 failed · 445 total 中文 — 判定:✅ 通过 · 可合入(agent 判定)沙箱验证在隔离、无凭证的容器中执行了该 PR 的代码(与 base 构建 A/B 对照、无 mock harness 断言、定向门禁)。仅作为评审证据,不构成评审、批准或 CI 检查。 脚本断言:445 通过 · 0 失败 · 445 总计 Verification reportPR 9068 — feat(external-context): Add provider extension profileVerdict: 中文摘要
Previous-finding status (follow-up round)
Carried-forward measurements (A/B cells, example E2E, vectors, ladder, mutation matrix, gates, pack) were all re-run at the new head; the base arm was rebuilt at the new merge base ScopeCentral claim: the reference Secondary claims: (1) the local example adapter behaves per contract against a loopback REST provider and ships as a self-contained bundle; (2) published test vectors validate against both the language-neutral JSON Schemas and both runtime schema copies. Delta since the previous round (5 commits, individually unreachable in the depth-2 checkout — verified as aggregate Central claim — A/B wire oracleHarness
Head 30/30, base 28/28 (base assertions encode the predicted lax behavior; all held). Both arms advertise Delta probesHardening guards ( Forward proxy (
Fail-closed boot cells (4/4): non-loopback http base URL, base URL with path, missing token, and invalid Local example E2E: 43/43 in-place and 43/43 with the bundle copied to a directory with no Contract vectors and scaling
Vacuity / mutation matrixScratch copies of the package; control unmutated 201/201 green (12 files) — the suite grew +16 tests since the previous round (185 at
7/7 mutants killed by their intended tests; every failure message is a behavioral expected/actual assertion (spot-checked M4 and M7). The latest commit's change is pinned by name (M7). No survivors; the M1 observation from the previous round still holds (wire-schema/ajv vector test cannot see strict-vs-strip — only the live Targeted gates (head)
FindingsNo blocking findings. Informational:
Not covered
MethodologyEnvironment: CI merge-ref checkout (depth 2), pre-built at head ( Evidence imagesHarness scripts and raw logs are in the workflow run artifacts (7-day retention). — Qwen Code · sandboxed verification |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM — both prior blockers are resolved and test-pinned at this commit (pack-content test green in CI; proxy semantics verified against undici 7.29.0 source plus a real-socket regression test). Approving pinned to the reviewed commit. ✅
yiliang114
left a comment
There was a problem hiding this comment.
Approving after a full read of the diff at a41ed5f.
Verified:
- All 37 review threads are resolved, and the prior blockers are genuinely fixed at this head: R1-1 (parent
filesnow packsexamples/provider-extension-local/dist/main.js, build/typecheck/lint chain the example, and the pack-content test pins thenpm pack --dry-runlisting) and R5-1 (EnvHttpProxyAgent({ proxyTunnel: false })with a forward-proxy test proving no CONNECT tunnel). - Security of the external-input surface:
context_searchinput schema is strict (rejects model-selected scope before the provider is called, test-proven); output is bounded (5 items, per-field code-point limits, 4000-unit budget) withstructuredContentsemantically equal to the escaped text JSON; the local example enforces https-or-loopback origins with no subpath/userinfo,redirect: 'manual', a 1 MiB declared+streamed body cap, placeholder-token detection, redacted errors, 5s<8s timeout budget, and cancellation propagation — all covered by the stdio E2E. - CI on this exact head: ubuntu test suite, secret scan, dependency audit, and E2E smoke are green; macOS/Windows test skips are merge_group-only by ci.yml design, and the five cancelled
routechecks are duplicate-run scheduling noise — no PR-caused failures. - Scope matches the PR description: contracts + vectors, reference MCP alignment, two examples, docs, and dev-only
ajvaddition; no Qwen Core change.
Only non-blocking nits: the status >= 300 && < 400 clause in searchProvider is redundant after !response.ok, and the remote example's oauth.audiences is pinned only by manifest-shape tests.
|
Released in v0.21.13. |












What this PR does
This PR defines an External Context Provider Extension Profile v1 so provider teams can ship independently owned retrieval integrations through the existing Qwen Extension and MCP boundary instead of adding provider-specific adapters to Qwen Core.
It publishes strict, language-neutral
context_searchinput and output schemas with conformance vectors; aligns the existing reference MCP tool with that contract and returns equivalent text and structured results; and adds provider-owned remote OAuth and self-contained local REST adapter examples. The accompanying design and integration documentation defines ownership, authentication, timeout, output-sanitization, trust, packaging, and rollout boundaries.Why it's needed
The existing Generic HTTP adapter proves that Qwen can retrieve external context, but it is a private compatibility implementation rather than a sustainable integration surface for every provider. Without a portable profile, each new provider would either require a Qwen-maintained adapter or invent an incompatible MCP shape. This profile keeps the integration boundary small, uses Qwen's existing Extension lifecycle, prevents model-selected corpus or endpoint scope, and gives provider teams a concrete contract and copyable starting points.
Reviewer Test Plan
How to verify
Confirm that the reference MCP advertises only the exact
queryinput, rejects undeclared selector fields before calling the provider, declares the bounded output schema, and returns semantically identical JSON through its text andstructuredContentresults. Validate the published test vectors against both the language-neutral schemas and the reference/local runtime schemas. Build the local example and invoke it against a loopback fake REST provider; it should expose onlycontext_search, send one normalized fixed-limit request with the administrator-bound credential, escape literal angle brackets in text output, and preserve the original content in structured output. Finally, verify the local and parent package dry runs include the intended contracts, source examples, manifests, and self-contained local bundle without credentials.Local verification completed with 11 external-context test files and 185 tests passing, the external-context and repository build/typecheck/lint commands passing, a real bundled REST-to-stdio-MCP smoke test passing, and both package dry runs containing the expected files.
Evidence (Before & After)
N/A — this PR adds a non-UI interoperability profile, reference behavior, documentation, and examples.
Tested on
Environment (optional)
macOS 26.4.1 (25E253), arm64, Node.js v24.12.0, npm 10.9.8, sandbox disabled for the loopback smoke test.
Risk & Scope
context_searchtool now rejects undeclared arguments instead of silently ignoring them, and provider-owned local adapters inherit the security boundary of the Qwen process environment and same-UID code.context_search.Linked Issues
Refs #7585
中文说明
本 PR 的改动
本 PR 定义 External Context Provider Extension Profile v1,使 Provider 团队能够通过现有 Qwen Extension 与 MCP 边界独立发布检索集成,而不需要向 Qwen Core 增加 Provider 专用适配器。
它发布严格、与语言无关的
context_search输入输出 schema 和一致性测试向量;让现有参考 MCP 工具遵循该契约,并同时返回语义一致的文本结果与结构化结果;同时提供由 Provider 维护的远程 OAuth 示例和自包含本地 REST 适配器示例。配套设计与集成文档明确了所有权、认证、超时、输出净化、信任、打包和灰度边界。为什么需要
现有 Generic HTTP 适配器证明了 Qwen 可以检索外部上下文,但它是私有兼容性实现,并不是让所有 Provider 持续接入的长期接口。如果没有可移植 profile,每个新 Provider 要么需要 Qwen 维护新的适配器,要么会自行发明不兼容的 MCP 形态。该 profile 保持集成边界最小化,复用 Qwen 现有 Extension 生命周期,禁止模型选择语料库或 endpoint 范围,并为 Provider 团队提供明确契约和可复制起点。
Reviewer 测试计划
验证方式
确认参考 MCP 仅声明精确的
query输入,在调用 Provider 前拒绝未声明的 selector 字段,声明有界输出 schema,并通过文本和structuredContent返回语义完全相同的 JSON。使用已发布测试向量同时验证与语言无关的 schema、参考运行时 schema 和本地示例运行时 schema。构建本地示例并针对回环 Fake REST Provider 调用:它应仅暴露context_search,携带管理员绑定凭证发送一次规范化且固定结果上限的请求,在文本输出中转义字面量尖括号,并在结构化输出中保留原始内容。最后确认本地包与父包的 dry run 只包含预期契约、源码示例、manifest 和自包含本地 bundle,且不包含凭证。本地验证结果为:external-context 的 11 个测试文件和 185 个测试全部通过,external-context 与仓库级 build/typecheck/lint 全部通过,真实 bundled REST-to-stdio-MCP smoke test 通过,两个包的 dry run 均包含预期文件。
证据(改动前后)
N/A — 本 PR 添加的是非 UI 互操作 profile、参考行为、文档和示例。
测试平台
环境(可选)
macOS 26.4.1 (25E253),arm64,Node.js v24.12.0,npm 10.9.8;回环 smoke test 在禁用 sandbox 的环境中运行。
风险与范围
context_search工具现在会拒绝未声明参数,不再静默忽略;Provider 维护的本地适配器继承 Qwen 进程环境与同 UID 代码的安全边界。context_search。关联 Issue
Refs #7585