Clarify result and extension contract semantics#483
Merged
liujuanjuan1984 merged 3 commits intomainfrom May 8, 2026
Merged
Conversation
Collaborator
Author
|
代码变动独立审查结果:
风险评估:
PR 文案与 issue 关系审查:
验证:
|
Collaborator
Author
|
追加 #484 后的 PR 代码变动审查结果:
风险评估:
PR 文案与 issue 关系审查:
验证:
|
Collaborator
Author
自审结果代码变动审查本 PR 当前包含三个提交:
审查结论:改动方向合理,且与 #481 / #484 的需求匹配。
风险与遗漏
Issue 关系审查
验证
|
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.
背景
Closes #481
Closes #484
本 PR 覆盖两个相邻的协议语义收敛点:non-stream success 的结果/status 分层,以及
opencode-a2aextension URI 的 canonical identifier 收敛。本轮收尾同时完成了当前分支内的高置信死代码/薄壳清理。变更
message:send的完整 assistant result 固定在Task.artifacts。Task.status.message,但仅写入简短状态Completed.,不再复制完整正文。extract_text(Task)的读取优先级,优先读取 artifact result,避免短状态文本遮蔽真实结果。shared/private占位层,收敛为urn:opencode-a2a:extension:<contract>:v1。metadata.shared.*payload namespace 不变;provider-private metadata 继续使用metadata.opencode.*,URI path 不再承载 auth/disclosure 语义。x-a2a-extension-contracts中补充 public extension 的 canonicalextension_uri字段。identifiers._extension_uri与openapi._with_extension_uri,改用显式 URI 常量和 inline contract dict。:shared:/:private:URI 回流。Issue 关系
status.message与 artifact 重复承载问题。shared/private语义层移除问题。审查结论
验证
uv run pytest --no-cov tests/contracts/test_extension_contract_consistency.py tests/server/test_agent_card.py tests/server/test_transport_contract.py已通过:105 passed。./scripts/doctor.sh已通过:mypy、690 个 pytest、覆盖率门槛、package build、built-wheel smoke test。