Skip to content

Commit 8e69347

Browse files
authored
Merge branch 'main' into codex/autoqa-i18n-empty-param
2 parents a65cd5b + f49eaf8 commit 8e69347

38 files changed

Lines changed: 2009 additions & 496 deletions

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ jobs:
18901890
fi
18911891
pnpm check:max-lines-ratchet --base "$base_ref"
18921892
if [[ "${RATCHET_RELEASE_MERGE_TREE:-}" == "true" ]]; then
1893-
node --import tsx scripts/run-oxlint-shards.mts --only=core --only=extensions --split-core --threads=1
1893+
node --import tsx scripts/run-oxlint-shards.mts --only=core --only=extensions --threads=1
18941894
fi
18951895
;;
18961896
bun-launcher)
@@ -2501,15 +2501,16 @@ jobs:
25012501
# i18n-tooling diff must run it. oxlint always runs.
25022502
lint_args=(--threads=8)
25032503
if [ "$RUNNER_BACKEND" = "github" ]; then
2504-
# Three dedicated hosted jobs own the split core stripes. Keep
2504+
# Five dedicated hosted jobs own the aggregated core Programs. Keep
25052505
# extension preparation, optional UI checks, and formatting in
2506-
# this fourth lane so each 4-core runner stays below ~6m.
2506+
# this sixth lane so each 4-core runner stays below ~6m.
25072507
lint_args=(--only=extensions --only=scripts --threads=1)
2508+
export GOMAXPROCS=2
25082509
elif [ "$(nproc)" -lt 8 ]; then
2509-
# Fork PRs run on 4-core hosted runners with 16GB. Bound both
2510-
# the core process size and its threads so type-aware oxlint
2511-
# does not intermittently lose the runner under memory pressure.
2512-
lint_args=(--split-core --threads=1)
2510+
# Fork PRs build each semantic Program once. Bound both oxlint
2511+
# and its Go helper within the 4-core/16GB hosted runner.
2512+
lint_args=(--threads=1)
2513+
export GOMAXPROCS=2
25132514
fi
25142515
if [ "$RUN_CONTROL_UI_I18N" = "true" ] || [ "$RUN_UI_TESTS" = "true" ]; then
25152516
pnpm lint "${lint_args[@]}"
@@ -2613,8 +2614,8 @@ jobs:
26132614
;;
26142615
esac
26152616
2616-
# The github/hybrid planner profile splits the serial core oxlint path across
2617-
# five deterministic hosted jobs. All-Blacksmith mode keeps one lint job.
2617+
# The github/hybrid planner profile aggregates core targets into five Programs
2618+
# across five hosted jobs. All-Blacksmith mode keeps one lint job.
26182619
check-lint-hosted-core-shard:
26192620
permissions:
26202621
contents: read
@@ -2639,6 +2640,7 @@ jobs:
26392640

26402641
- name: Run hosted core lint stripe
26412642
env:
2643+
GOMAXPROCS: "2"
26422644
OPENCLAW_LOCAL_CHECK: "0"
26432645
run: >-
26442646
node --import tsx scripts/run-oxlint-shards.mts

‎apps/macos/README.md‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,43 @@ still runs in process as usual. App relocation, Sparkle updates, and post-update
4949
service repair are disabled in profile mode; update the installed app through
5050
the normal default-profile workflow.
5151

52-
## Packaging flow
52+
## Packaging flows
53+
54+
Development bundle (signed but not notarized):
5355

5456
```bash
5557
scripts/package-mac-app.sh
5658
```
5759

58-
Creates `dist/OpenClaw.app` and signs it via `scripts/codesign-mac-app.sh`.
60+
This creates `dist/OpenClaw.app` and signs it via `scripts/codesign-mac-app.sh`.
61+
It is not a distribution artifact. For a notarized app ZIP and DMG, use:
62+
63+
```bash
64+
scripts/package-mac-dist.sh
65+
```
66+
67+
For an unattended Peekaboo elevation host, use the closed Foundation signing
68+
profile and source-addressed ZIP workflow. `package` is an internal release
69+
operator command: it requires the OpenClaw Foundation signing identity and
70+
notarization credentials, and its archive is not a general-download artifact.
71+
72+
```bash
73+
scripts/mac-elevation-host.sh package
74+
scripts/mac-elevation-host.sh install \
75+
--archive "dist/elevation-host/OpenClaw-<full-source-sha>-stable.zip"
76+
scripts/mac-elevation-host.sh status
77+
```
78+
79+
The elevation package is ZIP-only, notarized and stapled, contains exactly
80+
`OpenClaw.app`, omits Apple Events entitlements, records an immutable receipt,
81+
and verifies a freshly extracted copy. Installation owns the separate
82+
`ai.openclaw.mac.elevation-host` launchd job with `RunAtLoad` and `KeepAlive`.
83+
It refuses to replace or race the ordinary `ai.openclaw.mac` Launch at login
84+
job. `recover` restores the recorded prior bundle after a failed cutover;
85+
`uninstall` removes only the elevation job and preserves the app, state,
86+
Keychain, TCC, and recovery receipt. Installation exits successfully once the
87+
launchd-owned process is Bridge-ready; missing TCC remains a degraded `status`
88+
result until the required grants are present.
5989

