Skip to content

Commit 4bd4264

Browse files
committed
Merge origin/main into codex/wave1-agents-cleanup
2 parents 202f2a2 + ff73ba5 commit 4bd4264

413 files changed

Lines changed: 10106 additions & 4282 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ concurrency:
6969

7070
env:
7171
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
72-
IOS_SCREENSHOT_FASTLANE_VERSION: "2.236.1"
72+
IOS_SCREENSHOT_FASTLANE_VERSION: "2.238.0"
7373
IOS_SCREENSHOT_NODE_VERSION: "24.16.0"
7474
IOS_SCREENSHOT_XCODE_VERSION: "Xcode 26.6 Build version 17F113"
7575
NODE_VERSION: "24.x"
@@ -3610,9 +3610,9 @@ jobs:
36103610
needs: [preflight]
36113611
if: needs.preflight.outputs.run_macos_swift == 'true'
36123612
runs-on: ${{ vars.OPENCLAW_CI_RUNNER_BACKEND == 'github' && 'macos-26' || (github.event_name == 'workflow_dispatch' || github.run_attempt > 1) && 'macos-26' || (github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || contains(fromJSON('["OWNER","MEMBER","COLLABORATOR","CONTRIBUTOR"]'), github.event.pull_request.author_association)) && 'blacksmith-12vcpu-macos-26' || 'macos-26') }}
3613-
# Hosted runs may still be finalizing large Swift caches after every test
3614-
# passes; keep that post-job work non-blocking.
3615-
timeout-minutes: ${{ (vars.OPENCLAW_CI_RUNNER_BACKEND == 'github' || github.event_name == 'workflow_dispatch' || github.run_attempt > 1) && 30 || 20 }}
3613+
# Hosted paths include untrusted first-attempt PRs, so their timeout must
3614+
# follow the runner rather than inheriting Blacksmith's tighter budget.
3615+
timeout-minutes: ${{ (vars.OPENCLAW_CI_RUNNER_BACKEND == 'github' || github.event_name == 'workflow_dispatch' || github.run_attempt > 1 || github.repository != 'openclaw/openclaw' || (github.event_name == 'pull_request' && !contains(fromJSON('["OWNER","MEMBER","COLLABORATOR","CONTRIBUTOR"]'), github.event.pull_request.author_association))) && 30 || 20 }}
36163616
env:
36173617
HISTORICAL_TARGET: ${{ needs.preflight.outputs.compatibility_target }}
36183618
SWIFT_TEST_EXECUTION: ${{ (github.event_name == 'workflow_dispatch' || github.run_attempt > 1) && 'serial' || 'parallel' }}

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ repos:
6464
name: skills python tests
6565
entry: pytest -q -c skills/pyproject.toml skills
6666
language: python
67-
additional_dependencies: ["pytest>=8,<9"]
67+
additional_dependencies: ["pytest>=9,<10"]
6868
pass_filenames: false
6969
files: "^skills/.*\\.py$"
7070

‎apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ class GatewaySession(
10961096
} else {
10971097
ticketedPath
10981098
}
1099-
val url = "$scheme://${formatGatewayAuthority(endpoint.host, endpoint.port)}$playbackPath"
1099+
val url = "$scheme://${formatGatewayAuthority(endpoint.host, endpoint.port)}${endpoint.contextPath}$playbackPath"
11001100
val headers = mediaTransportHeaders()
11011101
return TicketedMediaRequest(url = url, headers = headers)
11021102
}

