Skip to content

fix(a2a): A2A protocol compatibility fixes#361

Closed
tuzkier wants to merge 1 commit intoRightNow-AI:mainfrom
tuzkier:fix/a2a-protocol-compat
Closed

fix(a2a): A2A protocol compatibility fixes#361
tuzkier wants to merge 1 commit intoRightNow-AI:mainfrom
tuzkier:fix/a2a-protocol-compat

Conversation

@tuzkier
Copy link

@tuzkier tuzkier commented Mar 6, 2026

Summary

Fixes A2A (Agent-to-Agent) protocol compatibility issues when connecting to external A2A gateways.

Changes

openfang-runtime (a2a.rs)

  • A2aArtifact: name and description changed to Option<String> to handle gateways returning null
  • A2aTask.status: Added A2aTaskStatusWrapper to support both object form {"state":"completed"} and string enum form per A2A spec

openfang-kernel (kernel.rs)

  • get_a2a_agent_url / list_a2a_agents: Return card.url (actual RPC endpoint) instead of discover key (base URL)
  • Fixes 404 errors when invoking A2A agents

openfang-api (routes.rs)

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable): discover A2A agent, invoke task, verify status polling and result display

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

- a2a.rs: A2aArtifact name/description 改为 Option<String>,兼容网关返回 null
- a2a.rs: A2aTask.status 新增 A2aTaskStatusWrapper,同时支持对象形式
  {"state":"completed"} 和字符串枚举两种格式(符合 A2A 标准)
- kernel.rs: get_a2a_agent_url/list_a2a_agents 返回 card.url(实际 RPC 端点)
  而非 discover key(base URL),修复调用时 404 问题
- routes.rs: A2A agents 列表 API 同步返回 card.url
- routes.rs: 修复 tool-use/result 跨消息匹配,用 tool_use_id 正确关联
@jaberjaber23
Copy link
Member

Implemented in v0.3.25. A2A status wrapper, artifact field relaxation, agent URL fix, and ToolUse/ToolResult cross-message correlation all applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants