Skip to content

Commit 51402ed

Browse files
Merge branch 'main' into fix/install-git-dir-precedence-127361
2 parents d613aa5 + 0ea03f3 commit 51402ed

88 files changed

Lines changed: 2323 additions & 556 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/openclaw-performance.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ env:
7575
OCM_VERSION: v0.2.32
7676
OCM_LINUX_X64_SHA256: 5b20c21b2825f69b89eb37baa657f0f0062124517e6e6828e9857c7e9bbd3070
7777
KOVA_REPOSITORY: openclaw/Kova
78-
KOVA_CANONICAL_CONFIG_REF: dfafaff9dcd49b9c76788c6260f1f72dd2ced593
79-
KOVA_LEGACY_LIST_CONFIG_REF: dfafaff9dcd49b9c76788c6260f1f72dd2ced593
78+
KOVA_CANONICAL_CONFIG_REF: 1fe2f4081877bb12b7f7ed355349f98b8a0a6882
79+
KOVA_LEGACY_LIST_CONFIG_REF: 1fe2f4081877bb12b7f7ed355349f98b8a0a6882
80+
KOVA_TRUSTED_LIVE_REF: 1fe2f4081877bb12b7f7ed355349f98b8a0a6882
8081
PERFORMANCE_MODEL_ID: gpt-5.6-luna
8182
# Release matrices cold-build the candidate runtime before measurement.
8283
KOVA_SCENARIO_TIMEOUT_MS: ${{ inputs.profile == 'release' && '900000' || '300000' }}
@@ -173,7 +174,7 @@ jobs:
173174
echo "tested_sha=$resolved_sha" >> "$GITHUB_OUTPUT"
174175
echo "kova_ref=$kova_ref" >> "$GITHUB_OUTPUT"
175176
echo "kova_config_contract=$kova_config_contract" >> "$GITHUB_OUTPUT"
176-
if [[ "$kova_ref" == "$KOVA_CANONICAL_CONFIG_REF" || "$kova_ref" == "$KOVA_LEGACY_LIST_CONFIG_REF" ]]; then
177+
if [[ "$kova_ref" == "$KOVA_TRUSTED_LIVE_REF" ]]; then
177178
echo "kova_ref_trusted_for_live=true" >> "$GITHUB_OUTPUT"
178179
else
179180
echo "kova_ref_trusted_for_live=false" >> "$GITHUB_OUTPUT"

‎apps/ios/Sources/Voice/TalkModeManager.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4652,6 +4652,7 @@ extension TalkModeManager {
46524652
let forceSpeaker = TalkDefaults.speakerphoneEnabled()
46534653
let options = TalkAudioRoute.categoryOptions(speakerphoneEnabled: forceSpeaker)
46544654
try session.setCategory(.playAndRecord, mode: mode, options: options)
4655+
try session.setAllowHapticsAndSystemSoundsDuringRecording(true)
46554656
try? session.setPreferredSampleRate(48000)
46564657
try? session.setPreferredIOBufferDuration(0.02)
46574658
try session.setActive(true, options: [])

‎apps/ios/Sources/Voice/VoiceWakeManager.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ final class VoiceWakeManager: NSObject {
525525
.allowBluetoothHFP,
526526
.defaultToSpeaker,
527527
])
528+
try session.setAllowHapticsAndSystemSoundsDuringRecording(true)
528529
try session.setActive(true, options: [])
529530
}
530531

‎apps/ios/Tests/TalkModeConfigParsingTests.swift‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ import Testing
99
struct TalkModeManagerTests {
1010
private struct CloseError: Error {}
1111

12+
@Test func `recording sessions preserve system keyboard feedback`() throws {
13+
let session = AVAudioSession.sharedInstance()
14+
let previousSetting = session.allowHapticsAndSystemSoundsDuringRecording
15+
defer {
16+
try? session.setAllowHapticsAndSystemSoundsDuringRecording(previousSetting)
17+
try? session.setActive(false, options: [.notifyOthersOnDeactivation])
18+
}
19+
20+
try session.setAllowHapticsAndSystemSoundsDuringRecording(false)
21+
try TalkModeManager.configureAudioSession()
22+
#expect(session.allowHapticsAndSystemSoundsDuringRecording)
23+
24+
try session.setAllowHapticsAndSystemSoundsDuringRecording(false)
25+
try TalkModeManager.configureRealtimeAudioSession()
26+
#expect(session.allowHapticsAndSystemSoundsDuringRecording)
27+
}
28+
1229
private static func parse(_ config: [String: Any]) -> TalkModeGatewayConfigState {
1330
TalkModeGatewayConfigParser.parse(
1431
config: config,

‎apps/macos/Sources/OpenClaw/GatewayEnvironment.swift‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ enum GatewayEnvironment {
196196
gatewayBin: gatewayBin,
197197
projectRoot: projectRoot,
198198
searchPaths: searchPaths)
199+
if let gatewayBin, installedRaw == nil {
200+
let message = "OpenClaw Gateway at \(gatewayBin) could not be verified; reinstall or repair it."
201+
return GatewayEnvironmentStatus(
202+
kind: .error(message),
203+
nodeVersion: runtime.version.description,
204+
gatewayVersion: nil,
205+
requiredGateway: expectedString,
206+
message: message)
207+
}
199208
let installed = Semver.parse(installedRaw)
200209

201210
if let expected, let installedRaw, installed != nil,
@@ -253,10 +262,8 @@ enum GatewayEnvironment {
253262
projectRoot: URL,
254263
searchPaths: [String]) async -> String?
255264
{
256-
if let gatewayBin,
257-
let version = await self.readGatewayVersion(binary: gatewayBin, searchPaths: searchPaths)
258-
{
259-
return version
265+
if let gatewayBin {
266+
return await self.readGatewayVersion(binary: gatewayBin, searchPaths: searchPaths)
260267
}
261268
return self.readLocalGatewayVersion(projectRoot: projectRoot)
262269
}
@@ -269,6 +276,7 @@ enum GatewayEnvironment {
269276
arguments: ["--version"],
270277
environment: ["PATH": searchPaths.joined(separator: ":")],
271278
timeout: CommandResolver.versionProbeTimeout)
279+
guard result.terminationStatus == 0 else { return nil }
272280
let elapsedMs = Int(Date().timeIntervalSince(start) * 1000)
273281
if elapsedMs > 500 {
274282
self.logger.warning(

‎apps/macos/Sources/OpenClaw/Onboarding.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ struct OnboardingView: View {
746746

747747
var pageOrder: [Int] {
748748
Self.pageOrder(
749-
for: self.state.connectionMode,
749+
for: self.selectedConnectionMode,
750750
requiresCLIInstall: !self.cliInstalled)
751751
}
752752

‎apps/macos/Sources/OpenClaw/OnboardingAISetup.swift‎

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,7 @@ final class OnboardingAISetupModel {
2222
static let providerAuthRequestTimeoutMs: Double = 1_200_000
2323

2424
private(set) var phase: Phase = .idle {
25-
didSet {
26-
// Close-guard: quitting mid-test is confirmable, not silent.
27-
OnboardingController.shared.busyReason = if self.phase == .testing {
28-
"OpenClaw is testing your AI connection."
29-
} else if self.activeAuthOption != nil {
30-
self.isPreparingModel
31-
? "OpenClaw is preparing a local model."
32-
: "OpenClaw is completing provider sign-in."
33-
} else {
34-
nil
35-
}
36-
}
25+
didSet { self.updateBusyReason() }
3726
}
3827

3928
private(set) var candidates: [Candidate] = []
@@ -49,15 +38,7 @@ final class OnboardingAISetupModel {
4938
private(set) var authStep: WizardStep?
5039
private(set) var authError: Failure?
5140
private(set) var authBusy = false {
52-
didSet {
53-
if self.activeAuthOption != nil {
54-
OnboardingController.shared.busyReason = self.isPreparingModel
55-
? "OpenClaw is preparing a local model."
56-
: "OpenClaw is completing provider sign-in."
57-
} else if self.phase != .testing {
58-
OnboardingController.shared.busyReason = nil
59-
}
60-
}
41+
didSet { self.updateBusyReason() }
6142
}
6243

6344
var authText = ""
@@ -76,7 +57,10 @@ final class OnboardingAISetupModel {
7657

7758
var manualProviderID = ""
7859
var manualKey: String = ""
79-
private(set) var manualTesting = false
60+
private(set) var manualTesting = false {
61+
didSet { self.updateBusyReason() }
62+
}
63+
8064
private(set) var manualError: Failure?
8165
var showManualEntry = false
8266

@@ -119,6 +103,19 @@ final class OnboardingAISetupModel {
119103
self.connectionModeProvider = connectionModeProvider
120104
}
121105

106+
private func updateBusyReason() {
107+
// Every connection attempt must make quitting mid-setup confirmable.
108+
OnboardingController.shared.busyReason = if self.phase == .testing || self.manualTesting {
109+
"OpenClaw is testing your AI connection."
110+
} else if self.activeAuthOption != nil {
111+
self.isPreparingModel
112+
? "OpenClaw is preparing a local model."
113+
: "OpenClaw is completing provider sign-in."
114+
} else {
115+
nil
116+
}
117+
}
118+
122119
func startIfNeeded() {
123120
if self.waitingForPendingActivationDeadline {
124121
self.resetForGatewayChange(clearPendingHandoff: false)

‎apps/macos/Sources/OpenClaw/RuntimeLocator.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ enum RuntimeLocator {
148148
arguments: ["--version"],
149149
environment: ["PATH": pathEnv],
150150
timeout: CommandResolver.versionProbeTimeout)
151+
guard result.terminationStatus == 0 else { return nil }
151152
let elapsedMs = Int(Date().timeIntervalSince(start) * 1000)
152153
if elapsedMs > 500 {
153154
self.logger.warning(

‎apps/macos/Tests/OpenClawIPCTests/CLIInstallerTests.swift‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,11 @@ struct CLIInstallerTests {
418418
#expect(status == .ready(location: executable.path, version: "2026.7.3"))
419419
}
420420

421-
@Test func `matching external CLI with unsupported Node is unusable`() async throws {
421+
@Test(arguments: [("v20.18.0", 0), ("v24.15.0", 1)])
422+
func `matching external CLI with an unusable Node runtime needs repair`(
423+
version: String,
424+
exitCode: Int) async throws
425+
{
422426
let root = FileManager().temporaryDirectory.appendingPathComponent(
423427
"openclaw-old-node-cli-\(UUID().uuidString)")
424428
defer { try? FileManager().removeItem(at: root) }
@@ -429,7 +433,7 @@ struct CLIInstallerTests {
429433
to: executable,
430434
atomically: true,
431435
encoding: .utf8)
432-
try "#!/bin/sh\necho 'v20.18.0'\n".write(
436+
try "#!/bin/sh\necho '\(version)'\nexit \(exitCode)\n".write(
433437
to: node,
434438
atomically: true,
435439
encoding: .utf8)

‎apps/macos/Tests/OpenClawIPCTests/GatewayEnvironmentTests.swift‎

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct GatewayEnvironmentTests {
4141
#expect(Semver.parse(normalized2) == Semver(major: 2026, minor: 4, patch: 2))
4242
}
4343

44-
@Test func `failed global version probe falls back to local package`() async throws {
44+
@Test func `failed global version probe does not borrow the local package version`() async throws {
4545
let projectRoot = FileManager.default.temporaryDirectory
4646
.appendingPathComponent("openclaw-gateway-environment-\(UUID().uuidString)", isDirectory: true)
4747
try FileManager.default.createDirectory(at: projectRoot, withIntermediateDirectories: true)
@@ -54,7 +54,58 @@ struct GatewayEnvironmentTests {
5454
projectRoot: projectRoot,
5555
searchPaths: ["/usr/bin"])
5656

57-
#expect(version == "2026.7.29")
57+
#expect(version == nil)
58+
#expect(await GatewayEnvironment.installedGatewayVersion(
59+
gatewayBin: nil,
60+
projectRoot: projectRoot,
61+
searchPaths: ["/usr/bin"]) == "2026.7.29")
62+
}
63+
64+
@Test func `failed gateway probe cannot validate version output from a broken executable`() async throws {
65+
let root = try makeTempDirForTests()
66+
defer { try? FileManager.default.removeItem(at: root) }
67+
let gateway = root.appendingPathComponent("openclaw")
68+
try "#!/bin/sh\necho OpenClaw 2026.7.30\nexit 1\n"
69+
.write(to: gateway, atomically: true, encoding: .utf8)
70+
try FileManager.default.setAttributes([.posixPermissions: 0o755], ofItemAtPath: gateway.path)
71+
72+
let version = await GatewayEnvironment.installedGatewayVersion(
73+
gatewayBin: gateway.path,
74+
projectRoot: root,
75+
searchPaths: [root.path, "/usr/bin", "/bin"])
76+
77+
#expect(version == nil)
78+
}
79+
80+
@Test func `broken global gateway remains an actionable error beside a valid checkout`() async throws {
81+
let root = try makeTempDirForTests()
82+
defer { try? FileManager.default.removeItem(at: root) }
83+
let bin = root.appendingPathComponent("node_modules/.bin", isDirectory: true)
84+
try FileManager.default.createDirectory(at: bin, withIntermediateDirectories: true)
85+
let node = bin.appendingPathComponent("node")
86+
let gateway = bin.appendingPathComponent("openclaw")
87+
try "#!/bin/sh\necho v24.15.0\n".write(to: node, atomically: true, encoding: .utf8)
88+
try "#!/bin/sh\nexit 1\n".write(to: gateway, atomically: true, encoding: .utf8)
89+
for executable in [node, gateway] {
90+
try FileManager.default.setAttributes([.posixPermissions: 0o755], ofItemAtPath: executable.path)
91+
}
92+
let version = GatewayEnvironment.expectedGatewayVersionString() ?? "2026.7.30"
93+
try Data(#"{"version":"\#(version)"}"#.utf8).write(to: root.appendingPathComponent("package.json"))
94+
95+
await TestIsolation.withIsolatedState(
96+
defaults: ["openclaw.gatewayProjectRootPath": root.path])
97+
{
98+
let gatewayStatus = await GatewayEnvironment.check()
99+
100+
guard case let .error(message) = gatewayStatus.kind else {
101+
Issue.record("Expected an actionable gateway failure, got \(gatewayStatus)")
102+
return
103+
}
104+
#expect(message.contains(gateway.path))
105+
#expect(message.contains("repair"))
106+
#expect(gatewayStatus.gatewayVersion == nil)
107+
#expect(gatewayStatus.nodeVersion == "24.15.0")
108+
}
58109
}
59110

60111
@Test func `gateway version probe tolerates loaded host delay`() async throws {

0 commit comments

Comments
 (0)