{"record":{"id":"a0dec6fe376926a2","repo":"Tencent/WeKnora","slug":"failed-to-discover-skills-w","errorCode":null,"errorMessage":"failed to discover skills: %w","messagePattern":"failed to discover skills: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/skills/manager.go","lineNumber":205,"sourceCode":"// deployment's skills/preloaded directory is not what execute_skill_script\n// would find inside the sandbox.\nfunc (m *Manager) discoverAllSkills() ([]*SkillMetadata, error) {\n\tif m.tenantSource != nil {\n\t\treturn m.tenantSource.DiscoverSkills()\n\t}\n\treturn m.loader.Reload()\n}\n\n// Initialize discovers all skills and caches their metadata\n// This should be called at startup\nfunc (m *Manager) Initialize(ctx context.Context) error {\n\tif !m.enabled {\n\t\treturn nil\n\t}\n\n\tmetadata, err := m.discoverAllSkills()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to discover skills: %w\", err)\n\t}\n\n\t// Filter by allowed skills if specified\n\tif len(m.allowedSkills) > 0 {\n\t\tmetadata = m.filterAllowedSkills(metadata)\n\t}\n\n\tm.mu.Lock()\n\tm.metadataCache = metadata\n\tm.mu.Unlock()\n\n\treturn nil\n}\n\n// filterAllowedSkills filters metadata to only include allowed skills\nfunc (m *Manager) filterAllowedSkills(metadata []*SkillMetadata) []*SkillMetadata {\n\tif len(m.allowedSkills) == 0 {\n\t\treturn metadata","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/skills/manager.go#L187-L223","documentation":"Startup wrapper in Manager.Initialize: discoverAllSkills (tenant source discovery or loader.Reload) failed, so no skill metadata cache could be built. This fires at service startup when skills are enabled; it wraps the underlying discovery error verbatim.","triggerScenarios":"Thrown at internal/agent/skills/manager.go:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause: unreadable skill directories or a failing tenant skill source","Fix directory permissions or tenant source connectivity, then restart/re-initialize","If skills are optional, consider disabling skills to let startup proceed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}