Class TaskRecord

java.lang.Object
io.agentscope.harness.agent.subagent.task.TaskRecord

public class TaskRecord extends Object
Persistent metadata for a background subagent task, stored as JSON in the workspace under agents/<parentAgentId>/tasks/<parentSessionId>.json.

This is the authoritative truth source for task state. In-memory BackgroundTask handles are a local performance overlay; TaskRecord survives across JVM restarts and request migrations in distributed deployments.

All fields use Jackson for JSON serialization. Unknown fields are silently ignored to allow forward-compatible schema evolution.

  • Constructor Details

    • TaskRecord

      public TaskRecord()
    • TaskRecord

      public TaskRecord(String taskId, String subAgentId, String parentAgentId, String parentSessionId, String subSessionId)
  • Method Details

    • getTaskId

      public String getTaskId()
    • setTaskId

      public void setTaskId(String taskId)
    • getSubAgentId

      public String getSubAgentId()
    • setSubAgentId

      public void setSubAgentId(String subAgentId)
    • getParentAgentId

      public String getParentAgentId()
    • setParentAgentId

      public void setParentAgentId(String parentAgentId)
    • getParentSessionId

      public String getParentSessionId()
    • setParentSessionId

      public void setParentSessionId(String parentSessionId)
    • getSubSessionId

      public String getSubSessionId()
    • setSubSessionId

      public void setSubSessionId(String subSessionId)
    • getStatus

      public TaskStatus getStatus()
    • setStatus

      public void setStatus(TaskStatus status)
    • getResult

      public String getResult()
    • setResult

      public void setResult(String result)
    • getErrorMessage

      public String getErrorMessage()
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
    • isCancelRequested

      public boolean isCancelRequested()
    • setCancelRequested

      public void setCancelRequested(boolean cancelRequested)
    • getCreatedAt

      public Instant getCreatedAt()
    • setCreatedAt

      public void setCreatedAt(Instant createdAt)
    • getLastCheckedAt

      public Instant getLastCheckedAt()
    • setLastCheckedAt

      public void setLastCheckedAt(Instant lastCheckedAt)
    • getLastUpdatedAt

      public Instant getLastUpdatedAt()
    • setLastUpdatedAt

      public void setLastUpdatedAt(Instant lastUpdatedAt)
    • touch

      public void touch()
      Convenience: update lastUpdatedAt to now.
    • touchChecked

      public void touchChecked()
      Convenience: update lastCheckedAt to now.
    • getDeliveredAt

      public Instant getDeliveredAt()
    • setDeliveredAt

      public void setDeliveredAt(Instant deliveredAt)
    • isDelivered

      public boolean isDelivered()
      Whether this task's completion has been pushed back to the parent agent.
    • getTransportType

      public String getTransportType()
    • setTransportType

      public void setTransportType(String transportType)
    • getRemoteBaseUrl

      public String getRemoteBaseUrl()
    • setRemoteBaseUrl

      public void setRemoteBaseUrl(String remoteBaseUrl)
    • getRemoteHeaders

      public Map<String,String> getRemoteHeaders()
    • setRemoteHeaders

      public void setRemoteHeaders(Map<String,String> remoteHeaders)
    • isAgentProtocolTransport

      public boolean isAgentProtocolTransport()
      Whether this task is executed via the HTTP task protocol.
    • isAwaitingConfirm

      public boolean isAwaitingConfirm()
    • setAwaitingConfirm

      public void setAwaitingConfirm(boolean awaitingConfirm)
    • getPendingConfirms

      public List<RemotePendingConfirm> getPendingConfirms()
    • setPendingConfirms

      public void setPendingConfirms(List<RemotePendingConfirm> pendingConfirms)
    • getLastEventSeq

      public long getLastEventSeq()
    • setLastEventSeq

      public void setLastEventSeq(long lastEventSeq)