Skip to content

Commit 82f1254

Browse files
committed
chore: refresh provider tests from main
2 parents b00f502 + ffb1759 commit 82f1254

155 files changed

Lines changed: 2833 additions & 1170 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/ci.yml‎

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4557,32 +4557,41 @@ jobs:
45574557
process.stdout.write(simulator.udid);
45584558
'
45594559
)"
4560-
derived_data_path="$RUNNER_TEMP/openclaw-watch-lifecycle"
4561-
xcodebuild \
4562-
-project apps/ios/OpenClaw.xcodeproj \
4563-
-scheme OpenClawWatchApp \
4564-
-configuration Debug \
4565-
-destination "platform=watchOS Simulator,id=${simulator_id}" \
4566-
-derivedDataPath "$derived_data_path" \
4567-
-parallel-testing-enabled NO \
4568-
-only-testing:OpenClawWatchTests/WatchInboxStoreOperationTests \
4569-
CODE_SIGNING_ALLOWED=NO \
4570-
build-for-testing
4560+
# Reuse the Watch products already compiled by the generic iOS build.
4561+
# Resolve the selected target product from Xcode, not its DerivedData naming.
4562+
xcodebuild_args=(
4563+
-project apps/ios/OpenClaw.xcodeproj
4564+
-scheme OpenClawWatchApp
4565+
-configuration Debug
4566+
-destination "platform=watchOS Simulator,id=${simulator_id}"
4567+
CODE_SIGNING_ALLOWED=NO
4568+
)
4569+
test_args=(
4570+
-parallel-testing-enabled NO
4571+
-only-testing:OpenClawWatchTests/WatchInboxStoreOperationTests
4572+
)
4573+
xcodebuild "${xcodebuild_args[@]}" "${test_args[@]}" build-for-testing
4574+
app_path="$(
4575+
xcodebuild "${xcodebuild_args[@]}" -showBuildSettings -json |
4576+
node --input-type=module -e '
4577+
import path from "node:path";
4578+
const chunks = [];
4579+
for await (const chunk of process.stdin) chunks.push(chunk);
4580+
const targets = JSON.parse(Buffer.concat(chunks).toString("utf8"))
4581+
.filter((target) => target.target === "OpenClawWatchApp");
4582+
if (targets.length !== 1) throw new Error("Expected one Watch app target from Xcode");
4583+
const { TARGET_BUILD_DIR, FULL_PRODUCT_NAME } = targets[0].buildSettings;
4584+
if (!path.isAbsolute(TARGET_BUILD_DIR) || !FULL_PRODUCT_NAME) {
4585+
throw new Error("Expected an absolute Watch app product from Xcode");
4586+
}
4587+
process.stdout.write(path.join(TARGET_BUILD_DIR, FULL_PRODUCT_NAME));
4588+
'
4589+
)"
45714590
xcrun simctl boot "$simulator_id" 2>/dev/null || true
45724591
xcrun simctl bootstatus "$simulator_id" -b
4573-
xcrun simctl install \
4574-
"$simulator_id" \
4575-
"$derived_data_path/Build/Products/Debug-watchsimulator/OpenClawWatchApp.app"
4576-
xcodebuild \
4577-
-project apps/ios/OpenClaw.xcodeproj \
4578-
-scheme OpenClawWatchApp \
4579-
-configuration Debug \
4580-
-destination "platform=watchOS Simulator,id=${simulator_id}" \
4581-
-derivedDataPath "$derived_data_path" \
4592+
xcrun simctl install "$simulator_id" "$app_path"
4593+
xcodebuild "${xcodebuild_args[@]}" "${test_args[@]}" \
45824594
-resultBundlePath apps/ios/build/LifecycleTestResults/OpenClawWatchOperationTests.xcresult \
4583-
-parallel-testing-enabled NO \
4584-
-only-testing:OpenClawWatchTests/WatchInboxStoreOperationTests \
4585-
CODE_SIGNING_ALLOWED=NO \
45864595
test-without-building
45874596
45884597
- name: Upload iOS lifecycle simulator evidence

‎.github/workflows/openclaw-npm-release.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,17 @@ jobs:
450450
- name: Verify release contents
451451
env:
452452
OPENCLAW_RELEASE_CHECK_LOCAL_PACKAGE_TARBALL_DIR: ${{ steps.core_package_tarballs.outputs.dir }}
453-
run: pnpm release:generated:check && node --import tsx scripts/release-check.ts
453+
WORKFLOW_SHA: ${{ github.workflow_sha }}
454+
run: |
455+
set -euo pipefail
456+
pnpm release:generated:check
457+
tooling_dir="${GITHUB_WORKSPACE}/.artifacts/plugin-sdk-release-tooling"
458+
if [[ "$(git -C "$tooling_dir" rev-parse HEAD)" != "$WORKFLOW_SHA" ]] || [[ -n "$(git -C "$tooling_dir" status --porcelain)" ]]; then
459+
echo "Trusted release-check tooling does not match the workflow SHA." >&2
460+
exit 1
461+
fi
462+
TSX_TSCONFIG_PATH="$tooling_dir/tsconfig.json" \
463+
node --import "$tooling_dir/scripts/tsx.mjs" "$tooling_dir/scripts/release-check.ts"
454464
455465
- name: Exercise all extended-stable plugin npm packages
456466
id: plugin_npm_preflight

‎apps/ios/Tests/WatchApprovalTransportSourceGuardTests.swift‎

Lines changed: 12 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct WatchApprovalTransportSourceGuardTests {
114114
"WatchGatewayID.key(snapshot.gatewayStableID) == WatchGatewayID.key(token.gatewayStableID)"))
115115
}
116116

117-
@Test func `watch applies retry reset only to its exact active attempt`() throws {
117+
@Test func `retry reset matches the exact active attempt`() throws {
118118
let storeSource = try Self.readWatchSource("WatchInboxStore.swift")
119119
let promptConsume = try Self.extract(
120120
storeSource,
@@ -125,23 +125,11 @@ struct WatchApprovalTransportSourceGuardTests {
125125
from: "private func upsertExecApproval(",
126126
to: "private static func snapshotCanReplace(")
127127

128-
let guardedUpsert = try #require(promptConsume.range(of: "guard self.upsertExecApproval("))
129-
let notificationOwnerCheck = try #require(promptConsume.range(of: "guard let approvalOwnerKey"))
130-
#expect(guardedUpsert.lowerBound < notificationOwnerCheck.lowerBound)
131-
let upsertAdmission = promptConsume[guardedUpsert.lowerBound..<notificationOwnerCheck.lowerBound]
132-
#expect(upsertAdmission.contains("else { return }"))
133-
#expect(upsert.contains("resetResolutionAttemptID: String? = nil) -> Bool"))
134-
#expect(upsert.components(separatedBy: "return false").count >= 3)
135-
#expect(upsert.contains("return true"))
136-
#expect(promptConsume.contains(
137-
"resetResolutionAttemptID: message.resetResolutionAttemptId"))
138-
#expect(upsert.contains("let activeResolutionAttemptID ="))
128+
#expect(promptConsume.contains("resetResolutionAttemptID: message.resetResolutionAttemptId"))
129+
#expect(upsert.contains("resetResolutionAttemptID: String? = nil"))
139130
#expect(upsert.contains(
140131
"WatchOpaqueUTF8Key(resetResolutionAttemptID) == WatchOpaqueUTF8Key(activeResolutionAttemptID)"))
141132
#expect(upsert.contains("activeResolutionAttemptID = resetResolvingState ? nil"))
142-
#expect(!storeSource.contains("appliedResetDeliveryIDs"))
143-
#expect(!storeSource.contains("deliveryId"))
144-
#expect(!storeSource.contains("resetResolvingState: Bool?"))
145133
}
146134

147135
@Test func `watch rejects partial or missing approval snapshot arrays`() throws {
@@ -290,80 +278,35 @@ struct WatchApprovalTransportSourceGuardTests {
290278
#expect(detailScroll.contains("self.content"))
291279
}
292280

293-
@Test func `watch notification identity frames dotted components`() throws {
281+
@Test func `notification identity keeps dotted owners distinct`() throws {
294282
let storeSource = try Self.readWatchSource("WatchInboxStore.swift")
295-
let messagesSource = try Self.readWatchSource("WatchInboxMessages.swift")
296-
let identifierSource = try Self.readIOSServiceSource("ExactOpaqueIdentifier.swift")
297-
let promptConsume = try Self.extract(
298-
storeSource,
299-
from: "func consume(\n execApprovalPrompt",
300-
to: "func consume(\n execApprovalSnapshot")
301-
let rawLeft = "a.b" + "." + "c"
302-
let rawRight = "a" + "." + "b.c"
303-
#expect(rawLeft == rawRight)
304-
305-
let framedLeft = ExactOpaqueIdentifierKey("a.b").notificationComponent + "."
283+
let left = ExactOpaqueIdentifierKey("a.b").notificationComponent + "."
306284
+ ExactOpaqueIdentifierKey("c").notificationComponent
307-
let framedRight = ExactOpaqueIdentifierKey("a").notificationComponent + "."
285+
let right = ExactOpaqueIdentifierKey("a").notificationComponent + "."
308286
+ ExactOpaqueIdentifierKey("b.c").notificationComponent
309-
#expect(framedLeft != framedRight)
310-
#expect(messagesSource.contains("typealias WatchOpaqueUTF8Key = ExactOpaqueIdentifierKey"))
311-
#expect(identifierSource.contains("0x2D, 0x5F, 0x7E"))
312-
#expect(!identifierSource.contains("0x2D, 0x2E, 0x5F, 0x7E"))
313-
#expect(!storeSource.contains("0x2D, 0x2E, 0x5F, 0x7E"))
287+
288+
#expect(left != right)
314289
#expect(storeSource.contains("gatewayKey.notificationComponent).\\(approvalKey.notificationComponent"))
315-
#expect(storeSource.contains("legacyExecApprovalNotificationIdentifier"))
316-
#expect(storeSource.contains("hasLiveLegacyNotificationCollision"))
290+
#expect(storeSource.contains("!self.hasLiveLegacyNotificationCollision("))
317291
#expect(storeSource.contains("recordKey != excludedKey"))
318-
let legacyCleanup = try #require(
319-
promptConsume.range(of: "if let legacyNotificationIdentifier"))
320-
let notificationSchedule = try #require(
321-
promptConsume.range(of: "await self.postLocalNotification("))
322-
#expect(legacyCleanup.lowerBound < notificationSchedule.lowerBound)
323-
#expect(promptConsume.contains("!self.hasLiveLegacyNotificationCollision("))
324-
#expect(promptConsume.contains(
325-
"self.removeLocalNotifications(identifiers: [legacyNotificationIdentifier])"))
326292
}
327293

