{"record":{"id":"67dc075297ac2826","repo":"sipeed/picoclaw","slug":"pico-token-is-required","errorCode":null,"errorMessage":"pico token is required","messagePattern":"pico token is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/pico/pico.go","lineNumber":119,"sourceCode":"\tconnections        map[string]*picoConn            // connID -> *picoConn\n\tsessionConnections map[string]map[string]*picoConn // sessionID -> connID -> *picoConn\n\tconnsMu            sync.RWMutex\n\tctx                context.Context\n\tcancel             context.CancelFunc\n\tprogress           *channels.ToolFeedbackAnimator\n\tdeleteMessageFn    func(context.Context, string, string) error\n\t// broadcastFn lets tests intercept outbound broadcasts. nil → broadcastToSession.\n\tbroadcastFn func(chatID string, msg PicoMessage) error\n}\n\n// NewPicoChannel creates a new Pico Protocol channel.\nfunc NewPicoChannel(\n\tbc *config.Channel,\n\tcfg *config.PicoSettings,\n\tmessageBus *bus.MessageBus,\n) (*PicoChannel, error) {\n\tif cfg.Token.String() == \"\" {\n\t\treturn nil, fmt.Errorf(\"pico token is required\")\n\t}\n\n\tbase := channels.NewBaseChannel(\"pico\", cfg, messageBus, bc.AllowFrom)\n\n\tallowOrigins := cfg.AllowOrigins\n\tcheckOrigin := func(r *http.Request) bool {\n\t\tif len(allowOrigins) == 0 {\n\t\t\treturn true // allow all if not configured\n\t\t}\n\t\torigin := r.Header.Get(\"Origin\")\n\t\tfor _, allowed := range allowOrigins {\n\t\t\tif allowed == \"*\" || allowed == origin {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/pico/pico.go#L101-L137","documentation":"Error \"pico token is required\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/pico/pico.go:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}