{"record":{"id":"f0b770b0f216b90d","repo":"sipeed/picoclaw","slug":"teams-webhook-a-default-webhook-target-is-requi","errorCode":null,"errorMessage":"teams_webhook: a 'default' webhook target is required","messagePattern":"teams_webhook: a 'default' webhook target is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/teams_webhook/teams_webhook.go","lineNumber":72,"sourceCode":"\t*channels.BaseChannel\n\tbc     *config.Channel\n\tconfig *config.TeamsWebhookSettings\n\tclient teamsMessageSender\n}\n\n// NewTeamsWebhookChannel creates a new Teams webhook channel.\nfunc NewTeamsWebhookChannel(\n\tbc *config.Channel,\n\tcfg *config.TeamsWebhookSettings,\n\tbus *bus.MessageBus,\n) (*TeamsWebhookChannel, error) {\n\tif len(cfg.Webhooks) == 0 {\n\t\treturn nil, fmt.Errorf(\"teams_webhook: at least one webhook target is required\")\n\t}\n\n\t// Require \"default\" webhook target\n\tif _, hasDefault := cfg.Webhooks[\"default\"]; !hasDefault {\n\t\treturn nil, fmt.Errorf(\"teams_webhook: a 'default' webhook target is required\")\n\t}\n\n\t// Validate all webhook targets have valid HTTPS URLs\n\tfor name, target := range cfg.Webhooks {\n\t\twebhookURL := target.WebhookURL.String()\n\t\tif webhookURL == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"teams_webhook: webhook %q has empty webhook_url\", name)\n\t\t}\n\t\tparsed, err := url.Parse(webhookURL)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"teams_webhook: webhook %q has invalid URL: %w\", name, err)\n\t\t}\n\t\tif !strings.EqualFold(parsed.Scheme, \"https\") {\n\t\t\treturn nil, fmt.Errorf(\"teams_webhook: webhook %q must use HTTPS (got %q)\", name, parsed.Scheme)\n\t\t}\n\t}\n\n\tbase := channels.NewBaseChannel(","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/teams_webhook/teams_webhook.go#L54-L90","documentation":"Construction-time guard in NewTeamsWebhookChannel: the webhooks map must contain an entry named \"default\" because Send falls back to it when an outbound message names an unknown target. Without a default target the fallback path would be undefined, so the constructor rejects the config up front.","triggerScenarios":"Thrown at pkg/channels/teams_webhook/teams_webhook.go:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a webhooks entry keyed exactly \"default\" (lowercase) with a valid webhook_url in the teams_webhook settings","Ensure the default target's URL is a valid HTTPS URL so it also passes the per-target validation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}