refactor(workspace): normalize skill-related env and prompt

This commit is contained in:
ChrAlpha
2026-04-13 13:47:33 +00:00
parent 70ed8b5980
commit 4ffc4de8ec
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -8,6 +8,8 @@ import (
"strconv"
"strings"
"time"
skillset "github.com/memohai/memoh/internal/skills"
)
//go:embed prompts/*.md
@@ -205,7 +207,8 @@ func buildSkillsSection(skills []SkillEntry) string {
})
var sb strings.Builder
sb.WriteString("## Skills\n\n")
sb.WriteString("Skills are stored in `{{home}}/skills/`. ")
sb.WriteString("Memoh-managed skills are stored in `" + skillset.ManagedDir() + "/`. ")
sb.WriteString("Compatible external skill directories inside the bot container may also be discovered automatically. ")
sb.WriteString("Each skill is a `SKILL.md` file inside a named subdirectory.\n\n")
sb.WriteString("Call `use_skill` with the skill name to load its full instructions before following them. ")
sb.WriteString("Only activate a skill when it is relevant to the current task.\n\n")
+3 -1
View File
@@ -18,6 +18,7 @@ import (
ctr "github.com/memohai/memoh/internal/containerd"
dbsqlc "github.com/memohai/memoh/internal/db/sqlc"
"github.com/memohai/memoh/internal/identity"
skillset "github.com/memohai/memoh/internal/skills"
"github.com/memohai/memoh/internal/workspace/bridge"
)
@@ -243,9 +244,10 @@ func (m *Manager) buildWorkspaceContainerSpec(botID string, gpu WorkspaceGPUConf
tzMounts, tzEnv := ctr.TimezoneSpec()
mounts = append(mounts, tzMounts...)
env := make([]string, 0, len(tzEnv)+1)
env := make([]string, 0, len(tzEnv)+1+len(skillset.ContainerEnv()))
env = append(env, tzEnv...)
env = append(env, "BRIDGE_SOCKET_PATH=/run/memoh/bridge.sock")
env = append(env, skillset.ContainerEnv()...)
return ctr.ContainerSpec{
Cmd: []string{"/opt/memoh/bridge"},