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

オープン
#451 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Intelligent-Internet/opencode-a2a のほかの issue

Intelligent-Internet/opencode-a2a の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。