[Priority: Med] [Enhancement] 明确 push config persistence 与能力恢复的分层方案

未關閉
#451 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
42/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python

研究方向

閱讀 src/opencode_a2a/server/application.py、src/opencode_a2a/jsonrpc/application.py、src/opencode_a2a/server/agent_card.py 和 docs/guide.md 中目前不支援的推播通知路徑。執行現有的 server 和 agent-card 測試,然後使用 tests/server/test_app_behaviors.py、tests/server/test_agent_card.py 以及 JSON-RPC dispatcher 測試來定義不支援、部分接線和完全啟用的行為;完成還包括 bash ./scripts/doctor.sh 通過。

由索引模型根據 Issue 內容生成。

描述

status:todo

🔍 发现的问题 / 原始需求描述

  • 审查结论:需求仍然有效,但必须继续坚持“先分层、后恢复能力”。当前主干在 src/opencode_a2a/server/application.py、src/opencode_a2a/jsonrpc/application.py、src/opencode_a2a/server/agent_card.py、docs/guide.md 中都明确声明 push notification config surface 仍 exposed-but-unsupported。
  • 因此,这个 issue 的合理边界不是直接恢复 capability,而是先定义清楚:哪些属于内部持久化底座,哪些才属于对外协议恢复。

🛠️ 详细实施方案

  • 分两阶段推进,避免一次性把 persistence、sender、公开 contract 混在一起。
  • 第一阶段:新增独立 wiring 层,例如 src/opencode_a2a/server/push_notifications.py,只负责按配置创建 PushNotificationConfigStore / PushNotificationSender,并把“未完整配置时保持 501 / unsupported”固化为显式分支。
  • 第二阶段:只有当 store + sender + capability 文档都齐备时,才允许 REST / JSON-RPC / Agent Card 一起切换为 supported,避免出现“可创建配置但永远不会发送”的半启用状态。
  • 核心逻辑/伪代码:
if push_feature_disabled:
    keep current unsupported routes and unsupported JSON-RPC delegation
elif push_config_store is configured and push_sender is None:
    allow internal persistence experiments only; do not advertise capability publicly
else:
    wire store + sender + agent card capability + REST/JSON-RPC handlers together
  • 涉及文件:src/opencode_a2a/server/application.py、src/opencode_a2a/jsonrpc/application.py、src/opencode_a2a/server/agent_card.py、docs/guide.md、必要时新增 src/opencode_a2a/server/push_notifications.py。

🧪 回归测试建议

  • 扩充 tests/server/test_app_behaviors.py 与 tests/server/test_agent_card.py,分别覆盖 unsupported、partially wired、fully enabled 三种模式。
  • 为 JSON-RPC dispatcher 增加 push config method 分支测试,确保 capability 与真实行为一致。
  • 执行 bash ./scripts/doctor.sh。
主要語言
Python
星號
38
分支
13
平均合併
3 小時 43 分鐘
30 天內合併 PR
4

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

Intelligent-Internet/opencode-a2a 的其他 Issue

查看 Intelligent-Internet/opencode-a2a 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。