mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 08:15:29 +00:00
fix(skills): resolve {baseDir} placeholder in DB-backed skill content (#1145)
Both PG and SQLite skill stores returned SKILL.md content without the
{baseDir} substitution that skills.Loader.LoadSkill performs for
file-based access. Agents reading SKILL.md via this RPC saw the literal
placeholder, breaking script-invocation lines that expect absolute paths.
Mirror the loader's substitution in both store implementations so
behavior is consistent regardless of access path.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7e51666357
commit
e154c4f54d
2 files changed
+10
No files matched your search
@@ -40,6 +40,11 @@ func (s *PGSkillStore) LoadSkill(ctx context.Context, name string) (string, bool
|
||||
if err != nil {
|
||||
return "", false
|
||||
}
|
||||
// Resolve {baseDir} placeholder so SKILL.md script-invocation lines hold
|
||||
// absolute paths regardless of agent CWD. Mirrors skills.Loader.LoadSkill
|
||||
// substitution; without it, agents reading SKILL.md via this RPC see the
|
||||
// literal placeholder.
|
||||
content = strings.ReplaceAll(content, "{baseDir}", info.BaseDir)
|
||||
return content, true
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,11 @@ func (s *SQLiteSkillStore) LoadSkill(ctx context.Context, name string) (string,
|
||||
if err != nil {
|
||||
return "", false
|
||||
}
|
||||
// Resolve {baseDir} placeholder so SKILL.md script-invocation lines hold
|
||||
// absolute paths regardless of agent CWD. Mirrors skills.Loader.LoadSkill
|
||||
// substitution; without it, agents reading SKILL.md via this RPC see the
|
||||
// literal placeholder.
|
||||
content = strings.ReplaceAll(content, "{baseDir}", info.BaseDir)
|
||||
return content, true
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user