sipeed/picoclaw · warning

channel '%s' not found or not enabled

Error message

channel '%s' not found or not enabled

What it means

SwitchChannel could not find the requested channel via channelManager.GetChannel, and the name is not the special-case "cli" channel which is always permitted. Only channels registered and enabled in the channel manager can be switched to.

Source

Thrown at pkg/agent/agent_command.go:272

		GetEnabledChannels: func() []string {
			if al.channelManager == nil {
				return nil
			}
			return al.channelManager.GetEnabledChannels()
		},
		GetActiveTurn: func() any {
			info := al.GetActiveTurn()
			if info == nil {
				return nil
			}
			return info
		},
		SwitchChannel: func(value string) error {
			if al.channelManager == nil {
				return fmt.Errorf("channel manager not initialized")
			}
			if _, exists := al.channelManager.GetChannel(value); !exists && value != "cli" {
				return fmt.Errorf("channel '%s' not found or not enabled", value)
			}
			return nil
		},
	}
	rt.StopActiveTurn = func() (commands.StopResult, error) {
		if opts == nil {
			return commands.StopResult{}, fmt.Errorf("process options not available")
		}
		return al.stopActiveTurnForSession(opts.Dispatch.SessionKey)
	}
	if agent != nil && agent.ContextBuilder != nil {
		rt.ListSkillNames = agent.ContextBuilder.ListSkillNames
	}
	rt.ReloadConfig = func() error {
		if al.reloadFunc == nil {
			return fmt.Errorf("reload not configured")
		}
		return al.reloadFunc()

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. List enabled channels first (GetEnabledChannels hook / the corresponding list command) and use an exact name
  2. Enable and configure the channel in config (credentials, enabled flag), reload, then switch
  3. Use `/channel cli` to return to the CLI channel — it is always accepted

Example fix

# before
/channel teleggram   # typo

# after
/channels            # list enabled names
/channel telegram
Defensive patterns

Strategy: validation

Validate before calling

func channelSelectable(al *AgentLoop, name string) bool {
    if name == "cli" { return true }
    _, ok := al.channelManager.GetChannel(name)
    return ok
}

Type guard

func isValidChannel(al *AgentLoop, name string) bool {
    if name == "cli" { return true }
    _, exists := al.channelManager.GetChannel(name)
    return exists
}

Prevention

When it happens

Trigger: `/channel telegram` when telegram is not configured/enabled; typo in the channel name; channel disabled in config; channel registered in a different process/session; empty or whitespace name (not "cli", not found).

Common situations: Trying to switch to a channel whose integration keys/tokens were never set up; channel names differing from docs (e.g. 'telegram' vs 'tg'); attempting switch in an environment where only CLI is active.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/1cbda977c2e80377. Report an issue: GitHub.