Skip to content

feat(protocol): a canonical attribution-probe/v1 extension - #17

Merged
earakely-scale merged 5 commits into
mainfrom
edgararakelyan/attribution-probe-extension
Oct 1, 2026
Merged

earakely-scale merged 5 commits into
mainfrom
edgararakelyan/attribution-probe-extension

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The A2A validator checks runtime attribution by asking an agent which project and task identifiers it last sent upstream, through urn:agentenv:attribution-probe/v1 at POST /ext/attribution-probe. Hand-written agents advertise that extension. An AgentEnvAgent cannot: reserved urn:agentenv: URIs must use their canonical SDK definition, and this one had none, so for SDK-built agents the check could only record "skipped".

This adds the canonical definition:

  • ATTRIBUTION_PROBE_V1 has one runtime-owned operation, probe: a bodyless POST /ext/attribution-probe.
  • Response. It answers with AttributionProbeResponse, {last_seen_attribution: {<dimension>: <value>}, last_seen_at_utc?}.
  • Open map. last_seen_attribution is an open dict[str, str], like AgentEnv's cost attribution (agent_env.attribution.Attribution). The protocol assigns no keys; each deployment forwards whatever dimensions its model gateway understands. The validator keeps reading the project_id and task_id the control plane configures, so its check is unchanged.
  • Registration. The extension is added to STANDARD_EXTENSIONS and exported from agentenv_protocol.a2a_agent.
  • Opt-in. An agent declares it only by implementing the handler. The SDK records nothing itself, since only the agent knows what it sent.
  • Docs. The README documents it next to MCP_CONFIG_V1, including that the answer is agent-wide and the route carries no access check of its own.

It is additive. No existing operation, route or card entry changes, and the plugin-API check reports no break.

Tests

  • New tests in packages/agentenv-protocol/tests/test_a2a_agent.py:
    • the card advertises the endpoint;
    • probe returns the dimensions the agent last sent in a real task, including arbitrary ones, and {} before any are sent;
    • a request body is rejected with 400;
    • an undeclared response field is a 500 that does not echo the field;
    • an agent without the handler does not advertise the URI.
  • Suites: packages/agentenv-protocol/tests has 288 passing; the related tst/unit A2A and validator tests have 227 passing.

🤖 Generated with Claude Code

RetriggerConfidence Score: 3/5

The PR is not ready to merge because the Explorer can reject an embedded task or run the wrong task after browser navigation.

What we checked:

  • Live spec version goes blank: No. The backend keeps the response key that the UI reads and looks up the renamed distribution.

Summary

Adds a canonical attribution probe that SDK-built agents can expose through the A2A protocol. The agent supplies the attribution it last sent; the SDK defines the response but does not record attribution itself.

  • Adds the probe operation and response type to the shared extension catalog.
  • Documents the open attribution map and agent-wide response, and adds coverage for handler behavior.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  H[Host or task URL] --> P[Explorer task runner]
  P --> A[Task API]
  A --> R[Run]
  R --> V[Run viewer]
Loading

Reviews (5) · Last reviewed commit: "Merge main into the attribution-probe ex..."

The A2A validator asks an agent which project and task attribution it last sent
upstream, through urn:agentenv:attribution-probe/v1 at POST /ext/attribution-probe.
Hand-written agents advertise it, but an AgentEnvAgent cannot: reserved
urn:agentenv: URIs must use a canonical SDK definition, and there was none, so the
runtime attribution check could only record "skipped".

ATTRIBUTION_PROBE_V1 has one runtime-owned, bodyless operation, probe, answered with
AttributionProbeResponse: {last_seen_attribution: {project_id?, task_id?},
last_seen_at_utc?}, the shape the validator already reads. The SDK records nothing
itself; only the agent knows what it sent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread packages/agentenv-protocol/README.md Outdated
Comment thread packages/agentenv-protocol/tests/test_a2a_agent.py Outdated
earakely-scale and others added 3 commits September 30, 2026 08:29
The probe test now sends a message through the A2A endpoint before reading the
updated answer, so it fails if running a task stops updating what the probe
reports. The README notes that the answer is agent-wide rather than per caller,
and that the route carries no access check of its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The probe's answer was a closed {project_id, task_id} model, which put one
deployment's attribution vocabulary into the protocol. AgentEnv's cost attribution
is already an open dict of string dimensions that the framework threads without
reading, leaving each backend to pick the keys it understands. The probe now does
the same: last_seen_attribution is a dict[str, str] of whatever dimensions the
agent last sent with a model request, and LastSeenAttribution is gone. The
validator keeps reading project_id and task_id out of it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…be answer

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner September 30, 2026 21:53
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 282d2be into main Oct 1, 2026
13 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/attribution-probe-extension branch October 1, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant