Files
agent-zero/plugins/_a2a_chat/AGENTS.md
Alessandro Frau 56b2910f46 Stop A2A ambient token forwarding
Do not automatically attach the process-wide A2A_TOKEN to model-selected destinations. Keep explicitly supplied connection credentials and document the existing token-bearing Agent Zero connection URL for protected peers.

Add regressions proving that arbitrary destinations receive no ambient Authorization or X-API-KEY headers, explicit tokens still work, and token-bearing URLs are preserved for discovery and RPC. Exercise discovery, message send and conversation reuse through the server auth/router for token URLs, explicit headers and public peers.

Validation: 8 client/tool tests passed. One expected failure records pre-existing project URL handling of chunked request bodies; the server implementation is unchanged.
2026-11-16 19:11:08 +01:00

1.9 KiB
Raw Permalink Blame History

A2A Chat Plugin DOX

Purpose

  • Own the a2a_chat tool for agent-to-agent communication over FastA2A.

Ownership

  • tools/a2a_chat.py owns session caching, message extraction, and remote dispatch.
  • The tool logs its message as type a2a_chat with an icon://hub Chatting: <agent_url> headline; extensions/webui/get_message_handler/ owns the A2A badge presentation and extensions/webui/get_process_step_types/ registers the type.
  • helpers/fasta2a_client.py owns the FastA2A client connection, message dispatch, and task polling.
  • prompts/ owns the tool prompt and the framework messages for failures.
  • plugin.yaml and README.md own metadata and docs.
  • webui/thumbnail.jpg owns the 256×256 plugin catalog artwork, kept below 20 KB.

Local Contracts

  • Session state is stored on agent.data["_a2a_sessions"], keyed by a normalized agent URL that strips an explicit /a2a suffix.
  • The reset argument coerces through the shared coerce_bool helper instead of returning a repairable error; absent and unrecognized values default to false, while numbers retain their truthiness.
  • Remote text extraction prefers the newest assistant history message, then status message, then artifacts; an empty extraction returns a distinct failed-response error instead of success.
  • The tool reports a2a unavailability without raising.

Work Guidance

  • Keep tool output concise, model-readable, and safe for history persistence.
  • Coordinate argument or behavior changes with the tool prompt and the fasta2a client contract.
  • Respect intervention flow before remote dispatch and polling.

Verification

  • Import the tool in the framework runtime and run the a2a tool contract tests after changes.
  • tests/test_a2a_chat_tool.py exercises discovery, message send, and conversation reuse through the real server auth/router with token URLs, project URLs, explicit header credentials, and public peers.

Child DOX Index

No child DOX files.