fix: GetContextInfo workDir uses session touch_dir instead of EffectiveWorkspace
EffectiveWorkspace only differs from workspace when a worktree is active. The tool-detected touch_dir from the most recent active session reflects the actual project directory the agent is working in. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
62058922df
commit
60342d1aca
1 changed files with 6 additions and 1 deletions
|
|
@ -2467,7 +2467,12 @@ func (al *AgentLoop) GetContextInfo() (workDir, planWorkDir, workspace string, b
|
||||||
}
|
}
|
||||||
workspace = agent.Workspace
|
workspace = agent.Workspace
|
||||||
planWorkDir = agent.ContextBuilder.GetPlanWorkDir()
|
planWorkDir = agent.ContextBuilder.GetPlanWorkDir()
|
||||||
|
// Use the most recent active session's touch_dir (tool-detected project directory)
|
||||||
|
if active := al.sessions.ListActive(); len(active) > 0 && active[0].TouchDir != "" {
|
||||||
|
workDir = active[0].TouchDir
|
||||||
|
} else {
|
||||||
workDir = agent.ContextBuilder.workDir
|
workDir = agent.ContextBuilder.workDir
|
||||||
|
}
|
||||||
bootstrap = agent.ContextBuilder.ResolveBootstrapPaths()
|
bootstrap = agent.ContextBuilder.ResolveBootstrapPaths()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue