mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 02:10:21 +00:00
fix(macos): stabilize shell timeouts and command resolution tests
This commit is contained in:
@@ -235,7 +235,8 @@ enum CommandResolver {
|
||||
extraArgs: [String] = [],
|
||||
defaults: UserDefaults = .standard,
|
||||
configRoot: [String: Any]? = nil,
|
||||
searchPaths: [String]? = nil) -> [String]
|
||||
searchPaths: [String]? = nil,
|
||||
projectRoot: URL? = nil) -> [String]
|
||||
{
|
||||
let settings = self.connectionSettings(defaults: defaults, configRoot: configRoot)
|
||||
if settings.mode == .remote, let ssh = self.sshNodeCommand(
|
||||
@@ -246,7 +247,7 @@ enum CommandResolver {
|
||||
return ssh
|
||||
}
|
||||
|
||||
let root = self.projectRoot()
|
||||
let root = projectRoot ?? self.projectRoot()
|
||||
if let openclawPath = self.projectOpenClawExecutable(projectRoot: root) {
|
||||
return [openclawPath, subcommand] + extraArgs
|
||||
}
|
||||
@@ -289,14 +290,16 @@ enum CommandResolver {
|
||||
extraArgs: [String] = [],
|
||||
defaults: UserDefaults = .standard,
|
||||
configRoot: [String: Any]? = nil,
|
||||
searchPaths: [String]? = nil) -> [String]
|
||||
searchPaths: [String]? = nil,
|
||||
projectRoot: URL? = nil) -> [String]
|
||||
{
|
||||
self.openclawNodeCommand(
|
||||
subcommand: subcommand,
|
||||
extraArgs: extraArgs,
|
||||
defaults: defaults,
|
||||
configRoot: configRoot,
|
||||
searchPaths: searchPaths)
|
||||
searchPaths: searchPaths,
|
||||
projectRoot: projectRoot)
|
||||
}
|
||||
|
||||
// MARK: - SSH helpers
|
||||
|
||||
@@ -73,8 +73,10 @@ enum ShellExecutor {
|
||||
group.addTask { await waitTask.value }
|
||||
group.addTask {
|
||||
try? await Task.sleep(nanoseconds: nanos)
|
||||
if process.isRunning { process.terminate() }
|
||||
_ = await waitTask.value // drain pipes after termination
|
||||
guard process.isRunning else {
|
||||
return await waitTask.value
|
||||
}
|
||||
process.terminate()
|
||||
return ShellResult(
|
||||
stdout: "",
|
||||
stderr: "",
|
||||
|
||||
Reference in New Issue
Block a user