Repository navigation
Reconciling what a delegated A2A task cost: runnable example, localhost, no keys #2290
fadnisnikhil
started this conversation in
Show and tell
Replies: 1 comment
|
On Q1: in what we’ve seen, the task ID is the only reference stable enough to bill against, because a contextId can span several tasks, so a provider billing per context can’t be matched one-to-one. A small extension where the agent declares “I bill against taskId” would make unmatched_charge detectable from the card alone, before any money moves. It would also be testable from outside: call the skill, then check the bill references the right task. Kasper |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When an orchestrator delegates over A2A, the task stream says whether the work finished. It says nothing about what the work cost, whether the provider's bill matches the delegation, or what is still unpaid. I built a small example that answers those for one job.
An orchestrator runs one job through two A2A v1.0 agents over HTTP on localhost, using
@a2a-js/sdk:TASK_STATE_WORKINGbecomes "started", its test, lint and patch artifacts become signed evidence, andTASK_STATE_COMPLETEDbecomes "completion proposed". A policy evaluates the evidence and clears USD 90 to the agent plus a USD 10 fee (simulated).unmatched_chargeinstead of being added to the total.The job ends in a signed closure that anyone can verify offline:
Change any amount in
task-closure.jsonand the verifier reports INVALID.Example: https://github.com/fadnisnikhil/atcn/tree/main/examples/a2a-delegation
Limits: settlement is simulated (no money moves), all agents share one in-memory network in one process, and the policy checks the evidence the agent submits rather than running the code.
Two questions for people delegating paid work over A2A:
If you have a project that delegates paid work, I'm happy to help wire one of your jobs into a reconciled record. Reply here or open an issue on the repo.
All reactions