a2aproject / a2aproject/A2A

[Question] Can artifacts be replaced/updated after last_chunk = true?

Aperta
#1,231 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
TSC Review
Lingua principale
Shell
Stelle
25.7k
Fork
2.6k
Merge medio
3g 6h
PR unite (30g)
16

Descrizione

## Question

If I return `last_chunk = true` in a `TaskArtifactUpdateEvent`, can I still replace or update the artifact afterwards?

## Context

The `TaskArtifactUpdateEvent` message has two fields related to artifact streaming:

```protobuf
message TaskArtifactUpdateEvent {
// ...
Artifact artifact = 3 [(google.api.field_behavior) = REQUIRED];
// If true, the content of this artifact should be appended to a previously
// sent artifact with the same ID.
bool append = 4;
// If true, this is the final chunk of the artifact.
bool last_chunk = 5;
// ...
}
```

## Scenario

Consider this sequence:

1. Agent sends `TaskArtifactUpdateEvent` with `artifact_id = "output1"`, `append = false`, `last_chunk = false`
2. Agent sends `TaskArtifactUpdateEvent` with `artifact_id = "output1"`, `append = true`, `last_chunk = false`
3. Agent sends `TaskArtifactUpdateEvent` with `artifact_id = "output1"`, `append = true`, `last_chunk = true` ✓ **Final chunk**
4. **Question:** Can agent send another `TaskArtifactUpdateEvent` with `artifact_id = "output1"` after this?

## Use Cases to Consider

### Use Case 1: Correction/Refinement
Agent realizes after marking `last_chunk = true` that the artifact needs correction:
- Should this be allowed by sending a new artifact with same ID and `append = false`?
- Or is the artifact considered "sealed" once `last_chunk = true` is sent?

### Use Case 2: Incremental Processing
Agent produces a large artifact in chunks, marks it complete with `last_chunk = true`, but later discovers additional content to add:
- Can the agent "reopen" the artifact?
- Or should this be a new artifact with a different ID?

### Use Case 3: Multi-stage Artifacts
Agent produces a draft artifact (with `last_chunk = true`), then a refined version:
- Should both versions have the same artifact ID (replacement)?
- Or should they be separate artifacts with different IDs?

## What Needs Clarification

1. **Semantics of `last_chunk`:** Does `last_chunk = true` mean:
- "I'm done appending to this artifact for now" (soft boundary)
- "This artifact is finalized and immutable" (hard boundary)

2. **Replacement vs. Append:** If replacement is allowed after `last_chunk = true`:
- Should clients discard previous chunks?
- Should there be a way to signal "this supersedes the previous artifact"?

3. **Client Expectations:** What should clients do when:
- They receive `last_chunk = true` and consider the artifact complete
- They then receive another update for the same artifact ID

## Current Specification Gaps

The specification doesn't explicitly address:
- Whether updates are allowed after `last_chunk = true`
- The lifecycle and mutability semantics of artifacts
- How clients should handle "unexpected" artifact updates

## Recommendation

The specification should clearly define:
1. Whether artifacts can be updated after `last_chunk = true`
2. If updates are allowed, whether they replace or modify existing content
3. Best practices for artifact versioning if updates are not allowed
4. How clients should handle out-of-sequence or unexpected artifact updates

This clarity would help both agent implementers and client implementers understand artifact lifecycle management.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.