Record Class TaskDelivery
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.subagent.task.TaskDelivery
- Record Components:
taskId- task identifieragentId- which subagent type produced this result (may benullon legacy records)status- terminal status — one of COMPLETED / FAILED / CANCELLEDresult- completion payload;nullfor FAILED / CANCELLEDerrorMessage- failure message;nullfor COMPLETED / CANCELLEDcompletedAt- wall-clock instant the task reached its terminal status (best-effort — typicallyTaskRecord.getLastUpdatedAt())
public record TaskDelivery(String taskId, String agentId, TaskStatus status, String result, String errorMessage, Instant completedAt)
extends Record
Snapshot of a terminal-state subagent task awaiting (or undergoing) push delivery to the parent
agent's reasoning loop. Returned by
TaskRepository.findPendingDeliveries(io.agentscope.core.agent.RuntimeContext, java.lang.String) so that
middleware can render it into a synthetic <system-reminder> message without re-querying
the underlying record.
Fields are denormalised from TaskRecord on purpose — the consumer
(SubagentsMiddleware) only needs the projection, and snapshotting up-front avoids racing
with a later status mutation.
-
Constructor Summary
ConstructorsConstructorDescriptionTaskDelivery(String taskId, String agentId, TaskStatus status, String result, String errorMessage, Instant completedAt) Creates an instance of aTaskDeliveryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.Returns the value of thecompletedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.final inthashCode()Returns a hash code value for this object.result()Returns the value of theresultrecord component.status()Returns the value of thestatusrecord component.taskId()Returns the value of thetaskIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TaskDelivery
public TaskDelivery(String taskId, String agentId, TaskStatus status, String result, String errorMessage, Instant completedAt) Creates an instance of aTaskDeliveryrecord class.- Parameters:
taskId- the value for thetaskIdrecord componentagentId- the value for theagentIdrecord componentstatus- the value for thestatusrecord componentresult- the value for theresultrecord componenterrorMessage- the value for theerrorMessagerecord componentcompletedAt- the value for thecompletedAtrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
taskId
Returns the value of thetaskIdrecord component.- Returns:
- the value of the
taskIdrecord component
-
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-