a2aproject / a2aproject/a2a-rs
a2acli: --a2a-version flag and 1.x-bounded version negotiation
- Langage dominant
- Rust
- Étoiles
- 75
- Forks
- 19
- Merge moyen
- 11 h 27 min
- PR mergées (30 j)
- 21
Description
## Summary
`A2ACLI_VER_001` (Tier 1) requires the protocol version to be **signaled explicitly on every request** (never left empty, which A2A reads as 0.3), with negotiation **down only within 1.x, never below 1.0, and no silent downgrade** (§13.2).
Half of this already holds, but from the library rather than the CLI: `a2a-client/src/client.rs` seeds the default service params with
```rust
default_params.insert(SVC_PARAM_VERSION.to_string(), vec![VERSION.to_string()]);
```
so `A2A-Version: 1.0` goes out on every call. What is missing in `a2acli`:
- no `--a2a-version` flag — §7.2 defines it (*"Protocol version to signal to the server on every request"*), and the canonical Go CLI has `pf.StringVar(&cfg.a2aVersion, "a2a-version", ...)`;
- no negotiation on `VERSION_NOT_SUPPORTED` (`-32009`, already defined in `a2a/src/errors.rs`) — the call simply fails;
- `config show` cannot report the effective protocol version, and `--help`'s after-help claims *"Protocol version: negotiated automatically on every request"*, which currently overstates what happens.
## Why
Without the flag there is no way to talk to an agent pinned to a different 1.x minor, and the after-help text promises negotiation the tool does not perform. The "never below 1.0" floor is the part that matters for safety: an unbounded downgrade would land on 0.3 semantics, which is what leaving the header empty already does.
## Scope
- [ ] Add `--a2a-version ` (env `A2ACLI_A2A_VERSION`), defaulting to the `a2a` crate's `VERSION`, and pass it as the `A2A-Version` service param instead of relying on the library default.
- [ ] On `VERSION_NOT_SUPPORTED`, retry within 1.x only, never below `1.0`, and emit the attempted version to stderr on each step so the negotiation is not silent.
- [ ] Reject a non-1.x `--a2a-version` as a usage error (exit 2) rather than attempting it.
- [ ] Report the effective version, and the source it resolved from, in `config show`.
- [ ] Correct the `--help` after-help wording to describe what is actually done.
## Requirements closed
| ID | Requirement |
| --- | --- |
| `A2ACLI_VER_001` | `A2A-Version` signaled explicitly on every request; negotiates down only within 1.x, never below 1.0; no silent downgrade (§13.2) |
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.