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
b516f41a35
commit
d81282b1a6
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
|
||||
planWorkDir = agent.ContextBuilder.GetPlanWorkDir()
|
||||
workDir = agent.ContextBuilder.workDir
|
||||
// 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
|
||||
}
|
||||
bootstrap = agent.ContextBuilder.ResolveBootstrapPaths()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue