Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions framework/configstore/skills.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@ func (s *RDBConfigStore) GetSkillVersion(ctx context.Context, skillID, version s
}
return nil, err
}
hydrateInlineTextContent(v.Files)
return &v, nil
}

Expand Down Expand Up @@ -1085,19 +1084,6 @@ func createSkillVersion(tx *gorm.DB, skill *tables.TableSkill, version string) (
}

// populateSkillFiles reloads the serving version's files into the transient skill.Files.
// hydrateInlineTextContent fills InlineContent for text files from their DB blob
// so GET responses return the editable content (the `content` field). Content kept
// only in object storage is served via the file endpoint rather than inlined here.
func hydrateInlineTextContent(files []tables.TableSkillFile) {
for i := range files {
file := &files[i]
if file.SourceType == tables.SkillSourceTypeText && file.InlineContent == nil && file.Blob != nil {
content := string(file.Blob.Data)
file.InlineContent = &content
}
}
}

func populateSkillFiles(tx *gorm.DB, skill *tables.TableSkill) error {
var version tables.TableSkillVersion
if err := tx.Preload("Files").
Expand All @@ -1110,7 +1096,6 @@ func populateSkillFiles(tx *gorm.DB, skill *tables.TableSkill) error {
}
skill.Files = version.Files
skill.FileCount = int64(len(version.Files))
hydrateInlineTextContent(skill.Files)
return nil
}

Expand Down
Loading
Loading