MCPcopy Index your code
hub / github.com/docker/docker-agent / Write

Method Write

pkg/a2a/executor_wrapper.go:41–50  ·  view source on GitHub ↗
(ctx context.Context, event a2a.Event)

Source from the content-addressed store, hash-verified

39}
40
41func (fq *fixingQueue) Write(ctx context.Context, event a2a.Event) error {
42 // Fix artifact update events with nil Parts
43 if artifactEvent, ok := event.(*a2a.TaskArtifactUpdateEvent); ok {
44 if artifactEvent.Artifact != nil && artifactEvent.Artifact.Parts == nil {
45 // Replace nil with an empty slice
46 artifactEvent.Artifact.Parts = []a2a.Part{}
47 }
48 }
49 return fq.queue.Write(ctx, event)
50}
51
52func (fq *fixingQueue) Read(ctx context.Context) (a2a.Event, a2a.TaskVersion, error) {
53 return fq.queue.Read(ctx)

Callers 4

TestFixingQueue_NilPartsFunction · 0.95
toJSONStringFunction · 0.45

Calls

no outgoing calls

Tested by 3

TestFixingQueue_NilPartsFunction · 0.76