mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge pull request #3055 from chengzhichao-xydt/codex/context-getwd-error
fix(agent): handle os.Getwd error in NewContextBuilder
This commit is contained in:
@@ -102,7 +102,13 @@ func NewContextBuilder(workspace string) *ContextBuilder {
|
||||
// Use the skills/ directory under the current working directory
|
||||
builtinSkillsDir := strings.TrimSpace(os.Getenv(config.EnvBuiltinSkills))
|
||||
if builtinSkillsDir == "" {
|
||||
wd, _ := os.Getwd()
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
// os.Getwd failure is extremely rare; fall back to empty
|
||||
// string so that filepath.Join produces a relative "skills"
|
||||
// path, preserving the original lookup behavior.
|
||||
wd = ""
|
||||
}
|
||||
builtinSkillsDir = filepath.Join(wd, "skills")
|
||||
}
|
||||
globalSkillsDir := filepath.Join(getGlobalConfigDir(), "skills")
|
||||
|
||||
Reference in New Issue
Block a user