6090
## Signing behavior
6191

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

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,53 @@
11
import Foundation
22

3-
struct AppLaunchPresentationPolicy: Equatable {
4-
let backgroundOnly: Bool
3+
struct AppLaunchRuntimePlan: Equatable {
4+
enum Mode: Equatable {
5+
case interactive
6+
case background
7+
case elevationHost
8+
}
9+
10+
let mode: Mode
11+
let attachOnly: Bool
512

613
init(arguments: [String]) {
7-
self.backgroundOnly = arguments.contains("--background-only")
14+
if arguments.contains("--elevation-host") {
15+
self.mode = .elevationHost
16+
self.attachOnly = true
17+
} else {
18+
self.mode = arguments.contains("--background-only") ? .background : .interactive
19+
self.attachOnly = arguments.contains("--attach-only") || arguments.contains("--no-launchd")
20+
}
821
}
922

1023
static var current: Self {
1124
Self(arguments: CommandLine.arguments)
1225
}
1326

27+
var isElevationHost: Bool {
28+
self.mode == .elevationHost
29+
}
30+
1431
var allowsAutomaticPresentation: Bool {
15-
!self.backgroundOnly
32+
self.mode == .interactive
1633
}
1734

1835
/// GUI-owned Keychain items may present SecurityAgent when a newly signed build is not in an item's ACL.
1936
/// Background hosts keep that state cold; config and environment still own their primary Gateway route.
2037
var allowsGatewayUIKeychainAccess: Bool {
21-
!self.backgroundOnly
38+
self.mode == .interactive
39+
}
40+
41+
var allowsUpdater: Bool {
42+
!self.isElevationHost
43+
}
44+
45+
var allowsDockIcon: Bool {
46+
!self.isElevationHost
47+
}
48+
49+
var allowsInteractiveServices: Bool {
50+
!self.isElevationHost
2251
}
2352

2453
func shouldAutoOpenChat(arguments: [String]) -> Bool {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private let dashboardManagerLogger = Logger(subsystem: "ai.openclaw", category:
1111
final class DashboardManager {
1212
static let shared = DashboardManager(
1313
automaticGatewayProfileRefreshEnabled:
14-
AppLaunchPresentationPolicy.current.allowsGatewayUIKeychainAccess)
14+
AppLaunchRuntimePlan.current.allowsGatewayUIKeychainAccess)
1515

1616
private struct AuxiliaryWindowInstance {
1717
var target: DashboardGatewayTarget

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ final class DockIconManager: NSObject, @unchecked Sendable {
3939
} ?? []
4040

4141
let hasVisibleWindows = !visibleWindows.isEmpty
42-
let policy: NSApplication.ActivationPolicy = !userWantsDockHidden || hasVisibleWindows
43-
? .regular
44-
: .accessory
42+
let policy = Self.activationPolicy(
43+
launchPlan: .current,
44+
userWantsDockHidden: userWantsDockHidden,
45+
hasVisibleWindows: hasVisibleWindows)
4546
guard NSApp.activationPolicy() != policy else { return }
4647
NSApp.setActivationPolicy(policy)
4748
}
4849
}
4950

5051
func temporarilyShowDock() {
5152
Task { @MainActor in
53+
guard AppLaunchRuntimePlan.current.allowsDockIcon else { return }
5254
guard NSApp != nil else {
5355
self.logger.warning("NSApp not ready, cannot show Dock icon")
5456
return
@@ -58,6 +60,15 @@ final class DockIconManager: NSObject, @unchecked Sendable {
5860
}
5961
}
6062

63+
static func activationPolicy(
64+
launchPlan: AppLaunchRuntimePlan,
65+
userWantsDockHidden: Bool,
66+
hasVisibleWindows: Bool) -> NSApplication.ActivationPolicy
67+
{
68+
guard launchPlan.allowsDockIcon else { return .accessory }
69+
return !userWantsDockHidden || hasVisibleWindows ? .regular : .accessory
70+
}
71+
6172
private func setupObservers() {
6273
Task { @MainActor [self] in
6374
guard let app = NSApp else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ extension GatewayConnection {
10671067
}
10681068

10691069
static func activationBindingKey(
1070-
launchPolicy: AppLaunchPresentationPolicy,
1070+
launchPolicy: AppLaunchRuntimePlan,
10711071
loadOrCreate: () -> SymmetricKey?) -> SymmetricKey?
10721072
{
10731073
guard launchPolicy.allowsGatewayUIKeychainAccess else { return nil }

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ enum GatewayLaunchAgentManager {
1818
return testingDisableLaunchAgentMarkerURL
1919
}
2020
#endif
21-
let root = AppProfile.current.isActive
22-
? OpenClawPaths.stateDirURL
23-
: FileManager().homeDirectoryForCurrentUser.appendingPathComponent(".openclaw", isDirectory: true)
24-
return root.appendingPathComponent(self.disableLaunchAgentMarker)
21+
return self.disableLaunchAgentMarkerURL(in: OpenClawPaths.stateDirURL)
22+
}
23+
24+
static func disableLaunchAgentMarkerURL(in stateDirectoryURL: URL) -> URL {
25+
stateDirectoryURL.appendingPathComponent(self.disableLaunchAgentMarker)
2526
}
2627

2728
private static var plistURL: URL {

0 commit comments

Comments
 (0)