chore: align streaming contract metadata and remove dead helpers#261
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.
关联
Closes #259
Closes #260
Related: #155, #158, #159, #246
变更概览
本 PR 聚焦两件事:
Streaming Contract
src/opencode_a2a_server/extension_contracts.py中补齐 streaming extension params:interrupt_fields.phaseinterrupt_fields.resolutionsession_fields.idsession_fields.titleusage_fields.reasoning_tokensusage_fields.cache_tokens.read_tokensusage_fields.cache_tokens.write_tokensblock_contracts,明确text/reasoning/tool_call的 block -> part kind 对应关系。tool_call增补DataPartpayload 字段契约,覆盖call_id、tool、status、title、subtitle、input、output、error。测试与文档
tests/test_agent_card.py,直接断言 streaming extension params 的完整公开 shape,减少后续 drift 漏检。docs/guide.md,让文档与 machine-readable contract 对齐,补充 tool_call payload、usage 扩展字段、interrupt resolution 和 part kind 语义。死代码清理
src/opencode_a2a_server/app_support.py中重复且无调用方的_normalize_log_level()/_configure_logging()。src/opencode_a2a_server/extension_contracts.py中无调用方的build_supported_jsonrpc_methods()包装函数。验证
uv run pre-commit run --all-filesuv run pytest审查结论
Closes合适。Related更准确,不应写成Closes。