Intelligent-Internet / Intelligent-Internet/opencode-a2a

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

Open
#451 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:todo
Dominant language
Python
Stars
26
Forks
7
Avg merge
18h 30m
Merged PRs (30d)
18

Description

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

  • 审查结论:需求仍然有效,但必须继续坚持“先分层、后恢复能力”。当前主干在 src/opencode_a2a/server/application.pysrc/opencode_a2a/jsonrpc/application.pysrc/opencode_a2a/server/agent_card.pydocs/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.pysrc/opencode_a2a/jsonrpc/application.pysrc/opencode_a2a/server/agent_card.pydocs/guide.md、必要时新增 src/opencode_a2a/server/push_notifications.py

🧪 回归测试建议

  • 扩充 tests/server/test_app_behaviors.pytests/server/test_agent_card.py,分别覆盖 unsupported、partially wired、fully enabled 三种模式。
  • 为 JSON-RPC dispatcher 增加 push config method 分支测试,确保 capability 与真实行为一致。
  • 执行 bash ./scripts/doctor.sh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the current unsupported push-notification paths in src/opencode_a2a/server/application.py, src/opencode_a2a/jsonrpc/application.py, src/opencode_a2a/server/agent_card.py, and docs/guide.md. Run the existing server and agent-card tests, then use tests/server/test_app_behaviors.py, tests/server/test_agent_card.py, and JSON-RPC dispatcher tests to define unsupported, partially wired, and fully enabled behavior; completion also includes bash ./scripts/doctor.sh passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, documentation, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.