-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Question] Can artifacts be replaced/updated after last_chunk = true? #1231
Description
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:
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:
- Agent sends
TaskArtifactUpdateEventwithartifact_id = "output1",append = false,last_chunk = false - Agent sends
TaskArtifactUpdateEventwithartifact_id = "output1",append = true,last_chunk = false - Agent sends
TaskArtifactUpdateEventwithartifact_id = "output1",append = true,last_chunk = true✓ Final chunk - Question: Can agent send another
TaskArtifactUpdateEventwithartifact_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 = trueis 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
-
Semantics of
last_chunk: Doeslast_chunk = truemean:- "I'm done appending to this artifact for now" (soft boundary)
- "This artifact is finalized and immutable" (hard boundary)
-
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"?
-
Client Expectations: What should clients do when:
- They receive
last_chunk = trueand consider the artifact complete - They then receive another update for the same artifact ID
- They receive
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:
- Whether artifacts can be updated after
last_chunk = true - If updates are allowed, whether they replace or modify existing content
- Best practices for artifact versioning if updates are not allowed
- 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status