‎apps/android/app/src/main/java/ai/openclaw/app/node/JpegSizeLimiter.kt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package ai.openclaw.app.node
33
import android.graphics.Bitmap
44
import android.graphics.Matrix
55
import androidx.exifinterface.media.ExifInterface
6+
import java.io.InputStream
67
import kotlin.math.max
78
import kotlin.math.min
89
import kotlin.math.roundToInt
@@ -21,6 +22,15 @@ internal data class JpegSizeLimiterResult(
2122
* Utility that searches quality/scale combinations until a JPEG fits a byte budget.
2223
*/
2324
internal object JpegSizeLimiter {
25+
fun readOrientation(open: () -> InputStream?): Int =
26+
try {
27+
open()?.use { stream ->
28+
ExifInterface(stream).getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL)
29+
} ?: ExifInterface.ORIENTATION_NORMAL
30+
} catch (_: Exception) {
31+
ExifInterface.ORIENTATION_NORMAL
32+
}
33+
2434
/** Applies camera/gallery orientation before resize, display, or metadata-stripping JPEG encoding. */
2535
fun normalizeOrientation(
2636
bitmap: Bitmap,

‎apps/android/app/src/main/java/ai/openclaw/app/node/PhotosHandler.kt‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.net.Uri
1111
import android.os.Bundle
1212
import android.provider.MediaStore
1313
import androidx.core.graphics.scale
14+
import androidx.exifinterface.media.ExifInterface
1415
import kotlinx.serialization.json.Json
1516
import kotlinx.serialization.json.JsonPrimitive
1617
import kotlinx.serialization.json.buildJsonArray
@@ -159,22 +160,30 @@ private object SystemPhotosDataSource : PhotosDataSource {
159160
}
160161
if (bounds.outWidth <= 0 || bounds.outHeight <= 0) return null
161162

162-
val inSampleSize = computeInSampleSize(bounds.outWidth, maxWidth)
163+
val orientation = JpegSizeLimiter.readOrientation { resolver.openInputStream(uri) }
164+
val sourceWidth =
165+
if (orientation in ExifInterface.ORIENTATION_TRANSPOSE..ExifInterface.ORIENTATION_ROTATE_270) {
166+
bounds.outHeight
167+
} else {
168+
bounds.outWidth
169+
}
170+
val inSampleSize = computeInSampleSize(sourceWidth, maxWidth)
163171
val decodeOptions = BitmapFactory.Options().apply { this.inSampleSize = inSampleSize }
164172
val decoded =
165173
resolver.openInputStream(uri).use { input ->
166174
if (input == null) return null
167175
BitmapFactory.decodeStream(input, null, decodeOptions)
168176
} ?: return null
169177

170-
if (decoded.width <= maxWidth) return decoded
178+
val oriented = JpegSizeLimiter.normalizeOrientation(decoded, orientation)
179+
if (oriented.width <= maxWidth) return oriented
171180
// Decode sampling is power-of-two only; finish with exact scaling when the
172181
// sampled bitmap is still wider than the requested max width.
173-
val targetHeight = max(1, ((decoded.height.toDouble() * maxWidth) / decoded.width).roundToInt())
182+
val targetHeight = max(1, ((oriented.height.toDouble() * maxWidth) / oriented.width).roundToInt())
174183
return try {
175-
decoded.scale(maxWidth, targetHeight, true)
184+
oriented.scale(maxWidth, targetHeight, true)
176185
} finally {
177-
decoded.recycle()
186+
oriented.recycle()
178187
}
179188
}
180189

‎apps/android/app/src/main/java/ai/openclaw/app/ui/OnboardingFlow.kt‎

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,25 +3104,25 @@ internal fun canFinishOnboarding(
31043104
private val requiredContactPermissions = listOf(Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)
31053105
private val requiredCalendarPermissions = listOf(Manifest.permission.READ_CALENDAR, Manifest.permission.WRITE_CALENDAR)
31063106

3107-
internal fun initialCameraCapabilityEnabled(
3107+
internal fun initialDeviceCapabilityEnabled(
31083108
savedCapabilityEnabled: Boolean,
3109-
androidCameraPermissionGranted: Boolean,
3110-
): Boolean = savedCapabilityEnabled && androidCameraPermissionGranted
3109+
androidPermissionGranted: Boolean,
3110+
): Boolean = savedCapabilityEnabled && androidPermissionGranted
31113111

3112-
internal fun cameraPermissionRowStatusText(
3112+
internal fun deviceCapabilityRowStatusText(
31133113
capabilityEnabled: Boolean,
3114-
androidCameraPermissionGranted: Boolean,
3114+
androidPermissionGranted: Boolean,
31153115
): NativeText =
31163116
when {
31173117
capabilityEnabled -> nativeText("Enabled")
3118-
androidCameraPermissionGranted -> nativeText("Off")
3118+
androidPermissionGranted -> nativeText("Off")
31193119
else -> nativeText("Not allowed")
31203120
}
31213121

3122-
internal fun cameraCapabilityAfterRowTap(
3122+
internal fun deviceCapabilityAfterRowTap(
31233123
currentCapabilityEnabled: Boolean,
3124-
androidCameraPermissionGranted: Boolean,
3125-
): Boolean? = if (androidCameraPermissionGranted) !currentCapabilityEnabled else null
3124+
androidPermissionGranted: Boolean,
3125+
): Boolean? = if (androidPermissionGranted) !currentCapabilityEnabled else null
31263126

31273127
private fun permissionRowStatusText(granted: Boolean): NativeText = if (granted) nativeText("Granted") else nativeText("Not granted")
31283128

@@ -3148,9 +3148,15 @@ private fun rememberPermissionState(
31483148
val currentLocationMode by viewModel.locationMode.collectAsState()
31493149
var microphoneGranted by rememberSaveable { mutableStateOf(hasPermission(context, Manifest.permission.RECORD_AUDIO)) }
31503150
val cameraPermissionGranted = hasPermission(context, Manifest.permission.CAMERA)
3151-
var cameraGranted by rememberSaveable { mutableStateOf(initialCameraCapabilityEnabled(currentCameraEnabled, cameraPermissionGranted)) }
3151+
var cameraGranted by rememberSaveable { mutableStateOf(initialDeviceCapabilityEnabled(currentCameraEnabled, cameraPermissionGranted)) }
3152+
3153+
fun hasLocationPermission(): Boolean =
3154+
hasPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) ||
3155+
hasPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION)
3156+
3157+
val locationPermissionGranted = hasLocationPermission()
31523158
var locationGranted by rememberSaveable {
3153-
mutableStateOf(hasPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) || hasPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION))
3159+
mutableStateOf(initialDeviceCapabilityEnabled(currentLocationMode != LocationMode.Off, locationPermissionGranted))
31543160
}
31553161
val photosPermissions = photoReadPermissionsForRequest()
31563162
var photosGranted by rememberSaveable { mutableStateOf(hasPhotoReadPermission(context)) }
@@ -3238,9 +3244,9 @@ private fun rememberPermissionState(
32383244

32393245
fun requestCameraCapability() {
32403246
val nextCapabilityEnabled =
3241-
cameraCapabilityAfterRowTap(
3247+
deviceCapabilityAfterRowTap(
32423248
currentCapabilityEnabled = cameraGranted,
3243-
androidCameraPermissionGranted = hasPermission(context, Manifest.permission.CAMERA),
3249+
androidPermissionGranted = hasPermission(context, Manifest.permission.CAMERA),
32443250
)
32453251
if (nextCapabilityEnabled != null) {
32463252
cameraGranted = nextCapabilityEnabled
@@ -3260,14 +3266,26 @@ private fun rememberPermissionState(
32603266
nativeText("Capture photos and clips from this phone"),
32613267
Icons.Default.CameraAlt,
32623268
cameraGranted,
3263-
cameraPermissionRowStatusText(
3269+
deviceCapabilityRowStatusText(
32643270
capabilityEnabled = cameraGranted,
3265-
androidCameraPermissionGranted = hasPermission(context, Manifest.permission.CAMERA),
3271+
androidPermissionGranted = cameraPermissionGranted,
32663272
),
32673273
::requestCameraCapability,
32683274
),
3269-
PermissionRowModel(PermissionRowId.Location, nativeText("Location"), nativeText("Read this phone's location"), Icons.Default.LocationOn, locationGranted) {
3270-
request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
3275+
PermissionRowModel(
3276+
PermissionRowId.Location,
3277+
nativeText("Location"),
3278+
nativeText("Read this phone's location"),
3279+
Icons.Default.LocationOn,
3280+
locationGranted,
3281+
deviceCapabilityRowStatusText(locationGranted, locationPermissionGranted),
3282+
) {
3283+
val nextCapabilityEnabled = deviceCapabilityAfterRowTap(locationGranted, hasLocationPermission())
3284+
if (nextCapabilityEnabled != null) {
3285+
locationGranted = nextCapabilityEnabled
3286+
} else {
3287+
request(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION)
3288+
}
32713289
},
32723290
if (photosAvailable) {
32733291
PermissionRowModel(PermissionRowId.Photos, nativeText("Photos"), nativeText("Read recent photos and media"), Icons.Default.Image, photosGranted) {

‎apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatImageCodec.kt‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ import android.provider.OpenableColumns
1717
import android.util.Base64
1818
import android.util.LruCache
1919
import androidx.core.graphics.scale
20-
import androidx.exifinterface.media.ExifInterface
2120
import java.io.ByteArrayInputStream
2221
import java.io.ByteArrayOutputStream
23-
import java.io.InputStream
2422
import kotlin.math.max
2523
import kotlin.math.roundToInt
2624

@@ -251,7 +249,7 @@ internal fun decodeImageBytes(
251249
},
252250
) ?: return null
253251

254-
val oriented = JpegSizeLimiter.normalizeOrientation(bitmap, imageOrientation { ByteArrayInputStream(bytes) })
252+
val oriented = JpegSizeLimiter.normalizeOrientation(bitmap, JpegSizeLimiter.readOrientation { ByteArrayInputStream(bytes) })
255253
decodedBitmapCache.put(cacheKey, oriented)
256254
return oriented
257255
}
@@ -306,7 +304,7 @@ private fun decodeScaledBitmap(
306304
)
307305
} ?: return null
308306

309-
val oriented = JpegSizeLimiter.normalizeOrientation(decoded, imageOrientation { resolver.openInputStream(uri) })
307+
val oriented = JpegSizeLimiter.normalizeOrientation(decoded, JpegSizeLimiter.readOrientation { resolver.openInputStream(uri) })
310308
val longestEdge = max(oriented.width, oriented.height)
311309
if (longestEdge <= maxDimension) return oriented
312310

@@ -319,12 +317,3 @@ private fun decodeScaledBitmap(
319317
}
320318
return scaled
321319
}
322-
323-
private fun imageOrientation(open: () -> InputStream?): Int =
324-
try {
325-
open()?.use { stream ->
326-
ExifInterface(stream).getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL)
327-
} ?: ExifInterface.ORIENTATION_NORMAL
328-
} catch (_: Exception) {
329-
ExifInterface.ORIENTATION_NORMAL
330-
}

‎apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatMessageActions.kt‎

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ internal fun ChatMessageActionHost(
5959
onToggleListen: (() -> Unit)? = null,
6060
content: @Composable () -> Unit,
6161
) {
62-
if (!enabled || text.isBlank()) {
62+
if (!enabled || (text.isBlank() && !showSessionActions)) {
6363
Box(modifier = modifier) { content() }
6464
return
6565
}
@@ -81,27 +81,29 @@ internal fun ChatMessageActionHost(
8181
expanded = menuExpanded,
8282
onDismissRequest = { menuExpanded = false },
8383
) {
84-
onToggleListen?.let { toggleListen ->
85-
MessageActionItem(label = if (listenActive) nativeString("Stop") else nativeString("Listen")) {
86-
toggleListen()
84+
if (text.isNotBlank()) {
85+
onToggleListen?.let { toggleListen ->
86+
MessageActionItem(label = if (listenActive) nativeString("Stop") else nativeString("Listen")) {
87+
toggleListen()
88+
menuExpanded = false
89+
}
90+
}
91+
MessageActionItem(label = nativeString("Copy")) {
92+
copyChatMessage(context, text)
93+
menuExpanded = false
94+
}
95+
MessageActionItem(label = nativeString("Select text")) {
96+
menuExpanded = false
97+
selectText = true
98+
}
99+
MessageActionItem(label = nativeString("Share")) {
100+
shareChatMessage(context, text)
101+
menuExpanded = false
102+
}
103+
MessageActionItem(label = nativeString("Reply")) {
104+
onReply(quoteChatMessage(text))
87105
menuExpanded = false
88106
}
89-
}
90-
MessageActionItem(label = nativeString("Copy")) {
91-
copyChatMessage(context, text)
92-
menuExpanded = false
93-
}
94-
MessageActionItem(label = nativeString("Select text")) {
95-
menuExpanded = false
96-
selectText = true
97-
}
98-
MessageActionItem(label = nativeString("Share")) {
99-
shareChatMessage(context, text)
100-
menuExpanded = false
101-
}
102-
MessageActionItem(label = nativeString("Reply")) {
103-
onReply(quoteChatMessage(text))
104-
menuExpanded = false
105107
}
106108
if (showSessionActions) {
107109
onRewind?.let { rewind ->

0 commit comments

Comments
 (0)