-
Notifications
You must be signed in to change notification settings - Fork 381
Description
Problem
When appending data to an artifact with append=True, the artifact's metadata fields (size, updated_at, checksum) are not recalculated or returned to the client. This creates an inconsistency: the server-side artifact has been modified, but the client's in-memory representation still reflects the pre-append state.
Impact
This breaks several workflows:
- State divergence: Client code can't trust
artifact.sizeorartifact.updated_atafter an append - Resumable uploads: Code that chains multiple appends and checks size/checksum between operations will have stale data
- Consistency with other operations: Other mutations (delete, download) properly refresh metadata — append is inconsistent
Current Behavior
In src/a2a/client/task.py, the append_artifact() method likely:
- Sends the append request to the server
- Returns success/failure
- Does NOT re-fetch artifact metadata
Expected Behavior
After a successful append, the returned artifact object (or the client's cached copy) should have updated:
size: new total sizeupdated_at: current timestampchecksum: recalculated hash (if applicable)
Alternatively, the method should explicitly document that metadata is stale and recommend a refresh step.
Proposed Solution
One of:
- Refresh automatically: After append succeeds, fetch and merge the updated metadata back into the artifact object
- Return updated metadata: Have the append API response include updated metadata fields
- Add explicit refresh method: Provide
artifact.refresh_metadata()so callers can explicitly re-sync
See #735 for original report — this is the core architectural question that needs resolution before fixing the bug.
Contributed by Klement Gunndu