MCPcopy Index your code
hub / github.com/coder/coder / fetchPersonalSkillMetadata

Method fetchPersonalSkillMetadata

coderd/x/chatd/chatd.go:6851–6877  ·  view source on GitHub ↗
(
	ctx context.Context,
	userID uuid.UUID,
	logger slog.Logger,
)

Source from the content-addressed store, hash-verified

6849}
6850
6851func (p *Server) fetchPersonalSkillMetadata(
6852 ctx context.Context,
6853 userID uuid.UUID,
6854 logger slog.Logger,
6855) []skillspkg.Skill {
6856 rows, err := p.db.ListUserSkillMetadataByUserID(userSkillContext(ctx, userID), userID)
6857 // See package coderd/x/skills (doc.go) for why metadata fetch failures
6858 // intentionally degrade to an empty personal-skill list instead of
6859 // failing the chat turn.
6860 if err != nil {
6861 logger.Warn(ctx, "failed to load personal skill metadata",
6862 slog.F("owner_id", userID),
6863 slog.Error(err),
6864 )
6865 return nil
6866 }
6867
6868 personalSkills := make([]skillspkg.Skill, 0, len(rows))
6869 for _, row := range rows {
6870 personalSkills = append(personalSkills, skillspkg.Skill{
6871 Name: row.Name,
6872 Description: row.Description,
6873 Source: skillspkg.SourcePersonal,
6874 })
6875 }
6876 return personalSkills
6877}
6878
6879func (p *Server) loadPersonalSkillBody(
6880 ctx context.Context,

Callers 2

runChatMethod · 0.95

Calls 3

userSkillContextFunction · 0.85
ErrorMethod · 0.45

Tested by 1