Decouple channel names (config keys) from channel types (provider IDs) to allow multiple instances of the same provider. This ensures robust identification across the message bus and agent dispatch logic. - Introduce ChannelType in InboundContext for consistent provider tracking - Refactor IsInternalChannel to use provider type instead of generic names - Update all channel implementations to pass through their provider type via BaseChannel - Standardize agent dispatch and heartbeat recording to use ChannelType - Enhance shell and cron tools with improved execution tracking and fallback logic - Fix redundant channel field assignments and hardcoded types in providers - Resolve build issues by adding missing logger imports to tool packages
16 lines
528 B
Go
16 lines
528 B
Go
// Package constants provides shared constants across the codebase.
|
|
package constants
|
|
|
|
// internalChannels defines channels that are used for internal communication
|
|
// and should not be exposed to external users or recorded as last active channel.
|
|
var internalChannels = map[string]struct{}{
|
|
"cli": {},
|
|
"system": {},
|
|
"subagent": {},
|
|
}
|
|
|
|
// IsInternalChannel returns true if the channel is an internal channel.
|
|
func IsInternalChannel(channelType string) bool {
|
|
_, found := internalChannels[channelType]
|
|
return found
|
|
}
|