MCPcopy Create free account
hub / github.com/compozy/agh / agentChannelMessageFromRequest

Function agentChannelMessageFromRequest

internal/api/core/agent_channels.go:758–776  ·  view source on GitHub ↗
(
	messageID string,
	channel string,
	fromSessionID string,
	toSessionID string,
	body json.RawMessage,
	metadata contract.CoordinationMessageMetadataPayload,
	timestamp time.Time,
)

Source from the content-addressed store, hash-verified

756}
757
758func agentChannelMessageFromRequest(
759 messageID string,
760 channel string,
761 fromSessionID string,
762 toSessionID string,
763 body json.RawMessage,
764 metadata contract.CoordinationMessageMetadataPayload,
765 timestamp time.Time,
766) contract.AgentChannelMessagePayload {
767 return contract.AgentChannelMessagePayload{
768 MessageID: strings.TrimSpace(messageID),
769 ChannelID: firstNonEmpty(strings.TrimSpace(metadata.CoordinationChannelID), strings.TrimSpace(channel)),
770 FromSessionID: strings.TrimSpace(fromSessionID),
771 ToSessionID: strings.TrimSpace(toSessionID),
772 Body: cloneRawMessage(body),
773 Metadata: metadata,
774 Timestamp: timestamp.UTC(),
775 }
776}
777
778func filterAgentChannelEnvelopes(envelopes []network.Envelope, channel string) []network.Envelope {
779 channel = strings.TrimSpace(channel)

Callers 2

AgentChannelSendMethod · 0.85
AgentChannelReplyMethod · 0.85

Calls 2

firstNonEmptyFunction · 0.70
cloneRawMessageFunction · 0.70

Tested by

no test coverage detected