328-
@Test func `watch snapshot acknowledgment advances only after store acceptance`() throws {
294+
@Test func `snapshot acknowledgment follows store acceptance`() throws {
329295
let storeSource = try Self.readWatchSource("WatchInboxStore.swift")
330296
let receiverSource = try Self.readWatchSource("WatchConnectivityReceiver.swift")
331297
let snapshotConsume = try Self.extract(
332298
storeSource,
333299
from: "func consume(\n execApprovalSnapshot",
334300
to: "func consume(appSnapshot")
335-
let replay = try Self.extract(
336-
storeSource,
337-
from: "func replayDeferredGatewayPayloads()",
338-
to: "private func clearMessagePrompt()")
339-
let correlation = try #require(snapshotConsume.range(of: "let hasCanonicalRequestCorrelation"))
340-
let ownerValidation = try #require(snapshotConsume.range(of: "let allApprovalOwnersMatch"))
341-
let existingRecords = try #require(snapshotConsume.range(of: "let existingRecords = self.execApprovals"))
342301

343302
#expect(snapshotConsume.contains("transport: String) -> Bool"))
344-
#expect(snapshotConsume.components(separatedBy: "return false").count >= 4)
303+
#expect(snapshotConsume.contains("guard allApprovalOwnersMatch else { return false }"))
345304
#expect(snapshotConsume.contains("self.persistState()\n return true"))
346305
#expect(receiverSource.contains(
347306
"if self.store.consume(execApprovalSnapshot: execApprovalSnapshot, transport: transport)"))
348307
#expect(receiverSource.contains(
349308
"if self.store.consume(execApprovalSnapshot: snapshot, transport: transport)"))
350-
#expect(replay.contains(
351-
"func replayDeferredGatewayPayloads() -> [WatchExecApprovalSnapshotMessage]"))
352-
#expect(replay.contains(
353-
"var appliedExecApprovalSnapshots: [WatchExecApprovalSnapshotMessage] = []"))
354-
#expect(replay.contains("if self.consume(execApprovalSnapshot: message, transport: transport)"))
355-
#expect(replay.contains("appliedExecApprovalSnapshots.append(message)"))
356-
#expect(replay.contains("return appliedExecApprovalSnapshots"))
357-
#expect(receiverSource.components(
358-
separatedBy: "for snapshot in self.store.replayDeferredGatewayPayloads()").count == 3)
359-
#expect(receiverSource.components(
360-
separatedBy: "self.recordAcceptedExecApprovalSnapshot(snapshot)").count >= 3)
361-
#expect(!receiverSource.contains("execApprovalSnapshotRevision"))
362-
#expect(correlation.lowerBound < ownerValidation.lowerBound)
363-
#expect(ownerValidation.lowerBound < existingRecords.lowerBound)
364-
#expect(snapshotConsume.contains("guard allApprovalOwnersMatch else { return false }"))
365-
#expect(snapshotConsume.contains(
366-
"Self.gatewayIDsMatch(approval.gatewayStableID, snapshotGatewayID)"))
309+
#expect(receiverSource.contains("if self.consume(execApprovalSnapshot: message, transport: transport)"))
367310
}
368311

369312
private static func readWatchSource(_ filename: String) throws -> String {
@@ -375,15 +318,6 @@ struct WatchApprovalTransportSourceGuardTests {
375318
return try String(contentsOf: url, encoding: .utf8)
376319
}
377320

378-
private static func readIOSServiceSource(_ filename: String) throws -> String {
379-
let url = URL(fileURLWithPath: #filePath)
380-
.deletingLastPathComponent()
381-
.deletingLastPathComponent()
382-
.appendingPathComponent("Sources/Services")
383-
.appendingPathComponent(filename)
384-
return try String(contentsOf: url, encoding: .utf8)
385-
}
386-
387321
private static func extract(_ source: String, from start: String, to end: String) throws -> String {
388322
let startRange = try #require(source.range(of: start))
389323
let tail = source[startRange.lowerBound...]

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
427427
guard self.terminationCleanupTask == nil else {
428428
return .terminateLater
429429
}
430+
// AppKit will not tear down onboarding while its sheet remains attached.
431+
// Retire it before terminateLater starts the asynchronous cleanup loop.
432+
OnboardingController.shared.close()
430433
self.terminationCleanupTask = Task { @MainActor [weak self] in
431434
async let processCleanupResult: Void = Self.cleanUpProcesses()
432435
async let bridgeCleanupResult: Void = PeekabooBridgeHostCoordinator.shared.shutdown()

0 commit comments

Comments
 (0)