-
Notifications
You must be signed in to change notification settings - Fork 3
fix(a2a): let one JSON-RPC envelope define the wire at every edge #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4acbde6
fix(acp): deliver session updates through one path only
yordis 2e01f2b
fix(a2a): let one JSON-RPC envelope define the wire at every edge
yordis 2251af7
fix(a2a): let the SSE caller correlate on the id it sent
yordis 2d9e38d
chore(a2a): cover the branches this branch introduced
yordis 76cce9f
fix(a2a): give a streaming caller only frames it can correlate
yordis 923d2b3
fix(a2a): keep a JSON-RPC id's type in its correlation key
yordis 148df0d
fix(a2a): let a wire error keep its own identity at the client edge
yordis ffb455f
chore(acp): name the stream an upgrade leaves behind
yordis 3354986
fix(a2a): correlate on the id text the rest of the transport writes
yordis 0b49b16
fix(a2a): keep reading task events an older agent published
yordis 7db032d
chore(lints): place declarations where the repo policy lints expect them
yordis 9f3fdde
fix(a2a): keep every SSE data line something the caller can answer to
yordis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Retire the ACP Notifications Stream | ||
|
|
||
| `session/update` reaches the client through the client-op proxy for every | ||
| operation. The prompt-scoped notification path that used the | ||
| `<PREFIX>_NOTIFICATIONS` stream was a second delivery path for the same | ||
| updates, so it was removed, and the ACP provisioner no longer creates that | ||
| stream. | ||
|
|
||
| Removing a stream from the provisioner does not remove it from a deployment | ||
| that already ran an earlier release. That deployment still has the stream, its | ||
| stored messages, and its storage bill. This page is how you retire it. | ||
|
|
||
| ## When to use this | ||
|
|
||
| Use this procedure once per ACP deployment, after every process has been | ||
| upgraded to a release whose provisioner no longer lists the stream. Check the | ||
| deployed process versions to establish that, then use this to see whether the | ||
| retired stream is still there: | ||
|
|
||
| ```shell | ||
| nats stream ls | ||
| ``` | ||
|
|
||
| You are retiring a stream whose name matches `retired_stream_names` for your | ||
| prefix. For the default `acp` prefix that is `ACP_NOTIFICATIONS`; for a prefix | ||
| of `my.multi.part` it is `MY_MULTI_PART_NOTIFICATIONS`. | ||
|
|
||
| Do not use this procedure while any process is still running the previous | ||
| release. Those processes publish to `<prefix>.v1.session.*.agent.update`, and | ||
| deleting the stream underneath them drops those messages. | ||
|
|
||
| ## Preconditions | ||
|
|
||
| - Every ACP agent and client process runs a release that does not provision | ||
| the stream. A mixed fleet is the one case where this procedure loses data. | ||
| - The stream has no consumers with unacknowledged messages you still need. | ||
| `nats consumer ls <PREFIX>_NOTIFICATIONS` lists them; an empty list is the | ||
| state you want before deleting. | ||
| - You have a JetStream account credential with delete authority on the | ||
| stream. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Confirm the stream is idle. Its message count should stop growing: | ||
|
|
||
| ```shell | ||
| nats stream info <PREFIX>_NOTIFICATIONS | ||
| ``` | ||
|
|
||
| A message count that still climbs means something is publishing to | ||
| `<prefix>.v1.session.*.agent.update`. Find it and upgrade it before | ||
| continuing. | ||
|
|
||
| 2. Delete the remaining consumers. Deleting the stream removes them anyway, | ||
| but doing it first makes a still-attached reader fail visibly here rather | ||
| than silently later: | ||
|
|
||
| ```shell | ||
| nats consumer rm <PREFIX>_NOTIFICATIONS <CONSUMER> | ||
| ``` | ||
|
|
||
| 3. Delete the stream: | ||
|
|
||
| ```shell | ||
| nats stream rm <PREFIX>_NOTIFICATIONS | ||
| ``` | ||
|
|
||
| ## What this does not do | ||
|
|
||
| The provisioner does not perform any of the above. It creates and reconciles | ||
| the streams it declares and touches nothing else, so a stream delete is never | ||
| a side effect of a boot. That is deliberate: a stream delete is | ||
| unrecoverable, it races an operator who may still be draining the stream, and | ||
| a rollback to the previous release would re-create the stream empty and hide | ||
| the fact that its history is gone. | ||
|
|
||
| ## Rollback | ||
|
|
||
| There is none. A deleted stream and its messages do not come back. If you | ||
| roll back to a release that still provisions the stream, the provisioner | ||
| creates it again with no history. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| pub(crate) const AGENT_ID_HEADER: &str = "x-a2a-agent-id"; | ||
|
|
||
| /// JSON-RPC 2.0 reserved code for a server-side failure. | ||
| pub(crate) const INTERNAL_ERROR: i32 = -32603; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.