Skip to content

Commit e6b928b

Browse files
Merge remote-tracking branch 'origin/main' into pr-119689-prep
2 parents cc31cea + 179f5fa commit e6b928b

140 files changed

Lines changed: 8223 additions & 7363 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.

‎apps/.i18n/native-source.json‎

Lines changed: 141 additions & 141 deletions
Large diffs are not rendered by default.

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ import ai.openclaw.app.node.LocationCaptureManager
8484
import ai.openclaw.app.node.LocationHandler
8585
import ai.openclaw.app.node.MobileUiHandler
8686
import ai.openclaw.app.node.MotionHandler
87+
import ai.openclaw.app.node.NodeInvokeSessionKeyEnvelope
8788
import ai.openclaw.app.node.NodePresenceAliveBeacon
8889
import ai.openclaw.app.node.NotificationsHandler
8990
import ai.openclaw.app.node.PhotosHandler
@@ -94,6 +95,7 @@ import ai.openclaw.app.node.SystemHandler
9495
import ai.openclaw.app.node.TalkHandler
9596
import ai.openclaw.app.node.asObjectOrNull
9697
import ai.openclaw.app.node.asStringOrNull
98+
import ai.openclaw.app.node.currentNodeInvokeSessionKeyEnvelope
9799
import ai.openclaw.app.node.invokeErrorFromThrowable
98100
import ai.openclaw.app.node.parseHexColorArgb
99101
import ai.openclaw.app.node.readAndroidPermissionSnapshot
@@ -109,6 +111,7 @@ import ai.openclaw.app.voice.TalkAudioPlayer
109111
import ai.openclaw.app.voice.TalkModeManager
110112
import ai.openclaw.app.voice.TalkPttOnceStart
111113
import ai.openclaw.app.voice.TalkPttStopPayload
114+
import ai.openclaw.app.voice.TalkSessionKeyEnvelope
112115
import ai.openclaw.app.voice.VoiceConversationEntry
113116
import ai.openclaw.app.voice.VoiceConversationRole
114117
import ai.openclaw.app.voice.VoiceWakeManager
@@ -183,6 +186,12 @@ private const val CRON_JOBS_SNAPSHOT_MAX_ATTEMPTS = 3
183186
private const val OperatorAdminScope = "operator.admin"
184187
private const val OperatorPairingScope = "operator.pairing"
185188

189+
private fun NodeInvokeSessionKeyEnvelope.toTalkSessionKeyEnvelope(): TalkSessionKeyEnvelope =
190+
when (this) {
191+
NodeInvokeSessionKeyEnvelope.Legacy -> TalkSessionKeyEnvelope.Legacy
192+
is NodeInvokeSessionKeyEnvelope.Authoritative -> TalkSessionKeyEnvelope.Authoritative(sessionKey)
193+
}
194+
186195
private fun execApprovalOutcomeUnknownMessage(): String = nativeText("Resolution outcome unknown. Actions stay disabled until the Gateway record is verified.").source
187196

188197
private fun execApprovalStillPendingMessage(): String = nativeText("The Gateway still shows this approval as pending. Review it before trying again.").source
@@ -1049,13 +1058,13 @@ class NodeRuntime private constructor(
10491058
systemHandler = systemHandler,
10501059
talkHandler =
10511060
object : TalkHandler {
1052-
override suspend fun handlePttStart(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttStart()
1061+
override suspend fun handlePttStart(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttStart(currentNodeInvokeSessionKeyEnvelope().toTalkSessionKeyEnvelope())
10531062

10541063
override suspend fun handlePttStop(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttStop()
10551064

10561065
override suspend fun handlePttCancel(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttCancel()
10571066

1058-
override suspend fun handlePttOnce(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttOnce()
1067+
override suspend fun handlePttOnce(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttOnce(currentNodeInvokeSessionKeyEnvelope().toTalkSessionKeyEnvelope())
10591068
},
10601069
photosHandler = photosHandler,
10611070
contactsHandler = contactsHandler,
@@ -1752,7 +1761,7 @@ class NodeRuntime private constructor(
17521761
},
17531762
onEvent = ::handleNodeGatewayEvent,
17541763
onInvoke = { req ->
1755-
invokeDispatcher.handleInvoke(req.command, req.paramsJson)
1764+
invokeDispatcher.handleInvoke(req)
17561765
},
17571766
onTlsFingerprint = { stableId, fingerprint ->
17581767
prefs.saveGatewayTlsFingerprint(stableId, fingerprint)
@@ -3548,7 +3557,7 @@ class NodeRuntime private constructor(
35483557
setVoiceCaptureMode(if (value) VoiceCaptureMode.TalkMode else VoiceCaptureMode.Off)
35493558
}
35503559

3551-
private suspend fun handleTalkPttStart(): GatewaySession.InvokeResult =
3560+
private suspend fun handleTalkPttStart(sessionKeyEnvelope: TalkSessionKeyEnvelope): GatewaySession.InvokeResult =
35523561
runTalkPttCommand {
35533562
talkMode.finishingPushToTalkCaptureId?.let {
35543563
return@runTalkPttCommand GatewaySession.InvokeResult.error(
@@ -3567,6 +3576,7 @@ class NodeRuntime private constructor(
35673576
val started =
35683577
talkMode.beginPushToTalk(
35693578
allowNewCapture = true,
3579+
sessionKeyEnvelope = sessionKeyEnvelope,
35703580
canStartCapture = {
35713581
_isForeground.value &&
35723582
voiceLifecycleEpoch.get() == lifecycleEpoch &&
@@ -3592,7 +3602,7 @@ class NodeRuntime private constructor(
35923602
GatewaySession.InvokeResult.ok(payload.toJson())
35933603
}
35943604

3595-
private suspend fun handleTalkPttOnce(): GatewaySession.InvokeResult =
3605+
private suspend fun handleTalkPttOnce(sessionKeyEnvelope: TalkSessionKeyEnvelope): GatewaySession.InvokeResult =
35963606
runTalkPttCommand {
35973607
currentTalkPttOnceBusy()?.let { busy ->
35983608
return@runTalkPttCommand GatewaySession.InvokeResult.ok(busy.payload.toJson())
@@ -3607,6 +3617,7 @@ class NodeRuntime private constructor(
36073617
) { ownershipEpoch ->
36083618
val started =
36093619
talkMode.beginPushToTalkOnce(
3620+
sessionKeyEnvelope = sessionKeyEnvelope,
36103621
canStartCapture = {
36113622
_isForeground.value &&
36123623
voiceLifecycleEpoch.get() == lifecycleEpoch &&

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ data class GatewayNodeInvokeRequest(
7272
val paramsJson: String? = null,
7373
val timeoutMs: Long? = null,
7474
val idempotencyKey: String? = null,
75+
val sessionKey: JsonElement? = null,
7576
)
7677

7778
@Serializable
@@ -378,6 +379,7 @@ enum class GatewayMethod(
378379
NodeDescribe("node.describe"),
379380
NodePluginSurfaceRefresh("node.pluginSurface.refresh"),
380381
NodePluginToolsUpdate("node.pluginTools.update"),
382+
NodeProtocolFeaturesUpdate("node.protocolFeatures.update"),
381383
NodeSkillsUpdate("node.skills.update"),
382384
NodePendingDrain("node.pending.drain"),
383385
NodePendingEnqueue("node.pending.enqueue"),

0 commit comments

Comments
 (0)