sec: show persistent shell path in permission dialog (#916)

Carlos Alexandro Becker created

Currently it will always show the path of when it was started.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Change summary

internal/llm/tools/bash.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

internal/llm/tools/bash.go 🔗

@@ -370,10 +370,11 @@ func (b *bashTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
 		return ToolResponse{}, fmt.Errorf("session ID and message ID are required for executing shell command")
 	}
 	if !isSafeReadOnly {
+		shell := shell.GetPersistentShell(b.workingDir)
 		p := b.permissions.Request(
 			permission.CreatePermissionRequest{
 				SessionID:   sessionID,
-				Path:        b.workingDir,
+				Path:        shell.GetWorkingDir(),
 				ToolCallID:  call.ID,
 				ToolName:    BashToolName,
 				Action:      "execute",