Record Class RouteResult

java.lang.Object
java.lang.Record
io.agentscope.harness.agent.gateway.channel.RouteResult
Record Components:
agentId - the resolved target agent id
context - the routing context (channel, session scope keys, agentId extra) ready for gateway execution
matchedBy - human-readable label of the binding tier that matched (e.g. "peer", "guild+roles", "default"); useful for debugging and logging
outboundAddress - delivery target for proactive replies (e.g. subagent announces); derived from the inbound message's channel and peer metadata

public record RouteResult(String agentId, MsgContext context, String matchedBy, OutboundAddress outboundAddress) extends Record
Output of ChannelRouter.resolveRoute(io.agentscope.harness.agent.gateway.channel.ChannelConfig, io.agentscope.harness.agent.gateway.channel.InboundMessage): the resolved agent id, the MsgContext to pass to Gateway.run(io.agentscope.harness.agent.gateway.MsgContext, java.util.List<io.agentscope.core.message.Msg>), a diagnostic matchedBy label indicating which binding tier (or fallback) produced the result, and the OutboundAddress for delivering replies back to the originating channel/peer.
  • Constructor Details

    • RouteResult

      public RouteResult(String agentId, MsgContext context, String matchedBy, OutboundAddress outboundAddress)
      Creates an instance of a RouteResult record class.
      Parameters:
      agentId - the value for the agentId record component
      context - the value for the context record component
      matchedBy - the value for the matchedBy record component
      outboundAddress - the value for the outboundAddress record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • agentId

      public String agentId()
      Returns the value of the agentId record component.
      Returns:
      the value of the agentId record component
    • context

      public MsgContext context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component
    • matchedBy

      public String matchedBy()
      Returns the value of the matchedBy record component.
      Returns:
      the value of the matchedBy record component
    • outboundAddress

      public OutboundAddress outboundAddress()
      Returns the value of the outboundAddress record component.
      Returns:
      the value of the outboundAddress record component